package com.discord.widgets.chat.input; import com.discord.models.commands.Application; import com.discord.widgets.chat.input.autocomplete.ApplicationCommandLoadingPlaceholder; import com.discord.widgets.chat.input.autocomplete.Autocompletable; import d0.d0.f; import d0.z.d.o; import java.util.Iterator; import java.util.List; import kotlin.Pair; import kotlin.Unit; import kotlin.jvm.functions.Function1; /* compiled from: WidgetChatInputAutocomplete.kt */ public final class WidgetChatInputAutocomplete$configureDataSubscriptions$6 extends o implements Function1 { public final /* synthetic */ WidgetChatInputAutocomplete this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public WidgetChatInputAutocomplete$configureDataSubscriptions$6(WidgetChatInputAutocomplete widgetChatInputAutocomplete) { super(1); this.this$0 = widgetChatInputAutocomplete; } /* 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(WidgetChatInputDiscoveryCommandsModel widgetChatInputDiscoveryCommandsModel) { invoke(widgetChatInputDiscoveryCommandsModel); return Unit.a; } public final void invoke(WidgetChatInputDiscoveryCommandsModel widgetChatInputDiscoveryCommandsModel) { WidgetChatInputAutocomplete.access$setDiscoveryCommands$p(this.this$0, widgetChatInputDiscoveryCommandsModel); WidgetChatInputAutocomplete.access$getApplicationsPosition$p(this.this$0).clear(); int i = 0; for (Pair> pair : widgetChatInputDiscoveryCommandsModel.getCommandsByApplication()) { Application component1 = pair.component1(); List component2 = pair.component2(); Iterator it = component2.iterator(); int i2 = 0; while (true) { if (!it.hasNext()) { i2 = -1; break; } else if (!(it.next() instanceof ApplicationCommandLoadingPlaceholder)) { break; } else { i2++; } } WidgetChatInputAutocomplete.access$getApplicationsPosition$p(this.this$0).put(Long.valueOf(component1.getId()), Integer.valueOf(f.coerceAtLeast(i2, 0) + i)); i += component2.size(); } WidgetChatInputAutocomplete.access$onModelUpdated(this.this$0); } }