discord-jadx/app/src/main/java/com/discord/widgets/chat/input/ChatInputViewModel.java

2505 lines
121 KiB
Java

package com.discord.widgets.chat.input;
import a0.a.a.b;
import android.content.ContentResolver;
import android.content.Context;
import android.net.Uri;
import androidx.annotation.MainThread;
import androidx.annotation.StringRes;
import androidx.core.app.NotificationCompat;
import androidx.fragment.app.Fragment;
import b.d.b.a.a;
import com.discord.R;
import com.discord.api.channel.Channel;
import com.discord.api.channel.ChannelUtils;
import com.discord.api.guild.GuildVerificationLevel;
import com.discord.api.guildjoinrequest.ApplicationStatus;
import com.discord.api.guildjoinrequest.GuildJoinRequest;
import com.discord.api.message.MessageReference;
import com.discord.api.permission.Permission;
import com.discord.api.sticker.Sticker;
import com.discord.api.utcdatetime.UtcDateTime;
import com.discord.app.AppViewModel;
import com.discord.models.domain.ModelUserRelationship;
import com.discord.models.guild.Guild;
import com.discord.models.member.GuildMember;
import com.discord.models.message.Message;
import com.discord.models.user.MeUser;
import com.discord.models.user.User;
import com.discord.stores.StoreAnalytics;
import com.discord.stores.StoreApplicationCommandFrecency;
import com.discord.stores.StoreApplicationCommands;
import com.discord.stores.StoreApplicationInteractions;
import com.discord.stores.StoreChannels;
import com.discord.stores.StoreChannelsSelected;
import com.discord.stores.StoreChat;
import com.discord.stores.StoreGuildJoinRequest;
import com.discord.stores.StoreGuilds;
import com.discord.stores.StoreLurking;
import com.discord.stores.StoreMessagesLoader;
import com.discord.stores.StorePendingReplies;
import com.discord.stores.StorePermissions;
import com.discord.stores.StoreSlowMode;
import com.discord.stores.StoreStickers;
import com.discord.stores.StoreStream;
import com.discord.stores.StoreThreadDraft;
import com.discord.stores.StoreUser;
import com.discord.stores.StoreUserRelationships;
import com.discord.stores.StoreUserSettings;
import com.discord.utilities.KotlinExtensionsKt;
import com.discord.utilities.attachments.AttachmentUtilsKt;
import com.discord.utilities.guilds.GuildVerificationLevelUtils;
import com.discord.utilities.guilds.MemberVerificationUtils;
import com.discord.utilities.permissions.PermissionUtils;
import com.discord.utilities.premium.PremiumUtils;
import com.discord.utilities.rest.SendUtilsKt;
import com.discord.utilities.rx.ObservableExtensionsKt;
import com.discord.utilities.threads.ThreadUtils;
import com.discord.utilities.time.ClockFactory;
import com.discord.widgets.chat.MessageContent;
import com.discord.widgets.chat.MessageManager;
import com.discord.widgets.chat.input.autocomplete.Autocompletable;
import com.discord.widgets.chat.input.autocomplete.EmojiUpsellPlaceholder;
import com.discord.widgets.chat.input.emoji.EmojiAutocompletePremiumUpsellFeatureFlag;
import com.discord.widgets.chat.input.models.ApplicationCommandData;
import com.discord.widgets.chat.input.models.ApplicationCommandDataKt;
import com.discord.widgets.user.account.WidgetUserAccountVerifyBase;
import com.discord.widgets.user.email.WidgetUserEmailVerify;
import com.discord.widgets.user.phone.WidgetUserPhoneManage;
import com.lytefast.flexinput.model.Attachment;
import d0.t.n;
import d0.t.o;
import d0.t.u;
import d0.z.d.k;
import d0.z.d.m;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
import kotlin.NoWhenBranchMatchedException;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import rx.Observable;
import rx.subjects.PublishSubject;
/* compiled from: ChatInputViewModel.kt */
public final class ChatInputViewModel extends AppViewModel<ViewState> {
public static final Companion Companion = new Companion(null);
private final PublishSubject<Event> eventSubject;
private final boolean isEmojiAutocompleteUpsellEnabled;
private final StoreAnalytics storeAnalytics;
private final StoreApplicationCommands storeApplicationCommands;
private final StoreApplicationCommandFrecency storeApplicationCommandsFrecency;
private final StoreApplicationInteractions storeApplicationInteractions;
private final StoreChannels storeChannels;
private final StoreChat storeChat;
private final StoreGuilds storeGuilds;
private final StoreLurking storeLurking;
private final StoreMessagesLoader storeMessagesLoader;
private final StorePendingReplies storePendingReplies;
private final StoreStickers storeStickers;
private final StoreThreadDraft storeThreadDraft;
private final StoreUserSettings storeUserSettings;
private boolean useTimeoutUpdateInterval;
/* compiled from: ChatInputViewModel.kt */
/* renamed from: com.discord.widgets.chat.input.ChatInputViewModel$1 reason: invalid class name */
public static final /* synthetic */ class AnonymousClass1 extends k implements Function1<StoreState, Unit> {
public AnonymousClass1(ChatInputViewModel chatInputViewModel) {
super(1, chatInputViewModel, ChatInputViewModel.class, "handleStoreState", "handleStoreState(Lcom/discord/widgets/chat/input/ChatInputViewModel$StoreState;)V", 0);
}
/* 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(StoreState storeState) {
invoke(storeState);
return Unit.a;
}
public final void invoke(StoreState storeState) {
m.checkNotNullParameter(storeState, "p1");
ChatInputViewModel.access$handleStoreState((ChatInputViewModel) this.receiver, storeState);
}
}
/* compiled from: ChatInputViewModel.kt */
/* renamed from: com.discord.widgets.chat.input.ChatInputViewModel$2 reason: invalid class name */
public static final /* synthetic */ class AnonymousClass2 extends k implements Function1<StoreChat.Event, Unit> {
public AnonymousClass2(ChatInputViewModel chatInputViewModel) {
super(1, chatInputViewModel, ChatInputViewModel.class, "handleStoreChatEvent", "handleStoreChatEvent(Lcom/discord/stores/StoreChat$Event;)V", 0);
}
/* 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(StoreChat.Event event) {
invoke(event);
return Unit.a;
}
public final void invoke(StoreChat.Event event) {
m.checkNotNullParameter(event, "p1");
ChatInputViewModel.access$handleStoreChatEvent((ChatInputViewModel) this.receiver, event);
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class AttachmentContext {
private final List<Float> attachmentSizes;
private final ArrayList<Attachment<?>> attachments;
private final float currentFileSizeMB;
private final boolean hasGif;
private final boolean hasImage;
private final boolean hasVideo;
private final float maxAttachmentSizeMB;
public AttachmentContext(ArrayList<Attachment<?>> arrayList, boolean z2, boolean z3, boolean z4, List<Float> list, float f, float f2) {
m.checkNotNullParameter(arrayList, "attachments");
m.checkNotNullParameter(list, "attachmentSizes");
this.attachments = arrayList;
this.hasImage = z2;
this.hasVideo = z3;
this.hasGif = z4;
this.attachmentSizes = list;
this.currentFileSizeMB = f;
this.maxAttachmentSizeMB = f2;
}
/* JADX DEBUG: Multi-variable search result rejected for r5v0, resolved type: com.discord.widgets.chat.input.ChatInputViewModel$AttachmentContext */
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ AttachmentContext copy$default(AttachmentContext attachmentContext, ArrayList arrayList, boolean z2, boolean z3, boolean z4, List list, float f, float f2, int i, Object obj) {
if ((i & 1) != 0) {
arrayList = attachmentContext.attachments;
}
if ((i & 2) != 0) {
z2 = attachmentContext.hasImage;
}
if ((i & 4) != 0) {
z3 = attachmentContext.hasVideo;
}
if ((i & 8) != 0) {
z4 = attachmentContext.hasGif;
}
if ((i & 16) != 0) {
list = attachmentContext.attachmentSizes;
}
if ((i & 32) != 0) {
f = attachmentContext.currentFileSizeMB;
}
if ((i & 64) != 0) {
f2 = attachmentContext.maxAttachmentSizeMB;
}
return attachmentContext.copy(arrayList, z2, z3, z4, list, f, f2);
}
public final ArrayList<Attachment<?>> component1() {
return this.attachments;
}
public final boolean component2() {
return this.hasImage;
}
public final boolean component3() {
return this.hasVideo;
}
public final boolean component4() {
return this.hasGif;
}
public final List<Float> component5() {
return this.attachmentSizes;
}
public final float component6() {
return this.currentFileSizeMB;
}
public final float component7() {
return this.maxAttachmentSizeMB;
}
public final AttachmentContext copy(ArrayList<Attachment<?>> arrayList, boolean z2, boolean z3, boolean z4, List<Float> list, float f, float f2) {
m.checkNotNullParameter(arrayList, "attachments");
m.checkNotNullParameter(list, "attachmentSizes");
return new AttachmentContext(arrayList, z2, z3, z4, list, f, f2);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof AttachmentContext)) {
return false;
}
AttachmentContext attachmentContext = (AttachmentContext) obj;
return m.areEqual(this.attachments, attachmentContext.attachments) && this.hasImage == attachmentContext.hasImage && this.hasVideo == attachmentContext.hasVideo && this.hasGif == attachmentContext.hasGif && m.areEqual(this.attachmentSizes, attachmentContext.attachmentSizes) && Float.compare(this.currentFileSizeMB, attachmentContext.currentFileSizeMB) == 0 && Float.compare(this.maxAttachmentSizeMB, attachmentContext.maxAttachmentSizeMB) == 0;
}
public final List<Float> getAttachmentSizes() {
return this.attachmentSizes;
}
public final ArrayList<Attachment<?>> getAttachments() {
return this.attachments;
}
public final float getCurrentFileSizeMB() {
return this.currentFileSizeMB;
}
public final boolean getHasGif() {
return this.hasGif;
}
public final boolean getHasImage() {
return this.hasImage;
}
public final boolean getHasVideo() {
return this.hasVideo;
}
public final float getMaxAttachmentSizeMB() {
return this.maxAttachmentSizeMB;
}
public int hashCode() {
ArrayList<Attachment<?>> arrayList = this.attachments;
int i = 0;
int hashCode = (arrayList != null ? arrayList.hashCode() : 0) * 31;
boolean z2 = this.hasImage;
int i2 = 1;
if (z2) {
z2 = true;
}
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = z2 ? 1 : 0;
int i6 = (hashCode + i3) * 31;
boolean z3 = this.hasVideo;
if (z3) {
z3 = true;
}
int i7 = z3 ? 1 : 0;
int i8 = z3 ? 1 : 0;
int i9 = z3 ? 1 : 0;
int i10 = (i6 + i7) * 31;
boolean z4 = this.hasGif;
if (!z4) {
i2 = z4 ? 1 : 0;
}
int i11 = (i10 + i2) * 31;
List<Float> list = this.attachmentSizes;
if (list != null) {
i = list.hashCode();
}
return Float.floatToIntBits(this.maxAttachmentSizeMB) + ((Float.floatToIntBits(this.currentFileSizeMB) + ((i11 + i) * 31)) * 31);
}
public String toString() {
StringBuilder R = a.R("AttachmentContext(attachments=");
R.append(this.attachments);
R.append(", hasImage=");
R.append(this.hasImage);
R.append(", hasVideo=");
R.append(this.hasVideo);
R.append(", hasGif=");
R.append(this.hasGif);
R.append(", attachmentSizes=");
R.append(this.attachmentSizes);
R.append(", currentFileSizeMB=");
R.append(this.currentFileSizeMB);
R.append(", maxAttachmentSizeMB=");
R.append(this.maxAttachmentSizeMB);
R.append(")");
return R.toString();
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public static final /* synthetic */ Observable access$getIsOnCooldownObservable(Companion companion, long j, StoreSlowMode storeSlowMode) {
return companion.getIsOnCooldownObservable(j, storeSlowMode);
}
public static final /* synthetic */ Observable access$getPendingReplyStateObservable(Companion companion, long j, StorePendingReplies storePendingReplies) {
return companion.getPendingReplyStateObservable(j, storePendingReplies);
}
public static final /* synthetic */ Observable access$getVerificationLevelTriggeredObservable(Companion companion, long j, StoreGuilds storeGuilds, StoreUser storeUser) {
return companion.getVerificationLevelTriggeredObservable(j, storeGuilds, storeUser);
}
public static final /* synthetic */ Observable access$observeStoreState(Companion companion, StoreChannelsSelected storeChannelsSelected, StoreUser storeUser, StoreChat storeChat, StoreUserRelationships storeUserRelationships, StorePermissions storePermissions, StoreLurking storeLurking, StoreSlowMode storeSlowMode, StoreGuilds storeGuilds, StorePendingReplies storePendingReplies, StoreGuildJoinRequest storeGuildJoinRequest, StoreThreadDraft storeThreadDraft) {
return companion.observeStoreState(storeChannelsSelected, storeUser, storeChat, storeUserRelationships, storePermissions, storeLurking, storeSlowMode, storeGuilds, storePendingReplies, storeGuildJoinRequest, storeThreadDraft);
}
private final Observable<Boolean> getIsOnCooldownObservable(long j, StoreSlowMode storeSlowMode) {
return storeSlowMode.observeCooldownSecs(Long.valueOf(j), StoreSlowMode.Type.MessageSend.INSTANCE).F(ChatInputViewModel$Companion$getIsOnCooldownObservable$1.INSTANCE).q();
}
private final Observable<StoreState.Loaded.PendingReply> getPendingReplyStateObservable(long j, StorePendingReplies storePendingReplies) {
Observable<StoreState.Loaded.PendingReply> q = storePendingReplies.observePendingReply(j).Y(ChatInputViewModel$Companion$getPendingReplyStateObservable$1.INSTANCE).q();
m.checkNotNullExpressionValue(q, "storePendingReplies\n … .distinctUntilChanged()");
return q;
}
private final Observable<GuildVerificationLevel> getVerificationLevelTriggeredObservable(long j, StoreGuilds storeGuilds, StoreUser storeUser) {
return GuildVerificationLevelUtils.observeVerificationLevelTriggered$default(GuildVerificationLevelUtils.INSTANCE, j, storeGuilds, storeUser, null, 8, null);
}
private final Observable<StoreState> observeStoreState(StoreChannelsSelected storeChannelsSelected, StoreUser storeUser, StoreChat storeChat, StoreUserRelationships storeUserRelationships, StorePermissions storePermissions, StoreLurking storeLurking, StoreSlowMode storeSlowMode, StoreGuilds storeGuilds, StorePendingReplies storePendingReplies, StoreGuildJoinRequest storeGuildJoinRequest, StoreThreadDraft storeThreadDraft) {
Observable<R> Y = storeChannelsSelected.observeResolvedSelectedChannel().Y(new ChatInputViewModel$Companion$observeStoreState$1(storeUser, storeChat, storeUserRelationships, storePermissions, storeGuilds, storeLurking, storeSlowMode, storePendingReplies, storeGuildJoinRequest, storeThreadDraft));
m.checkNotNullExpressionValue(Y, "storeChannelsSelected.ob… }\n }\n }");
return Y;
}
}
/* compiled from: ChatInputViewModel.kt */
public static abstract class Event {
/* compiled from: ChatInputViewModel.kt */
public static final class AppendChatText extends Event {
private final String text;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AppendChatText(String str) {
super(null);
m.checkNotNullParameter(str, NotificationCompat.MessagingStyle.Message.KEY_TEXT);
this.text = str;
}
public static /* synthetic */ AppendChatText copy$default(AppendChatText appendChatText, String str, int i, Object obj) {
if ((i & 1) != 0) {
str = appendChatText.text;
}
return appendChatText.copy(str);
}
public final String component1() {
return this.text;
}
public final AppendChatText copy(String str) {
m.checkNotNullParameter(str, NotificationCompat.MessagingStyle.Message.KEY_TEXT);
return new AppendChatText(str);
}
public boolean equals(Object obj) {
if (this != obj) {
return (obj instanceof AppendChatText) && m.areEqual(this.text, ((AppendChatText) obj).text);
}
return true;
}
public final String getText() {
return this.text;
}
public int hashCode() {
String str = this.text;
if (str != null) {
return str.hashCode();
}
return 0;
}
public String toString() {
return a.H(a.R("AppendChatText(text="), this.text, ")");
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class CommandInputsInvalid extends Event {
public static final CommandInputsInvalid INSTANCE = new CommandInputsInvalid();
private CommandInputsInvalid() {
super(null);
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class EmptyThreadName extends Event {
public static final EmptyThreadName INSTANCE = new EmptyThreadName();
private EmptyThreadName() {
super(null);
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class FailedDeliveryToRecipient extends Event {
public static final FailedDeliveryToRecipient INSTANCE = new FailedDeliveryToRecipient();
private FailedDeliveryToRecipient() {
super(null);
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class FilesTooLarge extends Event {
private final List<Attachment<?>> attachments;
private final float currentFileSizeMB;
private final boolean hasGif;
private final boolean hasImage;
private final boolean hasVideo;
private final boolean isUserPremium;
private final float maxAttachmentSizeMB;
private final int maxFileSizeMB;
private final Function0<Unit> onResendCompressed;
/* JADX DEBUG: Multi-variable search result rejected for r6v0, resolved type: java.util.List<? extends com.lytefast.flexinput.model.Attachment<?>> */
/* JADX WARN: Multi-variable type inference failed */
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public FilesTooLarge(int i, float f, float f2, boolean z2, List<? extends Attachment<?>> list, boolean z3, boolean z4, boolean z5, Function0<Unit> function0) {
super(null);
m.checkNotNullParameter(list, "attachments");
this.maxFileSizeMB = i;
this.currentFileSizeMB = f;
this.maxAttachmentSizeMB = f2;
this.isUserPremium = z2;
this.attachments = list;
this.hasImage = z3;
this.hasVideo = z4;
this.hasGif = z5;
this.onResendCompressed = function0;
}
public static /* synthetic */ FilesTooLarge copy$default(FilesTooLarge filesTooLarge, int i, float f, float f2, boolean z2, List list, boolean z3, boolean z4, boolean z5, Function0 function0, int i2, Object obj) {
return filesTooLarge.copy((i2 & 1) != 0 ? filesTooLarge.maxFileSizeMB : i, (i2 & 2) != 0 ? filesTooLarge.currentFileSizeMB : f, (i2 & 4) != 0 ? filesTooLarge.maxAttachmentSizeMB : f2, (i2 & 8) != 0 ? filesTooLarge.isUserPremium : z2, (i2 & 16) != 0 ? filesTooLarge.attachments : list, (i2 & 32) != 0 ? filesTooLarge.hasImage : z3, (i2 & 64) != 0 ? filesTooLarge.hasVideo : z4, (i2 & 128) != 0 ? filesTooLarge.hasGif : z5, (i2 & 256) != 0 ? filesTooLarge.onResendCompressed : function0);
}
public final int component1() {
return this.maxFileSizeMB;
}
public final float component2() {
return this.currentFileSizeMB;
}
public final float component3() {
return this.maxAttachmentSizeMB;
}
public final boolean component4() {
return this.isUserPremium;
}
public final List<Attachment<?>> component5() {
return this.attachments;
}
public final boolean component6() {
return this.hasImage;
}
public final boolean component7() {
return this.hasVideo;
}
public final boolean component8() {
return this.hasGif;
}
public final Function0<Unit> component9() {
return this.onResendCompressed;
}
public final FilesTooLarge copy(int i, float f, float f2, boolean z2, List<? extends Attachment<?>> list, boolean z3, boolean z4, boolean z5, Function0<Unit> function0) {
m.checkNotNullParameter(list, "attachments");
return new FilesTooLarge(i, f, f2, z2, list, z3, z4, z5, function0);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof FilesTooLarge)) {
return false;
}
FilesTooLarge filesTooLarge = (FilesTooLarge) obj;
return this.maxFileSizeMB == filesTooLarge.maxFileSizeMB && Float.compare(this.currentFileSizeMB, filesTooLarge.currentFileSizeMB) == 0 && Float.compare(this.maxAttachmentSizeMB, filesTooLarge.maxAttachmentSizeMB) == 0 && this.isUserPremium == filesTooLarge.isUserPremium && m.areEqual(this.attachments, filesTooLarge.attachments) && this.hasImage == filesTooLarge.hasImage && this.hasVideo == filesTooLarge.hasVideo && this.hasGif == filesTooLarge.hasGif && m.areEqual(this.onResendCompressed, filesTooLarge.onResendCompressed);
}
public final List<Attachment<?>> getAttachments() {
return this.attachments;
}
public final float getCurrentFileSizeMB() {
return this.currentFileSizeMB;
}
public final boolean getHasGif() {
return this.hasGif;
}
public final boolean getHasImage() {
return this.hasImage;
}
public final boolean getHasVideo() {
return this.hasVideo;
}
public final float getMaxAttachmentSizeMB() {
return this.maxAttachmentSizeMB;
}
public final int getMaxFileSizeMB() {
return this.maxFileSizeMB;
}
public final Function0<Unit> getOnResendCompressed() {
return this.onResendCompressed;
}
public int hashCode() {
int floatToIntBits = (Float.floatToIntBits(this.maxAttachmentSizeMB) + ((Float.floatToIntBits(this.currentFileSizeMB) + (this.maxFileSizeMB * 31)) * 31)) * 31;
boolean z2 = this.isUserPremium;
int i = 1;
if (z2) {
z2 = true;
}
int i2 = z2 ? 1 : 0;
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = (floatToIntBits + i2) * 31;
List<Attachment<?>> list = this.attachments;
int i6 = 0;
int hashCode = (i5 + (list != null ? list.hashCode() : 0)) * 31;
boolean z3 = this.hasImage;
if (z3) {
z3 = true;
}
int i7 = z3 ? 1 : 0;
int i8 = z3 ? 1 : 0;
int i9 = z3 ? 1 : 0;
int i10 = (hashCode + i7) * 31;
boolean z4 = this.hasVideo;
if (z4) {
z4 = true;
}
int i11 = z4 ? 1 : 0;
int i12 = z4 ? 1 : 0;
int i13 = z4 ? 1 : 0;
int i14 = (i10 + i11) * 31;
boolean z5 = this.hasGif;
if (!z5) {
i = z5 ? 1 : 0;
}
int i15 = (i14 + i) * 31;
Function0<Unit> function0 = this.onResendCompressed;
if (function0 != null) {
i6 = function0.hashCode();
}
return i15 + i6;
}
public final boolean isUserPremium() {
return this.isUserPremium;
}
public String toString() {
StringBuilder R = a.R("FilesTooLarge(maxFileSizeMB=");
R.append(this.maxFileSizeMB);
R.append(", currentFileSizeMB=");
R.append(this.currentFileSizeMB);
R.append(", maxAttachmentSizeMB=");
R.append(this.maxAttachmentSizeMB);
R.append(", isUserPremium=");
R.append(this.isUserPremium);
R.append(", attachments=");
R.append(this.attachments);
R.append(", hasImage=");
R.append(this.hasImage);
R.append(", hasVideo=");
R.append(this.hasVideo);
R.append(", hasGif=");
R.append(this.hasGif);
R.append(", onResendCompressed=");
R.append(this.onResendCompressed);
R.append(")");
return R.toString();
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class MessageTooLong extends Event {
private final int currentCharacterCount;
private final int maxCharacterCount;
public MessageTooLong(int i, int i2) {
super(null);
this.currentCharacterCount = i;
this.maxCharacterCount = i2;
}
public static /* synthetic */ MessageTooLong copy$default(MessageTooLong messageTooLong, int i, int i2, int i3, Object obj) {
if ((i3 & 1) != 0) {
i = messageTooLong.currentCharacterCount;
}
if ((i3 & 2) != 0) {
i2 = messageTooLong.maxCharacterCount;
}
return messageTooLong.copy(i, i2);
}
public final int component1() {
return this.currentCharacterCount;
}
public final int component2() {
return this.maxCharacterCount;
}
public final MessageTooLong copy(int i, int i2) {
return new MessageTooLong(i, i2);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof MessageTooLong)) {
return false;
}
MessageTooLong messageTooLong = (MessageTooLong) obj;
return this.currentCharacterCount == messageTooLong.currentCharacterCount && this.maxCharacterCount == messageTooLong.maxCharacterCount;
}
public final int getCurrentCharacterCount() {
return this.currentCharacterCount;
}
public final int getMaxCharacterCount() {
return this.maxCharacterCount;
}
public int hashCode() {
return (this.currentCharacterCount * 31) + this.maxCharacterCount;
}
public String toString() {
StringBuilder R = a.R("MessageTooLong(currentCharacterCount=");
R.append(this.currentCharacterCount);
R.append(", maxCharacterCount=");
return a.A(R, this.maxCharacterCount, ")");
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class SetChatText extends Event {
private final String text;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public SetChatText(String str) {
super(null);
m.checkNotNullParameter(str, NotificationCompat.MessagingStyle.Message.KEY_TEXT);
this.text = str;
}
public static /* synthetic */ SetChatText copy$default(SetChatText setChatText, String str, int i, Object obj) {
if ((i & 1) != 0) {
str = setChatText.text;
}
return setChatText.copy(str);
}
public final String component1() {
return this.text;
}
public final SetChatText copy(String str) {
m.checkNotNullParameter(str, NotificationCompat.MessagingStyle.Message.KEY_TEXT);
return new SetChatText(str);
}
public boolean equals(Object obj) {
if (this != obj) {
return (obj instanceof SetChatText) && m.areEqual(this.text, ((SetChatText) obj).text);
}
return true;
}
public final String getText() {
return this.text;
}
public int hashCode() {
String str = this.text;
if (str != null) {
return str.hashCode();
}
return 0;
}
public String toString() {
return a.H(a.R("SetChatText(text="), this.text, ")");
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class ShowPremiumUpsell extends Event {
private final int bodyResId;
private final int headerResId;
private final int page;
private final boolean showLearnMore;
private final boolean showOtherPages;
public ShowPremiumUpsell(int i, @StringRes int i2, @StringRes int i3, boolean z2, boolean z3) {
super(null);
this.page = i;
this.headerResId = i2;
this.bodyResId = i3;
this.showOtherPages = z2;
this.showLearnMore = z3;
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public /* synthetic */ ShowPremiumUpsell(int i, int i2, int i3, boolean z2, boolean z3, int i4, DefaultConstructorMarker defaultConstructorMarker) {
this(i, i2, i3, (i4 & 8) != 0 ? false : z2, (i4 & 16) != 0 ? false : z3);
}
public static /* synthetic */ ShowPremiumUpsell copy$default(ShowPremiumUpsell showPremiumUpsell, int i, int i2, int i3, boolean z2, boolean z3, int i4, Object obj) {
if ((i4 & 1) != 0) {
i = showPremiumUpsell.page;
}
if ((i4 & 2) != 0) {
i2 = showPremiumUpsell.headerResId;
}
if ((i4 & 4) != 0) {
i3 = showPremiumUpsell.bodyResId;
}
if ((i4 & 8) != 0) {
z2 = showPremiumUpsell.showOtherPages;
}
if ((i4 & 16) != 0) {
z3 = showPremiumUpsell.showLearnMore;
}
return showPremiumUpsell.copy(i, i2, i3, z2, z3);
}
public final int component1() {
return this.page;
}
public final int component2() {
return this.headerResId;
}
public final int component3() {
return this.bodyResId;
}
public final boolean component4() {
return this.showOtherPages;
}
public final boolean component5() {
return this.showLearnMore;
}
public final ShowPremiumUpsell copy(int i, @StringRes int i2, @StringRes int i3, boolean z2, boolean z3) {
return new ShowPremiumUpsell(i, i2, i3, z2, z3);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof ShowPremiumUpsell)) {
return false;
}
ShowPremiumUpsell showPremiumUpsell = (ShowPremiumUpsell) obj;
return this.page == showPremiumUpsell.page && this.headerResId == showPremiumUpsell.headerResId && this.bodyResId == showPremiumUpsell.bodyResId && this.showOtherPages == showPremiumUpsell.showOtherPages && this.showLearnMore == showPremiumUpsell.showLearnMore;
}
public final int getBodyResId() {
return this.bodyResId;
}
public final int getHeaderResId() {
return this.headerResId;
}
public final int getPage() {
return this.page;
}
public final boolean getShowLearnMore() {
return this.showLearnMore;
}
public final boolean getShowOtherPages() {
return this.showOtherPages;
}
public int hashCode() {
int i = ((((this.page * 31) + this.headerResId) * 31) + this.bodyResId) * 31;
boolean z2 = this.showOtherPages;
int i2 = 1;
if (z2) {
z2 = true;
}
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = z2 ? 1 : 0;
int i6 = (i + i3) * 31;
boolean z3 = this.showLearnMore;
if (!z3) {
i2 = z3 ? 1 : 0;
}
return i6 + i2;
}
public String toString() {
StringBuilder R = a.R("ShowPremiumUpsell(page=");
R.append(this.page);
R.append(", headerResId=");
R.append(this.headerResId);
R.append(", bodyResId=");
R.append(this.bodyResId);
R.append(", showOtherPages=");
R.append(this.showOtherPages);
R.append(", showLearnMore=");
return a.L(R, this.showLearnMore, ")");
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class ThreadDraftClosed extends Event {
public static final ThreadDraftClosed INSTANCE = new ThreadDraftClosed();
private ThreadDraftClosed() {
super(null);
}
}
private Event() {
}
public /* synthetic */ Event(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
/* compiled from: ChatInputViewModel.kt */
public static abstract class StoreState {
/* compiled from: ChatInputViewModel.kt */
public static final class Loaded extends StoreState {
private final Channel channel;
private final Long channelPermissions;
private final StoreChat.EditingMessage editingMessage;
private final Guild guild;
private final GuildJoinRequest guildJoinRequest;
private final boolean isLurking;
private final boolean isOnCooldown;
/* renamed from: me reason: collision with root package name */
private final MeUser f2809me;
private final GuildMember meGuildMember;
private final PendingReply pendingReply;
private final Integer relationshipType;
private final StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft selectedThreadDraft;
private final StoreThreadDraft.ThreadDraftState threadDraftState;
private final GuildVerificationLevel verificationLevelTriggered;
/* compiled from: ChatInputViewModel.kt */
public static final class PendingReply {
private final StorePendingReplies.PendingReply pendingReply;
private final User repliedAuthor;
private final GuildMember repliedAuthorGuildMember;
public PendingReply(StorePendingReplies.PendingReply pendingReply, User user, GuildMember guildMember) {
m.checkNotNullParameter(pendingReply, "pendingReply");
this.pendingReply = pendingReply;
this.repliedAuthor = user;
this.repliedAuthorGuildMember = guildMember;
}
public static /* synthetic */ PendingReply copy$default(PendingReply pendingReply, StorePendingReplies.PendingReply pendingReply2, User user, GuildMember guildMember, int i, Object obj) {
if ((i & 1) != 0) {
pendingReply2 = pendingReply.pendingReply;
}
if ((i & 2) != 0) {
user = pendingReply.repliedAuthor;
}
if ((i & 4) != 0) {
guildMember = pendingReply.repliedAuthorGuildMember;
}
return pendingReply.copy(pendingReply2, user, guildMember);
}
public final StorePendingReplies.PendingReply component1() {
return this.pendingReply;
}
public final User component2() {
return this.repliedAuthor;
}
public final GuildMember component3() {
return this.repliedAuthorGuildMember;
}
public final PendingReply copy(StorePendingReplies.PendingReply pendingReply, User user, GuildMember guildMember) {
m.checkNotNullParameter(pendingReply, "pendingReply");
return new PendingReply(pendingReply, user, guildMember);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof PendingReply)) {
return false;
}
PendingReply pendingReply = (PendingReply) obj;
return m.areEqual(this.pendingReply, pendingReply.pendingReply) && m.areEqual(this.repliedAuthor, pendingReply.repliedAuthor) && m.areEqual(this.repliedAuthorGuildMember, pendingReply.repliedAuthorGuildMember);
}
public final StorePendingReplies.PendingReply getPendingReply() {
return this.pendingReply;
}
public final User getRepliedAuthor() {
return this.repliedAuthor;
}
public final GuildMember getRepliedAuthorGuildMember() {
return this.repliedAuthorGuildMember;
}
public int hashCode() {
StorePendingReplies.PendingReply pendingReply = this.pendingReply;
int i = 0;
int hashCode = (pendingReply != null ? pendingReply.hashCode() : 0) * 31;
User user = this.repliedAuthor;
int hashCode2 = (hashCode + (user != null ? user.hashCode() : 0)) * 31;
GuildMember guildMember = this.repliedAuthorGuildMember;
if (guildMember != null) {
i = guildMember.hashCode();
}
return hashCode2 + i;
}
public String toString() {
StringBuilder R = a.R("PendingReply(pendingReply=");
R.append(this.pendingReply);
R.append(", repliedAuthor=");
R.append(this.repliedAuthor);
R.append(", repliedAuthorGuildMember=");
R.append(this.repliedAuthorGuildMember);
R.append(")");
return R.toString();
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public Loaded(Channel channel, MeUser meUser, StoreChat.EditingMessage editingMessage, Integer num, Long l, GuildVerificationLevel guildVerificationLevel, boolean z2, boolean z3, Guild guild, PendingReply pendingReply, StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft threadDraft, GuildMember guildMember, GuildJoinRequest guildJoinRequest, StoreThreadDraft.ThreadDraftState threadDraftState) {
super(null);
m.checkNotNullParameter(channel, "channel");
m.checkNotNullParameter(meUser, "me");
m.checkNotNullParameter(guildVerificationLevel, "verificationLevelTriggered");
m.checkNotNullParameter(threadDraftState, "threadDraftState");
this.channel = channel;
this.f2809me = meUser;
this.editingMessage = editingMessage;
this.relationshipType = num;
this.channelPermissions = l;
this.verificationLevelTriggered = guildVerificationLevel;
this.isLurking = z2;
this.isOnCooldown = z3;
this.guild = guild;
this.pendingReply = pendingReply;
this.selectedThreadDraft = threadDraft;
this.meGuildMember = guildMember;
this.guildJoinRequest = guildJoinRequest;
this.threadDraftState = threadDraftState;
}
public static /* synthetic */ Loaded copy$default(Loaded loaded, Channel channel, MeUser meUser, StoreChat.EditingMessage editingMessage, Integer num, Long l, GuildVerificationLevel guildVerificationLevel, boolean z2, boolean z3, Guild guild, PendingReply pendingReply, StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft threadDraft, GuildMember guildMember, GuildJoinRequest guildJoinRequest, StoreThreadDraft.ThreadDraftState threadDraftState, int i, Object obj) {
return loaded.copy((i & 1) != 0 ? loaded.channel : channel, (i & 2) != 0 ? loaded.f2809me : meUser, (i & 4) != 0 ? loaded.editingMessage : editingMessage, (i & 8) != 0 ? loaded.relationshipType : num, (i & 16) != 0 ? loaded.channelPermissions : l, (i & 32) != 0 ? loaded.verificationLevelTriggered : guildVerificationLevel, (i & 64) != 0 ? loaded.isLurking : z2, (i & 128) != 0 ? loaded.isOnCooldown : z3, (i & 256) != 0 ? loaded.guild : guild, (i & 512) != 0 ? loaded.pendingReply : pendingReply, (i & 1024) != 0 ? loaded.selectedThreadDraft : threadDraft, (i & 2048) != 0 ? loaded.meGuildMember : guildMember, (i & 4096) != 0 ? loaded.guildJoinRequest : guildJoinRequest, (i & 8192) != 0 ? loaded.threadDraftState : threadDraftState);
}
public final Channel component1() {
return this.channel;
}
public final PendingReply component10() {
return this.pendingReply;
}
public final StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft component11() {
return this.selectedThreadDraft;
}
public final GuildMember component12() {
return this.meGuildMember;
}
public final GuildJoinRequest component13() {
return this.guildJoinRequest;
}
public final StoreThreadDraft.ThreadDraftState component14() {
return this.threadDraftState;
}
public final MeUser component2() {
return this.f2809me;
}
public final StoreChat.EditingMessage component3() {
return this.editingMessage;
}
public final Integer component4() {
return this.relationshipType;
}
public final Long component5() {
return this.channelPermissions;
}
public final GuildVerificationLevel component6() {
return this.verificationLevelTriggered;
}
public final boolean component7() {
return this.isLurking;
}
public final boolean component8() {
return this.isOnCooldown;
}
public final Guild component9() {
return this.guild;
}
public final Loaded copy(Channel channel, MeUser meUser, StoreChat.EditingMessage editingMessage, Integer num, Long l, GuildVerificationLevel guildVerificationLevel, boolean z2, boolean z3, Guild guild, PendingReply pendingReply, StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft threadDraft, GuildMember guildMember, GuildJoinRequest guildJoinRequest, StoreThreadDraft.ThreadDraftState threadDraftState) {
m.checkNotNullParameter(channel, "channel");
m.checkNotNullParameter(meUser, "me");
m.checkNotNullParameter(guildVerificationLevel, "verificationLevelTriggered");
m.checkNotNullParameter(threadDraftState, "threadDraftState");
return new Loaded(channel, meUser, editingMessage, num, l, guildVerificationLevel, z2, z3, guild, pendingReply, threadDraft, guildMember, guildJoinRequest, threadDraftState);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Loaded)) {
return false;
}
Loaded loaded = (Loaded) obj;
return m.areEqual(this.channel, loaded.channel) && m.areEqual(this.f2809me, loaded.f2809me) && m.areEqual(this.editingMessage, loaded.editingMessage) && m.areEqual(this.relationshipType, loaded.relationshipType) && m.areEqual(this.channelPermissions, loaded.channelPermissions) && m.areEqual(this.verificationLevelTriggered, loaded.verificationLevelTriggered) && this.isLurking == loaded.isLurking && this.isOnCooldown == loaded.isOnCooldown && m.areEqual(this.guild, loaded.guild) && m.areEqual(this.pendingReply, loaded.pendingReply) && m.areEqual(this.selectedThreadDraft, loaded.selectedThreadDraft) && m.areEqual(this.meGuildMember, loaded.meGuildMember) && m.areEqual(this.guildJoinRequest, loaded.guildJoinRequest) && m.areEqual(this.threadDraftState, loaded.threadDraftState);
}
public final Channel getChannel() {
return this.channel;
}
public final Long getChannelPermissions() {
return this.channelPermissions;
}
public final StoreChat.EditingMessage getEditingMessage() {
return this.editingMessage;
}
public final Guild getGuild() {
return this.guild;
}
public final GuildJoinRequest getGuildJoinRequest() {
return this.guildJoinRequest;
}
public final MeUser getMe() {
return this.f2809me;
}
public final GuildMember getMeGuildMember() {
return this.meGuildMember;
}
public final PendingReply getPendingReply() {
return this.pendingReply;
}
public final Integer getRelationshipType() {
return this.relationshipType;
}
public final StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft getSelectedThreadDraft() {
return this.selectedThreadDraft;
}
public final StoreThreadDraft.ThreadDraftState getThreadDraftState() {
return this.threadDraftState;
}
public final GuildVerificationLevel getVerificationLevelTriggered() {
return this.verificationLevelTriggered;
}
public int hashCode() {
Channel channel = this.channel;
int i = 0;
int hashCode = (channel != null ? channel.hashCode() : 0) * 31;
MeUser meUser = this.f2809me;
int hashCode2 = (hashCode + (meUser != null ? meUser.hashCode() : 0)) * 31;
StoreChat.EditingMessage editingMessage = this.editingMessage;
int hashCode3 = (hashCode2 + (editingMessage != null ? editingMessage.hashCode() : 0)) * 31;
Integer num = this.relationshipType;
int hashCode4 = (hashCode3 + (num != null ? num.hashCode() : 0)) * 31;
Long l = this.channelPermissions;
int hashCode5 = (hashCode4 + (l != null ? l.hashCode() : 0)) * 31;
GuildVerificationLevel guildVerificationLevel = this.verificationLevelTriggered;
int hashCode6 = (hashCode5 + (guildVerificationLevel != null ? guildVerificationLevel.hashCode() : 0)) * 31;
boolean z2 = this.isLurking;
int i2 = 1;
if (z2) {
z2 = true;
}
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = z2 ? 1 : 0;
int i6 = (hashCode6 + i3) * 31;
boolean z3 = this.isOnCooldown;
if (!z3) {
i2 = z3 ? 1 : 0;
}
int i7 = (i6 + i2) * 31;
Guild guild = this.guild;
int hashCode7 = (i7 + (guild != null ? guild.hashCode() : 0)) * 31;
PendingReply pendingReply = this.pendingReply;
int hashCode8 = (hashCode7 + (pendingReply != null ? pendingReply.hashCode() : 0)) * 31;
StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft threadDraft = this.selectedThreadDraft;
int hashCode9 = (hashCode8 + (threadDraft != null ? threadDraft.hashCode() : 0)) * 31;
GuildMember guildMember = this.meGuildMember;
int hashCode10 = (hashCode9 + (guildMember != null ? guildMember.hashCode() : 0)) * 31;
GuildJoinRequest guildJoinRequest = this.guildJoinRequest;
int hashCode11 = (hashCode10 + (guildJoinRequest != null ? guildJoinRequest.hashCode() : 0)) * 31;
StoreThreadDraft.ThreadDraftState threadDraftState = this.threadDraftState;
if (threadDraftState != null) {
i = threadDraftState.hashCode();
}
return hashCode11 + i;
}
public final boolean isLurking() {
return this.isLurking;
}
public final boolean isOnCooldown() {
return this.isOnCooldown;
}
public String toString() {
StringBuilder R = a.R("Loaded(channel=");
R.append(this.channel);
R.append(", me=");
R.append(this.f2809me);
R.append(", editingMessage=");
R.append(this.editingMessage);
R.append(", relationshipType=");
R.append(this.relationshipType);
R.append(", channelPermissions=");
R.append(this.channelPermissions);
R.append(", verificationLevelTriggered=");
R.append(this.verificationLevelTriggered);
R.append(", isLurking=");
R.append(this.isLurking);
R.append(", isOnCooldown=");
R.append(this.isOnCooldown);
R.append(", guild=");
R.append(this.guild);
R.append(", pendingReply=");
R.append(this.pendingReply);
R.append(", selectedThreadDraft=");
R.append(this.selectedThreadDraft);
R.append(", meGuildMember=");
R.append(this.meGuildMember);
R.append(", guildJoinRequest=");
R.append(this.guildJoinRequest);
R.append(", threadDraftState=");
R.append(this.threadDraftState);
R.append(")");
return R.toString();
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class Loading extends StoreState {
public static final Loading INSTANCE = new Loading();
private Loading() {
super(null);
}
}
private StoreState() {
}
public /* synthetic */ StoreState(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
/* compiled from: ChatInputViewModel.kt */
public static abstract class ViewState {
/* compiled from: ChatInputViewModel.kt */
public static final class Loaded extends ViewState {
private final boolean ableToSendMessage;
private final Channel channel;
private final long channelId;
private final StoreChat.EditingMessage editingMessage;
private final boolean isBlocked;
private final boolean isCommunicationDisabled;
private final boolean isEditing;
private final boolean isInputShowing;
private final boolean isLurking;
private final boolean isOnCooldown;
private final boolean isReplying;
private final boolean isSystemDM;
private final boolean isVerificationLevelTriggered;
private final ApplicationStatus joinRequestStatus;
private final int maxFileSizeMB;
/* renamed from: me reason: collision with root package name */
private final MeUser f2810me;
private final GuildMember meGuildMember;
private final PendingReplyState pendingReplyState;
private final StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft selectedThreadDraft;
private final boolean shouldBadgeChatInput;
private final boolean shouldShowFollow;
private final boolean shouldShowVerificationGate;
private final boolean showCreateThreadOption;
private final StoreThreadDraft.ThreadDraftState threadDraftState;
private final long timeoutLeftMs;
private final GuildVerificationLevel verificationLevelTriggered;
/* compiled from: ChatInputViewModel.kt */
public static abstract class PendingReplyState {
/* compiled from: ChatInputViewModel.kt */
public static final class Hide extends PendingReplyState {
public static final Hide INSTANCE = new Hide();
private Hide() {
super(null);
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class Replying extends PendingReplyState {
private final MessageReference messageReference;
private final User repliedAuthor;
private final GuildMember repliedAuthorGuildMember;
private final boolean shouldMention;
private final boolean showMentionToggle;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public Replying(MessageReference messageReference, boolean z2, boolean z3, User user, GuildMember guildMember) {
super(null);
m.checkNotNullParameter(messageReference, "messageReference");
m.checkNotNullParameter(user, "repliedAuthor");
this.messageReference = messageReference;
this.shouldMention = z2;
this.showMentionToggle = z3;
this.repliedAuthor = user;
this.repliedAuthorGuildMember = guildMember;
}
public static /* synthetic */ Replying copy$default(Replying replying, MessageReference messageReference, boolean z2, boolean z3, User user, GuildMember guildMember, int i, Object obj) {
if ((i & 1) != 0) {
messageReference = replying.messageReference;
}
if ((i & 2) != 0) {
z2 = replying.shouldMention;
}
if ((i & 4) != 0) {
z3 = replying.showMentionToggle;
}
if ((i & 8) != 0) {
user = replying.repliedAuthor;
}
if ((i & 16) != 0) {
guildMember = replying.repliedAuthorGuildMember;
}
return replying.copy(messageReference, z2, z3, user, guildMember);
}
public final MessageReference component1() {
return this.messageReference;
}
public final boolean component2() {
return this.shouldMention;
}
public final boolean component3() {
return this.showMentionToggle;
}
public final User component4() {
return this.repliedAuthor;
}
public final GuildMember component5() {
return this.repliedAuthorGuildMember;
}
public final Replying copy(MessageReference messageReference, boolean z2, boolean z3, User user, GuildMember guildMember) {
m.checkNotNullParameter(messageReference, "messageReference");
m.checkNotNullParameter(user, "repliedAuthor");
return new Replying(messageReference, z2, z3, user, guildMember);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Replying)) {
return false;
}
Replying replying = (Replying) obj;
return m.areEqual(this.messageReference, replying.messageReference) && this.shouldMention == replying.shouldMention && this.showMentionToggle == replying.showMentionToggle && m.areEqual(this.repliedAuthor, replying.repliedAuthor) && m.areEqual(this.repliedAuthorGuildMember, replying.repliedAuthorGuildMember);
}
public final MessageReference getMessageReference() {
return this.messageReference;
}
public final User getRepliedAuthor() {
return this.repliedAuthor;
}
public final GuildMember getRepliedAuthorGuildMember() {
return this.repliedAuthorGuildMember;
}
public final boolean getShouldMention() {
return this.shouldMention;
}
public final boolean getShowMentionToggle() {
return this.showMentionToggle;
}
public int hashCode() {
MessageReference messageReference = this.messageReference;
int i = 0;
int hashCode = (messageReference != null ? messageReference.hashCode() : 0) * 31;
boolean z2 = this.shouldMention;
int i2 = 1;
if (z2) {
z2 = true;
}
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = z2 ? 1 : 0;
int i6 = (hashCode + i3) * 31;
boolean z3 = this.showMentionToggle;
if (!z3) {
i2 = z3 ? 1 : 0;
}
int i7 = (i6 + i2) * 31;
User user = this.repliedAuthor;
int hashCode2 = (i7 + (user != null ? user.hashCode() : 0)) * 31;
GuildMember guildMember = this.repliedAuthorGuildMember;
if (guildMember != null) {
i = guildMember.hashCode();
}
return hashCode2 + i;
}
public String toString() {
StringBuilder R = a.R("Replying(messageReference=");
R.append(this.messageReference);
R.append(", shouldMention=");
R.append(this.shouldMention);
R.append(", showMentionToggle=");
R.append(this.showMentionToggle);
R.append(", repliedAuthor=");
R.append(this.repliedAuthor);
R.append(", repliedAuthorGuildMember=");
R.append(this.repliedAuthorGuildMember);
R.append(")");
return R.toString();
}
}
private PendingReplyState() {
}
public /* synthetic */ PendingReplyState(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public Loaded(Channel channel, long j, MeUser meUser, GuildMember guildMember, StoreChat.EditingMessage editingMessage, boolean z2, GuildVerificationLevel guildVerificationLevel, boolean z3, boolean z4, boolean z5, int i, boolean z6, PendingReplyState pendingReplyState, boolean z7, boolean z8, boolean z9, boolean z10, boolean z11, boolean z12, boolean z13, long j2, StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft threadDraft, boolean z14, ApplicationStatus applicationStatus, StoreThreadDraft.ThreadDraftState threadDraftState, boolean z15) {
super(null);
m.checkNotNullParameter(channel, "channel");
m.checkNotNullParameter(guildVerificationLevel, "verificationLevelTriggered");
m.checkNotNullParameter(pendingReplyState, "pendingReplyState");
m.checkNotNullParameter(threadDraftState, "threadDraftState");
this.channel = channel;
this.channelId = j;
this.f2810me = meUser;
this.meGuildMember = guildMember;
this.editingMessage = editingMessage;
this.ableToSendMessage = z2;
this.verificationLevelTriggered = guildVerificationLevel;
this.isLurking = z3;
this.isSystemDM = z4;
this.isOnCooldown = z5;
this.maxFileSizeMB = i;
this.shouldShowFollow = z6;
this.pendingReplyState = pendingReplyState;
this.shouldBadgeChatInput = z7;
this.isBlocked = z8;
this.isInputShowing = z9;
this.isVerificationLevelTriggered = z10;
this.isEditing = z11;
this.isReplying = z12;
this.isCommunicationDisabled = z13;
this.timeoutLeftMs = j2;
this.selectedThreadDraft = threadDraft;
this.shouldShowVerificationGate = z14;
this.joinRequestStatus = applicationStatus;
this.threadDraftState = threadDraftState;
this.showCreateThreadOption = z15;
}
public static /* synthetic */ Loaded copy$default(Loaded loaded, Channel channel, long j, MeUser meUser, GuildMember guildMember, StoreChat.EditingMessage editingMessage, boolean z2, GuildVerificationLevel guildVerificationLevel, boolean z3, boolean z4, boolean z5, int i, boolean z6, PendingReplyState pendingReplyState, boolean z7, boolean z8, boolean z9, boolean z10, boolean z11, boolean z12, boolean z13, long j2, StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft threadDraft, boolean z14, ApplicationStatus applicationStatus, StoreThreadDraft.ThreadDraftState threadDraftState, boolean z15, int i2, Object obj) {
return loaded.copy((i2 & 1) != 0 ? loaded.channel : channel, (i2 & 2) != 0 ? loaded.channelId : j, (i2 & 4) != 0 ? loaded.f2810me : meUser, (i2 & 8) != 0 ? loaded.meGuildMember : guildMember, (i2 & 16) != 0 ? loaded.editingMessage : editingMessage, (i2 & 32) != 0 ? loaded.ableToSendMessage : z2, (i2 & 64) != 0 ? loaded.verificationLevelTriggered : guildVerificationLevel, (i2 & 128) != 0 ? loaded.isLurking : z3, (i2 & 256) != 0 ? loaded.isSystemDM : z4, (i2 & 512) != 0 ? loaded.isOnCooldown : z5, (i2 & 1024) != 0 ? loaded.maxFileSizeMB : i, (i2 & 2048) != 0 ? loaded.shouldShowFollow : z6, (i2 & 4096) != 0 ? loaded.pendingReplyState : pendingReplyState, (i2 & 8192) != 0 ? loaded.shouldBadgeChatInput : z7, (i2 & 16384) != 0 ? loaded.isBlocked : z8, (i2 & 32768) != 0 ? loaded.isInputShowing : z9, (i2 & 65536) != 0 ? loaded.isVerificationLevelTriggered : z10, (i2 & 131072) != 0 ? loaded.isEditing : z11, (i2 & 262144) != 0 ? loaded.isReplying : z12, (i2 & 524288) != 0 ? loaded.isCommunicationDisabled : z13, (i2 & 1048576) != 0 ? loaded.timeoutLeftMs : j2, (i2 & 2097152) != 0 ? loaded.selectedThreadDraft : threadDraft, (4194304 & i2) != 0 ? loaded.shouldShowVerificationGate : z14, (i2 & 8388608) != 0 ? loaded.joinRequestStatus : applicationStatus, (i2 & 16777216) != 0 ? loaded.threadDraftState : threadDraftState, (i2 & 33554432) != 0 ? loaded.showCreateThreadOption : z15);
}
public final Channel component1() {
return this.channel;
}
public final boolean component10() {
return this.isOnCooldown;
}
public final int component11() {
return this.maxFileSizeMB;
}
public final boolean component12() {
return this.shouldShowFollow;
}
public final PendingReplyState component13() {
return this.pendingReplyState;
}
public final boolean component14() {
return this.shouldBadgeChatInput;
}
public final boolean component15() {
return this.isBlocked;
}
public final boolean component16() {
return this.isInputShowing;
}
public final boolean component17() {
return this.isVerificationLevelTriggered;
}
public final boolean component18() {
return this.isEditing;
}
public final boolean component19() {
return this.isReplying;
}
public final long component2() {
return this.channelId;
}
public final boolean component20() {
return this.isCommunicationDisabled;
}
public final long component21() {
return this.timeoutLeftMs;
}
public final StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft component22() {
return this.selectedThreadDraft;
}
public final boolean component23() {
return this.shouldShowVerificationGate;
}
public final ApplicationStatus component24() {
return this.joinRequestStatus;
}
public final StoreThreadDraft.ThreadDraftState component25() {
return this.threadDraftState;
}
public final boolean component26() {
return this.showCreateThreadOption;
}
public final MeUser component3() {
return this.f2810me;
}
public final GuildMember component4() {
return this.meGuildMember;
}
public final StoreChat.EditingMessage component5() {
return this.editingMessage;
}
public final boolean component6() {
return this.ableToSendMessage;
}
public final GuildVerificationLevel component7() {
return this.verificationLevelTriggered;
}
public final boolean component8() {
return this.isLurking;
}
public final boolean component9() {
return this.isSystemDM;
}
public final Loaded copy(Channel channel, long j, MeUser meUser, GuildMember guildMember, StoreChat.EditingMessage editingMessage, boolean z2, GuildVerificationLevel guildVerificationLevel, boolean z3, boolean z4, boolean z5, int i, boolean z6, PendingReplyState pendingReplyState, boolean z7, boolean z8, boolean z9, boolean z10, boolean z11, boolean z12, boolean z13, long j2, StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft threadDraft, boolean z14, ApplicationStatus applicationStatus, StoreThreadDraft.ThreadDraftState threadDraftState, boolean z15) {
m.checkNotNullParameter(channel, "channel");
m.checkNotNullParameter(guildVerificationLevel, "verificationLevelTriggered");
m.checkNotNullParameter(pendingReplyState, "pendingReplyState");
m.checkNotNullParameter(threadDraftState, "threadDraftState");
return new Loaded(channel, j, meUser, guildMember, editingMessage, z2, guildVerificationLevel, z3, z4, z5, i, z6, pendingReplyState, z7, z8, z9, z10, z11, z12, z13, j2, threadDraft, z14, applicationStatus, threadDraftState, z15);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Loaded)) {
return false;
}
Loaded loaded = (Loaded) obj;
return m.areEqual(this.channel, loaded.channel) && this.channelId == loaded.channelId && m.areEqual(this.f2810me, loaded.f2810me) && m.areEqual(this.meGuildMember, loaded.meGuildMember) && m.areEqual(this.editingMessage, loaded.editingMessage) && this.ableToSendMessage == loaded.ableToSendMessage && m.areEqual(this.verificationLevelTriggered, loaded.verificationLevelTriggered) && this.isLurking == loaded.isLurking && this.isSystemDM == loaded.isSystemDM && this.isOnCooldown == loaded.isOnCooldown && this.maxFileSizeMB == loaded.maxFileSizeMB && this.shouldShowFollow == loaded.shouldShowFollow && m.areEqual(this.pendingReplyState, loaded.pendingReplyState) && this.shouldBadgeChatInput == loaded.shouldBadgeChatInput && this.isBlocked == loaded.isBlocked && this.isInputShowing == loaded.isInputShowing && this.isVerificationLevelTriggered == loaded.isVerificationLevelTriggered && this.isEditing == loaded.isEditing && this.isReplying == loaded.isReplying && this.isCommunicationDisabled == loaded.isCommunicationDisabled && this.timeoutLeftMs == loaded.timeoutLeftMs && m.areEqual(this.selectedThreadDraft, loaded.selectedThreadDraft) && this.shouldShowVerificationGate == loaded.shouldShowVerificationGate && m.areEqual(this.joinRequestStatus, loaded.joinRequestStatus) && m.areEqual(this.threadDraftState, loaded.threadDraftState) && this.showCreateThreadOption == loaded.showCreateThreadOption;
}
public final boolean getAbleToSendMessage() {
return this.ableToSendMessage;
}
public final Channel getChannel() {
return this.channel;
}
public final long getChannelId() {
return this.channelId;
}
public final StoreChat.EditingMessage getEditingMessage() {
return this.editingMessage;
}
public final ApplicationStatus getJoinRequestStatus() {
return this.joinRequestStatus;
}
public final int getMaxFileSizeMB() {
return this.maxFileSizeMB;
}
public final MeUser getMe() {
return this.f2810me;
}
public final GuildMember getMeGuildMember() {
return this.meGuildMember;
}
public final PendingReplyState getPendingReplyState() {
return this.pendingReplyState;
}
public final StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft getSelectedThreadDraft() {
return this.selectedThreadDraft;
}
public final boolean getShouldBadgeChatInput() {
return this.shouldBadgeChatInput;
}
public final boolean getShouldShowFollow() {
return this.shouldShowFollow;
}
public final boolean getShouldShowVerificationGate() {
return this.shouldShowVerificationGate;
}
public final boolean getShowCreateThreadOption() {
return this.showCreateThreadOption;
}
public final StoreThreadDraft.ThreadDraftState getThreadDraftState() {
return this.threadDraftState;
}
public final long getTimeoutLeftMs() {
return this.timeoutLeftMs;
}
public final GuildVerificationLevel getVerificationLevelTriggered() {
return this.verificationLevelTriggered;
}
public int hashCode() {
Channel channel = this.channel;
int i = 0;
int a = (b.a(this.channelId) + ((channel != null ? channel.hashCode() : 0) * 31)) * 31;
MeUser meUser = this.f2810me;
int hashCode = (a + (meUser != null ? meUser.hashCode() : 0)) * 31;
GuildMember guildMember = this.meGuildMember;
int hashCode2 = (hashCode + (guildMember != null ? guildMember.hashCode() : 0)) * 31;
StoreChat.EditingMessage editingMessage = this.editingMessage;
int hashCode3 = (hashCode2 + (editingMessage != null ? editingMessage.hashCode() : 0)) * 31;
boolean z2 = this.ableToSendMessage;
int i2 = 1;
if (z2) {
z2 = true;
}
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = z2 ? 1 : 0;
int i6 = (hashCode3 + i3) * 31;
GuildVerificationLevel guildVerificationLevel = this.verificationLevelTriggered;
int hashCode4 = (i6 + (guildVerificationLevel != null ? guildVerificationLevel.hashCode() : 0)) * 31;
boolean z3 = this.isLurking;
if (z3) {
z3 = true;
}
int i7 = z3 ? 1 : 0;
int i8 = z3 ? 1 : 0;
int i9 = z3 ? 1 : 0;
int i10 = (hashCode4 + i7) * 31;
boolean z4 = this.isSystemDM;
if (z4) {
z4 = true;
}
int i11 = z4 ? 1 : 0;
int i12 = z4 ? 1 : 0;
int i13 = z4 ? 1 : 0;
int i14 = (i10 + i11) * 31;
boolean z5 = this.isOnCooldown;
if (z5) {
z5 = true;
}
int i15 = z5 ? 1 : 0;
int i16 = z5 ? 1 : 0;
int i17 = z5 ? 1 : 0;
int i18 = (((i14 + i15) * 31) + this.maxFileSizeMB) * 31;
boolean z6 = this.shouldShowFollow;
if (z6) {
z6 = true;
}
int i19 = z6 ? 1 : 0;
int i20 = z6 ? 1 : 0;
int i21 = z6 ? 1 : 0;
int i22 = (i18 + i19) * 31;
PendingReplyState pendingReplyState = this.pendingReplyState;
int hashCode5 = (i22 + (pendingReplyState != null ? pendingReplyState.hashCode() : 0)) * 31;
boolean z7 = this.shouldBadgeChatInput;
if (z7) {
z7 = true;
}
int i23 = z7 ? 1 : 0;
int i24 = z7 ? 1 : 0;
int i25 = z7 ? 1 : 0;
int i26 = (hashCode5 + i23) * 31;
boolean z8 = this.isBlocked;
if (z8) {
z8 = true;
}
int i27 = z8 ? 1 : 0;
int i28 = z8 ? 1 : 0;
int i29 = z8 ? 1 : 0;
int i30 = (i26 + i27) * 31;
boolean z9 = this.isInputShowing;
if (z9) {
z9 = true;
}
int i31 = z9 ? 1 : 0;
int i32 = z9 ? 1 : 0;
int i33 = z9 ? 1 : 0;
int i34 = (i30 + i31) * 31;
boolean z10 = this.isVerificationLevelTriggered;
if (z10) {
z10 = true;
}
int i35 = z10 ? 1 : 0;
int i36 = z10 ? 1 : 0;
int i37 = z10 ? 1 : 0;
int i38 = (i34 + i35) * 31;
boolean z11 = this.isEditing;
if (z11) {
z11 = true;
}
int i39 = z11 ? 1 : 0;
int i40 = z11 ? 1 : 0;
int i41 = z11 ? 1 : 0;
int i42 = (i38 + i39) * 31;
boolean z12 = this.isReplying;
if (z12) {
z12 = true;
}
int i43 = z12 ? 1 : 0;
int i44 = z12 ? 1 : 0;
int i45 = z12 ? 1 : 0;
int i46 = (i42 + i43) * 31;
boolean z13 = this.isCommunicationDisabled;
if (z13) {
z13 = true;
}
int i47 = z13 ? 1 : 0;
int i48 = z13 ? 1 : 0;
int i49 = z13 ? 1 : 0;
int a2 = (b.a(this.timeoutLeftMs) + ((i46 + i47) * 31)) * 31;
StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft threadDraft = this.selectedThreadDraft;
int hashCode6 = (a2 + (threadDraft != null ? threadDraft.hashCode() : 0)) * 31;
boolean z14 = this.shouldShowVerificationGate;
if (z14) {
z14 = true;
}
int i50 = z14 ? 1 : 0;
int i51 = z14 ? 1 : 0;
int i52 = z14 ? 1 : 0;
int i53 = (hashCode6 + i50) * 31;
ApplicationStatus applicationStatus = this.joinRequestStatus;
int hashCode7 = (i53 + (applicationStatus != null ? applicationStatus.hashCode() : 0)) * 31;
StoreThreadDraft.ThreadDraftState threadDraftState = this.threadDraftState;
if (threadDraftState != null) {
i = threadDraftState.hashCode();
}
int i54 = (hashCode7 + i) * 31;
boolean z15 = this.showCreateThreadOption;
if (!z15) {
i2 = z15 ? 1 : 0;
}
return i54 + i2;
}
public final boolean isBlocked() {
return this.isBlocked;
}
public final boolean isCommunicationDisabled() {
return this.isCommunicationDisabled;
}
public final boolean isEditing() {
return this.isEditing;
}
public final boolean isInputShowing() {
return this.isInputShowing;
}
public final boolean isLurking() {
return this.isLurking;
}
public final boolean isOnCooldown() {
return this.isOnCooldown;
}
public final boolean isReplying() {
return this.isReplying;
}
public final boolean isSystemDM() {
return this.isSystemDM;
}
public final boolean isVerificationLevelTriggered() {
return this.isVerificationLevelTriggered;
}
public String toString() {
StringBuilder R = a.R("Loaded(channel=");
R.append(this.channel);
R.append(", channelId=");
R.append(this.channelId);
R.append(", me=");
R.append(this.f2810me);
R.append(", meGuildMember=");
R.append(this.meGuildMember);
R.append(", editingMessage=");
R.append(this.editingMessage);
R.append(", ableToSendMessage=");
R.append(this.ableToSendMessage);
R.append(", verificationLevelTriggered=");
R.append(this.verificationLevelTriggered);
R.append(", isLurking=");
R.append(this.isLurking);
R.append(", isSystemDM=");
R.append(this.isSystemDM);
R.append(", isOnCooldown=");
R.append(this.isOnCooldown);
R.append(", maxFileSizeMB=");
R.append(this.maxFileSizeMB);
R.append(", shouldShowFollow=");
R.append(this.shouldShowFollow);
R.append(", pendingReplyState=");
R.append(this.pendingReplyState);
R.append(", shouldBadgeChatInput=");
R.append(this.shouldBadgeChatInput);
R.append(", isBlocked=");
R.append(this.isBlocked);
R.append(", isInputShowing=");
R.append(this.isInputShowing);
R.append(", isVerificationLevelTriggered=");
R.append(this.isVerificationLevelTriggered);
R.append(", isEditing=");
R.append(this.isEditing);
R.append(", isReplying=");
R.append(this.isReplying);
R.append(", isCommunicationDisabled=");
R.append(this.isCommunicationDisabled);
R.append(", timeoutLeftMs=");
R.append(this.timeoutLeftMs);
R.append(", selectedThreadDraft=");
R.append(this.selectedThreadDraft);
R.append(", shouldShowVerificationGate=");
R.append(this.shouldShowVerificationGate);
R.append(", joinRequestStatus=");
R.append(this.joinRequestStatus);
R.append(", threadDraftState=");
R.append(this.threadDraftState);
R.append(", showCreateThreadOption=");
return a.L(R, this.showCreateThreadOption, ")");
}
}
/* compiled from: ChatInputViewModel.kt */
public static final class Loading extends ViewState {
public static final Loading INSTANCE = new Loading();
private Loading() {
super(null);
}
}
private ViewState() {
}
public /* synthetic */ ViewState(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
public final /* synthetic */ class WhenMappings {
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
static {
GuildVerificationLevel.values();
int[] iArr = new int[5];
$EnumSwitchMapping$0 = iArr;
iArr[GuildVerificationLevel.LOW.ordinal()] = 1;
iArr[GuildVerificationLevel.HIGHEST.ordinal()] = 2;
iArr[GuildVerificationLevel.NONE.ordinal()] = 3;
iArr[GuildVerificationLevel.MEDIUM.ordinal()] = 4;
iArr[GuildVerificationLevel.HIGH.ordinal()] = 5;
}
}
public ChatInputViewModel() {
this(null, null, null, null, null, null, null, null, null, null, null, null, null, false, null, 32767, null);
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public ChatInputViewModel(StoreChat storeChat, StoreChannels storeChannels, StoreMessagesLoader storeMessagesLoader, StoreLurking storeLurking, StoreStickers storeStickers, StorePendingReplies storePendingReplies, StoreApplicationInteractions storeApplicationInteractions, StoreApplicationCommands storeApplicationCommands, StoreApplicationCommandFrecency storeApplicationCommandFrecency, StoreUserSettings storeUserSettings, StoreAnalytics storeAnalytics, StoreThreadDraft storeThreadDraft, StoreGuilds storeGuilds, boolean z2, Observable<StoreState> observable) {
super(ViewState.Loading.INSTANCE);
m.checkNotNullParameter(storeChat, "storeChat");
m.checkNotNullParameter(storeChannels, "storeChannels");
m.checkNotNullParameter(storeMessagesLoader, "storeMessagesLoader");
m.checkNotNullParameter(storeLurking, "storeLurking");
m.checkNotNullParameter(storeStickers, "storeStickers");
m.checkNotNullParameter(storePendingReplies, "storePendingReplies");
m.checkNotNullParameter(storeApplicationInteractions, "storeApplicationInteractions");
m.checkNotNullParameter(storeApplicationCommands, "storeApplicationCommands");
m.checkNotNullParameter(storeApplicationCommandFrecency, "storeApplicationCommandsFrecency");
m.checkNotNullParameter(storeUserSettings, "storeUserSettings");
m.checkNotNullParameter(storeAnalytics, "storeAnalytics");
m.checkNotNullParameter(storeThreadDraft, "storeThreadDraft");
m.checkNotNullParameter(storeGuilds, "storeGuilds");
m.checkNotNullParameter(observable, "storeStateObservable");
this.storeChat = storeChat;
this.storeChannels = storeChannels;
this.storeMessagesLoader = storeMessagesLoader;
this.storeLurking = storeLurking;
this.storeStickers = storeStickers;
this.storePendingReplies = storePendingReplies;
this.storeApplicationInteractions = storeApplicationInteractions;
this.storeApplicationCommands = storeApplicationCommands;
this.storeApplicationCommandsFrecency = storeApplicationCommandFrecency;
this.storeUserSettings = storeUserSettings;
this.storeAnalytics = storeAnalytics;
this.storeThreadDraft = storeThreadDraft;
this.storeGuilds = storeGuilds;
this.isEmojiAutocompleteUpsellEnabled = z2;
PublishSubject<Event> k0 = PublishSubject.k0();
m.checkNotNullExpressionValue(k0, "PublishSubject.create()");
this.eventSubject = k0;
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.computationLatest(observable), this, null, 2, null), ChatInputViewModel.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new AnonymousClass1(this), 62, (Object) null);
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(storeChat.observeEvents(), this, null, 2, null), ChatInputViewModel.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new AnonymousClass2(this), 62, (Object) null);
}
/* JADX WARNING: Illegal instructions before constructor call */
public /* synthetic */ ChatInputViewModel(StoreChat storeChat, StoreChannels storeChannels, StoreMessagesLoader storeMessagesLoader, StoreLurking storeLurking, StoreStickers storeStickers, StorePendingReplies storePendingReplies, StoreApplicationInteractions storeApplicationInteractions, StoreApplicationCommands storeApplicationCommands, StoreApplicationCommandFrecency storeApplicationCommandFrecency, StoreUserSettings storeUserSettings, StoreAnalytics storeAnalytics, StoreThreadDraft storeThreadDraft, StoreGuilds storeGuilds, boolean z2, Observable observable, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r0);
Observable observable2;
StoreChat chat = (i & 1) != 0 ? StoreStream.Companion.getChat() : storeChat;
StoreChannels channels = (i & 2) != 0 ? StoreStream.Companion.getChannels() : storeChannels;
StoreMessagesLoader messagesLoader = (i & 4) != 0 ? StoreStream.Companion.getMessagesLoader() : storeMessagesLoader;
StoreLurking lurking = (i & 8) != 0 ? StoreStream.Companion.getLurking() : storeLurking;
StoreStickers stickers = (i & 16) != 0 ? StoreStream.Companion.getStickers() : storeStickers;
StorePendingReplies pendingReplies = (i & 32) != 0 ? StoreStream.Companion.getPendingReplies() : storePendingReplies;
StoreApplicationInteractions interactions = (i & 64) != 0 ? StoreStream.Companion.getInteractions() : storeApplicationInteractions;
StoreApplicationCommands applicationCommands = (i & 128) != 0 ? StoreStream.Companion.getApplicationCommands() : storeApplicationCommands;
StoreApplicationCommandFrecency applicationComandFrecency = (i & 256) != 0 ? StoreStream.Companion.getApplicationComandFrecency() : storeApplicationCommandFrecency;
StoreUserSettings userSettings = (i & 512) != 0 ? StoreStream.Companion.getUserSettings() : storeUserSettings;
StoreAnalytics analytics = (i & 1024) != 0 ? StoreStream.Companion.getAnalytics() : storeAnalytics;
StoreThreadDraft threadDraft = (i & 2048) != 0 ? StoreStream.Companion.getThreadDraft() : storeThreadDraft;
StoreGuilds guilds = (i & 4096) != 0 ? StoreStream.Companion.getGuilds() : storeGuilds;
boolean isEnabled = (i & 8192) != 0 ? EmojiAutocompletePremiumUpsellFeatureFlag.Companion.getINSTANCE().isEnabled() : z2;
if ((i & 16384) != 0) {
Companion companion = Companion;
StoreStream.Companion companion2 = StoreStream.Companion;
observable2 = Companion.access$observeStoreState(companion, companion2.getChannelsSelected(), companion2.getUsers(), chat, companion2.getUserRelationships(), companion2.getPermissions(), lurking, companion2.getSlowMode(), guilds, pendingReplies, companion2.getGuildJoinRequests(), threadDraft);
} else {
observable2 = observable;
}
}
public static final /* synthetic */ long access$calculateTimeoutLeftMs(ChatInputViewModel chatInputViewModel, GuildMember guildMember) {
return chatInputViewModel.calculateTimeoutLeftMs(guildMember);
}
public static final /* synthetic */ PublishSubject access$getEventSubject$p(ChatInputViewModel chatInputViewModel) {
return chatInputViewModel.eventSubject;
}
public static final /* synthetic */ StoreChannels access$getStoreChannels$p(ChatInputViewModel chatInputViewModel) {
return chatInputViewModel.storeChannels;
}
public static final /* synthetic */ StoreGuilds access$getStoreGuilds$p(ChatInputViewModel chatInputViewModel) {
return chatInputViewModel.storeGuilds;
}
public static final /* synthetic */ StoreThreadDraft access$getStoreThreadDraft$p(ChatInputViewModel chatInputViewModel) {
return chatInputViewModel.storeThreadDraft;
}
public static final /* synthetic */ boolean access$getUseTimeoutUpdateInterval$p(ChatInputViewModel chatInputViewModel) {
return chatInputViewModel.useTimeoutUpdateInterval;
}
public static final /* synthetic */ void access$handleStoreChatEvent(ChatInputViewModel chatInputViewModel, StoreChat.Event event) {
chatInputViewModel.handleStoreChatEvent(event);
}
public static final /* synthetic */ void access$handleStoreState(ChatInputViewModel chatInputViewModel, StoreState storeState) {
chatInputViewModel.handleStoreState(storeState);
}
public static final /* synthetic */ void access$setUseTimeoutUpdateInterval$p(ChatInputViewModel chatInputViewModel, boolean z2) {
chatInputViewModel.useTimeoutUpdateInterval = z2;
}
private final long calculateTimeoutLeftMs(GuildMember guildMember) {
UtcDateTime communicationDisabledUntil;
if (guildMember == null || (communicationDisabledUntil = guildMember.getCommunicationDisabledUntil()) == null) {
return 0;
}
return communicationDisabledUntil.g() - ClockFactory.get().currentTimeMillis();
}
/* JADX DEBUG: Multi-variable search result rejected for r6v0, resolved type: com.discord.widgets.chat.input.ChatInputViewModel */
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ void createAndGotoThread$default(ChatInputViewModel chatInputViewModel, Context context, Long l, String str, ViewState.Loaded loaded, Function1 function1, int i, Object obj) {
if ((i & 16) != 0) {
function1 = null;
}
chatInputViewModel.createAndGotoThread(context, l, str, loaded, function1);
}
private final void handleStoreChatEvent(StoreChat.Event event) {
if (event instanceof StoreChat.Event.AppendChatText) {
PublishSubject<Event> publishSubject = this.eventSubject;
publishSubject.k.onNext(new Event.AppendChatText(((StoreChat.Event.AppendChatText) event).getText()));
} else if (event instanceof StoreChat.Event.ReplaceChatText) {
PublishSubject<Event> publishSubject2 = this.eventSubject;
publishSubject2.k.onNext(new Event.SetChatText(((StoreChat.Event.ReplaceChatText) event).getText()));
}
}
@MainThread
private final void handleStoreState(StoreState storeState) {
String str;
CharSequence content;
if (storeState instanceof StoreState.Loaded) {
StoreState.Loaded loaded = (StoreState.Loaded) storeState;
boolean hasAccessWrite = loaded.getSelectedThreadDraft() == null ? PermissionUtils.INSTANCE.hasAccessWrite(loaded.getChannel(), loaded.getChannelPermissions()) : PermissionUtils.can(Permission.SEND_MESSAGES_IN_THREADS, loaded.getChannelPermissions());
boolean isType = ModelUserRelationship.isType(loaded.getRelationshipType(), 2);
ThreadUtils threadUtils = ThreadUtils.INSTANCE;
boolean z2 = true;
boolean z3 = !isType && hasAccessWrite && !loaded.isLurking() && (threadUtils.canUnarchiveThread(loaded.getChannel(), loaded.getChannelPermissions()) || !ChannelUtils.C(loaded.getChannel()));
boolean z4 = loaded.getChannel().A() == 5 && !z3;
PremiumUtils premiumUtils = PremiumUtils.INSTANCE;
int maxFileSizeMB = premiumUtils.getMaxFileSizeMB(loaded.getMe());
Guild guild = loaded.getGuild();
int max = Math.max(premiumUtils.getGuildMaxFileSizeMB(guild != null ? guild.getPremiumTier() : 0), maxFileSizeMB);
boolean z5 = loaded.getVerificationLevelTriggered() != GuildVerificationLevel.NONE;
StoreState.Loaded.PendingReply pendingReply = loaded.getPendingReply();
ViewState.Loaded.PendingReplyState replying = (pendingReply != null ? pendingReply.getRepliedAuthor() : null) != null ? new ViewState.Loaded.PendingReplyState.Replying(loaded.getPendingReply().getPendingReply().getMessageReference(), loaded.getPendingReply().getPendingReply().getShouldMention(), loaded.getPendingReply().getPendingReply().getShowMentionToggle(), loaded.getPendingReply().getRepliedAuthor(), loaded.getPendingReply().getRepliedAuthorGuildMember()) : ViewState.Loaded.PendingReplyState.Hide.INSTANCE;
boolean hasVerificationGate$default = MemberVerificationUtils.hasVerificationGate$default(MemberVerificationUtils.INSTANCE, loaded.getGuild(), null, 2, null);
boolean z6 = loaded.getMeGuildMember() != null && !loaded.getMeGuildMember().getPending();
GuildMember meGuildMember = loaded.getMeGuildMember();
boolean isCommunicationDisabled = meGuildMember != null ? meGuildMember.isCommunicationDisabled() : false;
boolean z7 = hasVerificationGate$default && !z6;
boolean z8 = !ChannelUtils.A(loaded.getChannel()) && !loaded.isLurking() && !z5 && !z4 && !z7 && !isCommunicationDisabled;
boolean z9 = z3 && loaded.getEditingMessage() != null && loaded.getEditingMessage().getMessage().getChannelId() == loaded.getChannel().h();
boolean z10 = replying instanceof ViewState.Loaded.PendingReplyState.Replying;
boolean canCreateThread = threadUtils.canCreateThread(loaded.getChannelPermissions(), loaded.getChannel(), null, loaded.getGuild());
long calculateTimeoutLeftMs = calculateTimeoutLeftMs(loaded.getMeGuildMember());
Channel channel = loaded.getChannel();
long h = loaded.getChannel().h();
MeUser me2 = loaded.getMe();
GuildMember meGuildMember2 = loaded.getMeGuildMember();
StoreChat.EditingMessage editingMessage = loaded.getEditingMessage();
GuildVerificationLevel verificationLevelTriggered = loaded.getVerificationLevelTriggered();
boolean isLurking = loaded.isLurking();
boolean A = ChannelUtils.A(loaded.getChannel());
boolean isOnCooldown = loaded.isOnCooldown();
StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft selectedThreadDraft = loaded.getSelectedThreadDraft();
GuildJoinRequest guildJoinRequest = loaded.getGuildJoinRequest();
ViewState.Loaded loaded2 = new ViewState.Loaded(channel, h, me2, meGuildMember2, editingMessage, z3, verificationLevelTriggered, isLurking, A, isOnCooldown, max, z4, replying, false, isType, z8, z5, z9, z10, isCommunicationDisabled, calculateTimeoutLeftMs, selectedThreadDraft, z7, guildJoinRequest != null ? guildJoinRequest.a() : null, loaded.getThreadDraftState(), canCreateThread);
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded3 = (ViewState.Loaded) viewState;
boolean z11 = !m.areEqual(loaded3 != null ? loaded3.getEditingMessage() : null, loaded2.getEditingMessage());
ViewState viewState2 = getViewState();
if (!(viewState2 instanceof ViewState.Loaded)) {
viewState2 = null;
}
ViewState.Loaded loaded4 = (ViewState.Loaded) viewState2;
if ((loaded4 != null ? loaded4.getSelectedThreadDraft() : null) == null || loaded2.getSelectedThreadDraft() != null) {
z2 = false;
}
this.useTimeoutUpdateInterval = isCommunicationDisabled;
updateViewState(loaded2);
if (z11) {
StoreChat.EditingMessage editingMessage2 = loaded2.getEditingMessage();
if (editingMessage2 == null || (content = editingMessage2.getContent()) == null || (str = content.toString()) == null) {
str = "";
}
this.eventSubject.k.onNext(new Event.SetChatText(str));
}
if (z2) {
this.eventSubject.k.onNext(Event.ThreadDraftClosed.INSTANCE);
}
}
}
public static /* synthetic */ void sendCommand$default(ChatInputViewModel chatInputViewModel, Context context, MessageManager messageManager, ApplicationCommandData applicationCommandData, List list, boolean z2, boolean z3, Function1 function1, int i, Object obj) {
chatInputViewModel.sendCommand(context, messageManager, applicationCommandData, list, (i & 16) != 0 ? false : z2, (i & 32) != 0 ? false : z3, (i & 64) != 0 ? ChatInputViewModel$sendCommand$1.INSTANCE : function1);
}
public static /* synthetic */ void sendMessage$default(ChatInputViewModel chatInputViewModel, Context context, MessageManager messageManager, MessageContent messageContent, List list, boolean z2, Function1 function1, int i, Object obj) {
chatInputViewModel.sendMessage(context, messageManager, messageContent, list, (i & 16) != 0 ? false : z2, function1);
}
public final void createAndGotoThread(Context context, Long l, String str, ViewState.Loaded loaded, Function1<? super Channel, Unit> function1) {
m.checkNotNullParameter(context, "context");
m.checkNotNullParameter(loaded, "loadedViewState");
ThreadUtils threadUtils = ThreadUtils.INSTANCE;
long channelId = loaded.getChannelId();
int i = ChannelUtils.i(loaded.getChannel()) ? 10 : loaded.getThreadDraftState().isPrivate() ? 12 : 11;
String threadName = loaded.getThreadDraftState().getThreadName();
if (threadName == null) {
threadName = "";
}
Integer autoArchiveDuration = loaded.getThreadDraftState().getAutoArchiveDuration();
if (autoArchiveDuration == null) {
autoArchiveDuration = loaded.getChannel().d();
}
Observable z2 = ObservableExtensionsKt.restSubscribeOn$default(threadUtils.createThread(channelId, l, i, threadName, Integer.valueOf(autoArchiveDuration != null ? autoArchiveDuration.intValue() : 1440), str), false, 1, null).z(new ChatInputViewModel$createAndGotoThread$1(this));
m.checkNotNullExpressionValue(z2, "ThreadUtils.createThread…utationLatest()\n }");
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(z2, this, null, 2, null), ChatInputViewModel.class, (Context) null, (Function1) null, new ChatInputViewModel$createAndGotoThread$3(loaded, context), (Function0) null, (Function0) null, new ChatInputViewModel$createAndGotoThread$2(loaded, function1), 54, (Object) null);
}
public final void deleteEditingMessage() {
this.storeChat.setEditingMessage(null);
}
public final void deletePendingReply() {
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null) {
this.storePendingReplies.onDeletePendingReply(loaded.getChannelId());
}
}
public final boolean handleEmojiAutocompleteUpsellClicked(Autocompletable autocompletable) {
m.checkNotNullParameter(autocompletable, "item");
if (!this.isEmojiAutocompleteUpsellEnabled || !(autocompletable instanceof EmojiUpsellPlaceholder)) {
return false;
}
PublishSubject<Event> publishSubject = this.eventSubject;
publishSubject.k.onNext(new Event.ShowPremiumUpsell(1, R.string.autocomplete_emoji_upsell_modal_header, R.string.autocomplete_emoji_upsell_modal_blurb_mobile, false, false, 24, null));
this.storeAnalytics.emojiAutocompleteUpsellModalViewed();
return true;
}
public final void jumpToMessageReference(MessageReference messageReference) {
m.checkNotNullParameter(messageReference, "messageReference");
StoreMessagesLoader storeMessagesLoader = this.storeMessagesLoader;
Long a = messageReference.a();
m.checkNotNull(a);
long longValue = a.longValue();
Long c = messageReference.c();
m.checkNotNull(c);
storeMessagesLoader.jumpToMessage(longValue, c.longValue());
}
public final void lurkGuild(Fragment fragment) {
m.checkNotNullParameter(fragment, "fragment");
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null) {
StoreLurking storeLurking = this.storeLurking;
long f = loaded.getChannel().f();
Context requireContext = fragment.requireContext();
m.checkNotNullExpressionValue(requireContext, "fragment.requireContext()");
storeLurking.postJoinGuildAsMember(f, requireContext);
}
}
public final Observable<ViewState> observeChatInputViewState() {
Observable<Long> D = Observable.D(0, 1, TimeUnit.SECONDS);
m.checkNotNullExpressionValue(D, "Observable.interval(0L, 1L, TimeUnit.SECONDS)");
Observable<ViewState> j = Observable.j(ObservableExtensionsKt.ui(D).F(new ChatInputViewModel$observeChatInputViewState$1(this)).q(), observeViewState(), new ChatInputViewModel$observeChatInputViewState$2(this));
m.checkNotNullExpressionValue(j, "Observable.combineLatest… } ?: viewState\n }");
return j;
}
public final Observable<Event> observeEvents() {
return this.eventSubject;
}
public final void onCommandInputsInvalid() {
PublishSubject<Event> publishSubject = this.eventSubject;
publishSubject.k.onNext(Event.CommandInputsInvalid.INSTANCE);
}
public final void onCommandUsed(ApplicationCommandData applicationCommandData) {
m.checkNotNullParameter(applicationCommandData, "applicationCommandData");
ViewState viewState = getViewState();
Long l = null;
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null) {
if (loaded.getChannel().f() != 0) {
l = Long.valueOf(loaded.getChannel().f());
}
this.storeApplicationCommandsFrecency.onCommandUsed(l, ApplicationCommandDataKt.getCommandId(applicationCommandData));
}
}
public final void sendCommand(Context context, MessageManager messageManager, ApplicationCommandData applicationCommandData, List<? extends Attachment<?>> list, boolean z2, boolean z3, Function1<? super Boolean, Unit> function1) {
m.checkNotNullParameter(context, "context");
m.checkNotNullParameter(messageManager, "messageManager");
m.checkNotNullParameter(applicationCommandData, "applicationCommandData");
m.checkNotNullParameter(list, "attachmentsRaw");
m.checkNotNullParameter(function1, "onValidationResult");
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null) {
AttachmentContext attachmentContext = toAttachmentContext(n.emptyList(), context);
ChatInputViewModel$sendCommand$commandResendCompressedHandler$1 chatInputViewModel$sendCommand$commandResendCompressedHandler$1 = (z3 || !attachmentContext.getHasImage()) ? null : new ChatInputViewModel$sendCommand$commandResendCompressedHandler$1(this, context, attachmentContext, messageManager, applicationCommandData, z2);
if (applicationCommandData.getValidInputs() || z2) {
Long valueOf = loaded.getChannel().f() != 0 ? Long.valueOf(loaded.getChannel().f()) : null;
if (z2) {
this.storeApplicationCommands.requestApplicationCommandAutocompleteData(valueOf, loaded.getChannelId(), applicationCommandData);
function1.invoke(Boolean.TRUE);
} else if (chatInputViewModel$sendCommand$commandResendCompressedHandler$1 == null || !this.storeUserSettings.getIsAutoImageCompressionEnabled()) {
onCommandUsed(applicationCommandData);
function1.invoke(Boolean.valueOf(messageManager.sendCommand(loaded.getChannelId(), valueOf, applicationCommandData.getApplicationCommand().getVersion(), applicationCommandData, new MessageManager.AttachmentsRequest(attachmentContext.getCurrentFileSizeMB(), loaded.getMaxFileSizeMB(), attachmentContext.getAttachments()), ChatInputViewModel$sendCommand$validated$1.INSTANCE, ChatInputViewModel$sendCommand$validated$2.INSTANCE, new ChatInputViewModel$sendCommand$validated$3(this, attachmentContext, chatInputViewModel$sendCommand$commandResendCompressedHandler$1))));
} else {
chatInputViewModel$sendCommand$commandResendCompressedHandler$1.mo1invoke();
}
} else {
onCommandInputsInvalid();
function1.invoke(Boolean.FALSE);
}
} else {
function1.invoke(Boolean.FALSE);
}
}
public final void sendMessage(Context context, MessageManager messageManager, MessageContent messageContent, List<? extends Attachment<?>> list, boolean z2, Function1<? super Boolean, Unit> function1) {
m.checkNotNullParameter(context, "context");
m.checkNotNullParameter(messageManager, "messageManager");
m.checkNotNullParameter(messageContent, "messageContent");
m.checkNotNullParameter(list, "attachmentsRaw");
m.checkNotNullParameter(function1, "onValidationResult");
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null) {
AttachmentContext attachmentContext = toAttachmentContext(list, context);
boolean z3 = true;
int i = 0;
boolean z4 = loaded.getSelectedThreadDraft() != null;
ChatInputViewModel$sendMessage$messageResendCompressedHandler$1 chatInputViewModel$sendMessage$messageResendCompressedHandler$1 = (z2 || !attachmentContext.getHasImage()) ? null : new ChatInputViewModel$sendMessage$messageResendCompressedHandler$1(this, context, attachmentContext, messageManager, messageContent, function1);
ChatInputViewModel$sendMessage$messageSendResultHandler$1 chatInputViewModel$sendMessage$messageSendResultHandler$1 = new ChatInputViewModel$sendMessage$messageSendResultHandler$1(this, context, loaded, attachmentContext, chatInputViewModel$sendMessage$messageResendCompressedHandler$1, z4);
ChatInputViewModel$sendMessage$onMessageTooLong$1 chatInputViewModel$sendMessage$onMessageTooLong$1 = new ChatInputViewModel$sendMessage$onMessageTooLong$1(this);
if (chatInputViewModel$sendMessage$messageResendCompressedHandler$1 == null || !this.storeUserSettings.getIsAutoImageCompressionEnabled()) {
ChatInputViewModel$sendMessage$sendMessage$1 chatInputViewModel$sendMessage$sendMessage$1 = new ChatInputViewModel$sendMessage$sendMessage$1(this, messageManager, messageContent, attachmentContext, loaded, chatInputViewModel$sendMessage$messageSendResultHandler$1, chatInputViewModel$sendMessage$onMessageTooLong$1, chatInputViewModel$sendMessage$messageResendCompressedHandler$1, function1);
if (loaded.isEditing() && loaded.getEditingMessage() != null) {
Message message = loaded.getEditingMessage().getMessage();
long id2 = message.getId();
long channelId = message.getChannelId();
String textContent = messageContent.getTextContent();
String content = message.getContent();
if (content != null) {
i = content.length();
}
function1.invoke(Boolean.valueOf(messageManager.editMessage(id2, channelId, textContent, chatInputViewModel$sendMessage$onMessageTooLong$1, Integer.valueOf(i))));
} else if (z4) {
String threadName = loaded.getThreadDraftState().getThreadName();
if (!(threadName == null || threadName.length() == 0)) {
z3 = false;
}
if (z3) {
StoreStream.Companion.getThreadDraft().setDraftState(StoreThreadDraft.ThreadDraftState.copy$default(loaded.getThreadDraftState(), false, null, null, false, true, 15, null));
return;
}
StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft selectedThreadDraft = loaded.getSelectedThreadDraft();
Long starterMessageId = selectedThreadDraft != null ? selectedThreadDraft.getStarterMessageId() : null;
StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft selectedThreadDraft2 = loaded.getSelectedThreadDraft();
createAndGotoThread(context, starterMessageId, selectedThreadDraft2 != null ? selectedThreadDraft2.getThreadStartLocation() : null, loaded, new ChatInputViewModel$sendMessage$1(chatInputViewModel$sendMessage$sendMessage$1));
} else {
chatInputViewModel$sendMessage$sendMessage$1.invoke((ChatInputViewModel$sendMessage$sendMessage$1) Long.valueOf(loaded.getChannelId()));
}
} else {
chatInputViewModel$sendMessage$messageResendCompressedHandler$1.mo1invoke();
}
} else {
function1.invoke(Boolean.FALSE);
}
}
public final void sendSticker(Sticker sticker, MessageManager messageManager) {
m.checkNotNullParameter(sticker, "sticker");
m.checkNotNullParameter(messageManager, "messageManager");
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null && loaded.getAbleToSendMessage()) {
this.storeStickers.onStickerUsed(sticker);
MessageManager.sendMessage$default(messageManager, null, null, null, null, d0.t.m.listOf(sticker), false, null, null, null, 495, null);
}
}
/* JADX WARNING: Removed duplicated region for block: B:12:0x0041 */
/* JADX WARNING: Removed duplicated region for block: B:21:0x0067 */
/* JADX WARNING: Removed duplicated region for block: B:30:0x009a A[LOOP:3: B:28:0x0094->B:30:0x009a, LOOP_END] */
/* JADX WARNING: Removed duplicated region for block: B:33:0x00c3 */
/* JADX WARNING: Removed duplicated region for block: B:34:0x00c9 */
public final AttachmentContext toAttachmentContext(List<? extends Attachment<?>> list, Context context) {
boolean z2;
boolean z3;
boolean z4;
m.checkNotNullParameter(list, "$this$toAttachmentContext");
m.checkNotNullParameter(context, "context");
ArrayList<Attachment> arrayList = new ArrayList(list);
if (!arrayList.isEmpty()) {
Iterator it = arrayList.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
Attachment attachment = (Attachment) it.next();
m.checkNotNullExpressionValue(attachment, "attachment");
if (AttachmentUtilsKt.isImage(attachment, context.getContentResolver())) {
z2 = true;
break;
}
}
if (!arrayList.isEmpty()) {
Iterator it2 = arrayList.iterator();
while (true) {
if (!it2.hasNext()) {
break;
}
Attachment attachment2 = (Attachment) it2.next();
m.checkNotNullExpressionValue(attachment2, "attachment");
if (AttachmentUtilsKt.isVideo(attachment2, context.getContentResolver())) {
z3 = true;
break;
}
}
if (!arrayList.isEmpty()) {
Iterator it3 = arrayList.iterator();
while (true) {
if (!it3.hasNext()) {
break;
}
Attachment attachment3 = (Attachment) it3.next();
m.checkNotNullExpressionValue(attachment3, "attachment");
if (AttachmentUtilsKt.isGif(attachment3, context.getContentResolver())) {
z4 = true;
break;
}
}
}
z4 = false;
ArrayList arrayList2 = new ArrayList(o.collectionSizeOrDefault(arrayList, 10));
for (Attachment attachment4 : arrayList) {
Uri uri = attachment4.getUri();
ContentResolver contentResolver = context.getContentResolver();
m.checkNotNullExpressionValue(contentResolver, "context.contentResolver");
arrayList2.add(Float.valueOf(SendUtilsKt.computeFileSizeMegabytes(uri, contentResolver)));
}
float sumOfFloat = u.sumOfFloat(arrayList2);
Float maxOrNull = u.m86maxOrNull((Iterable<Float>) arrayList2);
return new AttachmentContext(arrayList, z2, z3, z4, arrayList2, sumOfFloat, maxOrNull != null ? maxOrNull.floatValue() : 0.0f);
}
z3 = false;
if (!arrayList.isEmpty()) {
}
z4 = false;
ArrayList arrayList2 = new ArrayList(o.collectionSizeOrDefault(arrayList, 10));
while (r0.hasNext()) {
}
float sumOfFloat = u.sumOfFloat(arrayList2);
Float maxOrNull = u.m86maxOrNull((Iterable<Float>) arrayList2);
return new AttachmentContext(arrayList, z2, z3, z4, arrayList2, sumOfFloat, maxOrNull != null ? maxOrNull.floatValue() : 0.0f);
}
z2 = false;
if (!arrayList.isEmpty()) {
}
z3 = false;
if (!arrayList.isEmpty()) {
}
z4 = false;
ArrayList arrayList2 = new ArrayList(o.collectionSizeOrDefault(arrayList, 10));
while (r0.hasNext()) {
}
float sumOfFloat = u.sumOfFloat(arrayList2);
Float maxOrNull = u.m86maxOrNull((Iterable<Float>) arrayList2);
return new AttachmentContext(arrayList, z2, z3, z4, arrayList2, sumOfFloat, maxOrNull != null ? maxOrNull.floatValue() : 0.0f);
}
public final void togglePendingReplyShouldMention() {
ViewState viewState = getViewState();
ViewState.Loaded.PendingReplyState.Replying replying = null;
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null) {
ViewState.Loaded.PendingReplyState pendingReplyState = loaded.getPendingReplyState();
if (pendingReplyState instanceof ViewState.Loaded.PendingReplyState.Replying) {
replying = pendingReplyState;
}
ViewState.Loaded.PendingReplyState.Replying replying2 = replying;
if (replying2 != null) {
StorePendingReplies storePendingReplies = this.storePendingReplies;
Long a = replying2.getMessageReference().a();
m.checkNotNull(a);
storePendingReplies.onSetPendingReplyShouldMention(a.longValue(), !replying2.getShouldMention());
}
}
}
public final void verifyAccount(Context context) {
Unit unit;
m.checkNotNullParameter(context, "context");
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Loaded)) {
viewState = null;
}
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
if (loaded != null) {
int ordinal = loaded.getVerificationLevelTriggered().ordinal();
if (ordinal != 0) {
if (ordinal == 1) {
WidgetUserEmailVerify.Companion.launch(context, WidgetUserAccountVerifyBase.Mode.UNFORCED);
unit = Unit.a;
} else if (!(ordinal == 2 || ordinal == 3)) {
if (ordinal == 4) {
WidgetUserPhoneManage.Companion.launch(context, WidgetUserAccountVerifyBase.Mode.UNFORCED, WidgetUserPhoneManage.Companion.Source.GUILD_PHONE_REQUIRED);
unit = Unit.a;
} else {
throw new NoWhenBranchMatchedException();
}
}
KotlinExtensionsKt.getExhaustive(unit);
}
unit = Unit.a;
KotlinExtensionsKt.getExhaustive(unit);
}
}
}