282 lines
10 KiB
Java
282 lines
10 KiB
Java
package com.discord.widgets.chat.input.emoji;
|
|
|
|
import c.d.b.a.a;
|
|
import com.discord.models.domain.emoji.EmojiCategory;
|
|
import com.discord.models.guild.Guild;
|
|
import com.discord.utilities.recycler.DiffKeyProvider;
|
|
import d0.z.d.m;
|
|
import kotlin.Pair;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: EmojiCategoryItem.kt */
|
|
public abstract class EmojiCategoryItem implements DiffKeyProvider {
|
|
public static final Companion Companion = new Companion(null);
|
|
public static final int TYPE_GUILD = 1;
|
|
public static final int TYPE_STANDARD = 0;
|
|
private final Pair<Integer, Integer> categoryRange;
|
|
private final boolean isSelected;
|
|
private final String key;
|
|
private final long stableId;
|
|
|
|
/* compiled from: EmojiCategoryItem.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public final long mapEmojiCategoryToItemId(EmojiCategory emojiCategory) {
|
|
m.checkNotNullParameter(emojiCategory, "emojiCategory");
|
|
return (long) emojiCategory.name().hashCode();
|
|
}
|
|
|
|
public final long mapGuildToItemId(Guild guild) {
|
|
m.checkNotNullParameter(guild, "guild");
|
|
return guild.getId();
|
|
}
|
|
}
|
|
|
|
/* compiled from: EmojiCategoryItem.kt */
|
|
public static final class GuildItem extends EmojiCategoryItem {
|
|
private final Pair<Integer, Integer> categoryRange;
|
|
private final Guild guild;
|
|
private final boolean isSelected;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public GuildItem(Guild guild, Pair<Integer, Integer> pair, boolean z2) {
|
|
super(EmojiCategoryItem.Companion.mapGuildToItemId(guild), pair, z2, null);
|
|
m.checkNotNullParameter(guild, "guild");
|
|
m.checkNotNullParameter(pair, "categoryRange");
|
|
this.guild = guild;
|
|
this.categoryRange = pair;
|
|
this.isSelected = z2;
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.chat.input.emoji.EmojiCategoryItem$GuildItem */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ GuildItem copy$default(GuildItem guildItem, Guild guild, Pair pair, boolean z2, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
guild = guildItem.guild;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
pair = guildItem.getCategoryRange();
|
|
}
|
|
if ((i & 4) != 0) {
|
|
z2 = guildItem.isSelected();
|
|
}
|
|
return guildItem.copy(guild, pair, z2);
|
|
}
|
|
|
|
public final Guild component1() {
|
|
return this.guild;
|
|
}
|
|
|
|
public final Pair<Integer, Integer> component2() {
|
|
return getCategoryRange();
|
|
}
|
|
|
|
public final boolean component3() {
|
|
return isSelected();
|
|
}
|
|
|
|
public final GuildItem copy(Guild guild, Pair<Integer, Integer> pair, boolean z2) {
|
|
m.checkNotNullParameter(guild, "guild");
|
|
m.checkNotNullParameter(pair, "categoryRange");
|
|
return new GuildItem(guild, pair, z2);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof GuildItem)) {
|
|
return false;
|
|
}
|
|
GuildItem guildItem = (GuildItem) obj;
|
|
return m.areEqual(this.guild, guildItem.guild) && m.areEqual(getCategoryRange(), guildItem.getCategoryRange()) && isSelected() == guildItem.isSelected();
|
|
}
|
|
|
|
@Override // com.discord.widgets.chat.input.emoji.EmojiCategoryItem
|
|
public Pair<Integer, Integer> getCategoryRange() {
|
|
return this.categoryRange;
|
|
}
|
|
|
|
public final Guild getGuild() {
|
|
return this.guild;
|
|
}
|
|
|
|
public int hashCode() {
|
|
Guild guild = this.guild;
|
|
int i = 0;
|
|
int hashCode = (guild != null ? guild.hashCode() : 0) * 31;
|
|
Pair<Integer, Integer> categoryRange = getCategoryRange();
|
|
if (categoryRange != null) {
|
|
i = categoryRange.hashCode();
|
|
}
|
|
int i2 = (hashCode + i) * 31;
|
|
boolean isSelected = isSelected();
|
|
if (isSelected) {
|
|
isSelected = true;
|
|
}
|
|
int i3 = isSelected ? 1 : 0;
|
|
int i4 = isSelected ? 1 : 0;
|
|
int i5 = isSelected ? 1 : 0;
|
|
return i2 + i3;
|
|
}
|
|
|
|
@Override // com.discord.widgets.chat.input.emoji.EmojiCategoryItem
|
|
public boolean isSelected() {
|
|
return this.isSelected;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder K = a.K("GuildItem(guild=");
|
|
K.append(this.guild);
|
|
K.append(", categoryRange=");
|
|
K.append(getCategoryRange());
|
|
K.append(", isSelected=");
|
|
K.append(isSelected());
|
|
K.append(")");
|
|
return K.toString();
|
|
}
|
|
}
|
|
|
|
/* compiled from: EmojiCategoryItem.kt */
|
|
public static final class StandardItem extends EmojiCategoryItem {
|
|
private final Pair<Integer, Integer> categoryRange;
|
|
private final EmojiCategory emojiCategory;
|
|
private final boolean isSelected;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public StandardItem(EmojiCategory emojiCategory, Pair<Integer, Integer> pair, boolean z2) {
|
|
super(EmojiCategoryItem.Companion.mapEmojiCategoryToItemId(emojiCategory), pair, z2, null);
|
|
m.checkNotNullParameter(emojiCategory, "emojiCategory");
|
|
m.checkNotNullParameter(pair, "categoryRange");
|
|
this.emojiCategory = emojiCategory;
|
|
this.categoryRange = pair;
|
|
this.isSelected = z2;
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.chat.input.emoji.EmojiCategoryItem$StandardItem */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ StandardItem copy$default(StandardItem standardItem, EmojiCategory emojiCategory, Pair pair, boolean z2, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
emojiCategory = standardItem.emojiCategory;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
pair = standardItem.getCategoryRange();
|
|
}
|
|
if ((i & 4) != 0) {
|
|
z2 = standardItem.isSelected();
|
|
}
|
|
return standardItem.copy(emojiCategory, pair, z2);
|
|
}
|
|
|
|
public final EmojiCategory component1() {
|
|
return this.emojiCategory;
|
|
}
|
|
|
|
public final Pair<Integer, Integer> component2() {
|
|
return getCategoryRange();
|
|
}
|
|
|
|
public final boolean component3() {
|
|
return isSelected();
|
|
}
|
|
|
|
public final StandardItem copy(EmojiCategory emojiCategory, Pair<Integer, Integer> pair, boolean z2) {
|
|
m.checkNotNullParameter(emojiCategory, "emojiCategory");
|
|
m.checkNotNullParameter(pair, "categoryRange");
|
|
return new StandardItem(emojiCategory, pair, z2);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof StandardItem)) {
|
|
return false;
|
|
}
|
|
StandardItem standardItem = (StandardItem) obj;
|
|
return m.areEqual(this.emojiCategory, standardItem.emojiCategory) && m.areEqual(getCategoryRange(), standardItem.getCategoryRange()) && isSelected() == standardItem.isSelected();
|
|
}
|
|
|
|
@Override // com.discord.widgets.chat.input.emoji.EmojiCategoryItem
|
|
public Pair<Integer, Integer> getCategoryRange() {
|
|
return this.categoryRange;
|
|
}
|
|
|
|
public final EmojiCategory getEmojiCategory() {
|
|
return this.emojiCategory;
|
|
}
|
|
|
|
public int hashCode() {
|
|
EmojiCategory emojiCategory = this.emojiCategory;
|
|
int i = 0;
|
|
int hashCode = (emojiCategory != null ? emojiCategory.hashCode() : 0) * 31;
|
|
Pair<Integer, Integer> categoryRange = getCategoryRange();
|
|
if (categoryRange != null) {
|
|
i = categoryRange.hashCode();
|
|
}
|
|
int i2 = (hashCode + i) * 31;
|
|
boolean isSelected = isSelected();
|
|
if (isSelected) {
|
|
isSelected = true;
|
|
}
|
|
int i3 = isSelected ? 1 : 0;
|
|
int i4 = isSelected ? 1 : 0;
|
|
int i5 = isSelected ? 1 : 0;
|
|
return i2 + i3;
|
|
}
|
|
|
|
@Override // com.discord.widgets.chat.input.emoji.EmojiCategoryItem
|
|
public boolean isSelected() {
|
|
return this.isSelected;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder K = a.K("StandardItem(emojiCategory=");
|
|
K.append(this.emojiCategory);
|
|
K.append(", categoryRange=");
|
|
K.append(getCategoryRange());
|
|
K.append(", isSelected=");
|
|
K.append(isSelected());
|
|
K.append(")");
|
|
return K.toString();
|
|
}
|
|
}
|
|
|
|
private EmojiCategoryItem(long j, Pair<Integer, Integer> pair, boolean z2) {
|
|
this.stableId = j;
|
|
this.categoryRange = pair;
|
|
this.isSelected = z2;
|
|
this.key = String.valueOf(j);
|
|
}
|
|
|
|
public /* synthetic */ EmojiCategoryItem(long j, Pair pair, boolean z2, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(j, pair, z2);
|
|
}
|
|
|
|
public final boolean containsOnlyUnicodeEmoji() {
|
|
return (this instanceof StandardItem) && ((StandardItem) this).getEmojiCategory().containsOnlyUnicode;
|
|
}
|
|
|
|
public Pair<Integer, Integer> getCategoryRange() {
|
|
return this.categoryRange;
|
|
}
|
|
|
|
@Override // com.discord.utilities.recycler.DiffKeyProvider
|
|
public String getKey() {
|
|
return this.key;
|
|
}
|
|
|
|
public final long getStableId() {
|
|
return this.stableId;
|
|
}
|
|
|
|
public boolean isSelected() {
|
|
return this.isSelected;
|
|
}
|
|
}
|