package com.discord.stores; import com.discord.api.botuikit.SelectItem; import com.discord.stores.StoreApplicationInteractions; import com.discord.stores.updates.ObservationDeck; import com.discord.stores.updates.ObservationDeckProvider; import d0.t.h0; import d0.z.d.m; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import kotlin.jvm.internal.DefaultConstructorMarker; import rx.Observable; /* compiled from: StoreLocalActionComponentState.kt */ public final class StoreLocalActionComponentState extends StoreV2 { private final Map componentInteractions; private final Dispatcher dispatcher; private final ObservationDeck observationDeck; private final Map>> selectComponentSelections; private Map>> selectComponentSelectionsSnapshot; public StoreLocalActionComponentState(Dispatcher dispatcher, ObservationDeck observationDeck) { m.checkNotNullParameter(dispatcher, "dispatcher"); m.checkNotNullParameter(observationDeck, "observationDeck"); this.dispatcher = dispatcher; this.observationDeck = observationDeck; this.componentInteractions = new LinkedHashMap(); this.selectComponentSelections = new LinkedHashMap(); this.selectComponentSelectionsSnapshot = h0.emptyMap(); } /* JADX INFO: this call moved to the top of the method (can break code semantics) */ public /* synthetic */ StoreLocalActionComponentState(Dispatcher dispatcher, ObservationDeck observationDeck, int i, DefaultConstructorMarker defaultConstructorMarker) { this(dispatcher, (i & 2) != 0 ? ObservationDeckProvider.get() : observationDeck); } @StoreThread public final void clearState(long j, Integer num) { Map> map; Map> mutableMap; if (this.selectComponentSelections.containsKey(Long.valueOf(j)) && (map = this.selectComponentSelections.get(Long.valueOf(j))) != null && (mutableMap = h0.toMutableMap(map)) != null) { if (num != null && mutableMap.containsKey(num)) { mutableMap.remove(num); this.selectComponentSelections.put(Long.valueOf(j), mutableMap); markChanged(); } else if (num == null) { this.selectComponentSelections.remove(Long.valueOf(j)); markChanged(); } } } public final Map getComponentInteractions() { return this.componentInteractions; } public final Dispatcher getDispatcher() { return this.dispatcher; } public final Map>> getSelectComponentSelections() { return this.selectComponentSelections; } /* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: java.util.Map>>, java.util.Map>> */ public final Map>> getSelectComponentSelectionsData() { return this.selectComponentSelectionsSnapshot; } /* JADX DEBUG: Type inference failed for r0v0. Raw type applied. Possible types: java.util.Map>>, java.util.Map>> */ public final Map>> getSelectComponentSelectionsSnapshot() { return this.selectComponentSelectionsSnapshot; } public final Observable>>> observeSelectComponentSelections() { Observable>>> r = ObservationDeck.connectRx$default(this.observationDeck, new ObservationDeck.UpdateSource[]{this}, false, null, null, new StoreLocalActionComponentState$observeSelectComponentSelections$1(this), 14, null).r(); m.checkNotNullExpressionValue(r, "observationDeck.connectR… }.distinctUntilChanged()"); return r; } public final void setSelectComponentSelection(long j, int i, List list) { m.checkNotNullParameter(list, "selectedItems"); this.dispatcher.schedule(new StoreLocalActionComponentState$setSelectComponentSelection$1(this, j, list, i)); } public final void setSelectComponentSelectionsSnapshot(Map>> map) { m.checkNotNullParameter(map, ""); this.selectComponentSelectionsSnapshot = map; } @Override // com.discord.stores.StoreV2 @StoreThread public void snapshotData() { super.snapshotData(); this.selectComponentSelectionsSnapshot = new HashMap(this.selectComponentSelections); } }