package androidx.compose.ui; import androidx.exifinterface.media.ExifInterface; import androidx.media3.exoplayer.upstream.CmcdHeadersFactory; import defpackage.DeviceControl$Companion$$ExternalSyntheticLambda4; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import kotlin.Metadata; import kotlin.Pair; import kotlin.collections.CollectionsKt; import kotlin.jvm.functions.Function1; import kotlin.jvm.functions.Function2; import kotlin.jvm.internal.Intrinsics; /* compiled from: TempListUtils.kt */ @Metadata(d1 = {"\u0000P\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\r\n\u0002\b\u0002\n\u0002\u0010$\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\t\u001a9\u0010\u0000\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\u00060\u0003j\u0002`\u00042\u0006\u0010\u0005\u001a\u0002H\u00022\u0014\u0010\u0006\u001a\u0010\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\b\u0018\u00010\u0007H\u0002¢\u0006\u0002\u0010\t\u001a_\u0010\n\u001a\u000e\u0012\u0004\u0012\u0002H\f\u0012\u0004\u0012\u0002H\r0\u000b\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\f\"\u0004\b\u0002\u0010\r*\b\u0012\u0004\u0012\u0002H\u00020\u000e2\u001e\u0010\u0006\u001a\u001a\u0012\u0004\u0012\u0002H\u0002\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u0002H\f\u0012\u0004\u0012\u0002H\r0\u000f0\u0007H\u0080\bø\u0001\u0000\u0082\u0002\b\n\u0006\b\u0001\u0012\u0002\u0010\u0001\u001a}\u0010\u0010\u001a\u0002H\u0011\"\u0004\b\u0000\u0010\u0002\"\f\b\u0001\u0010\u0011*\u00060\u0003j\u0002`\u0004*\b\u0012\u0004\u0012\u0002H\u00020\u000e2\u0006\u0010\u0012\u001a\u0002H\u00112\b\b\u0002\u0010\u0013\u001a\u00020\b2\b\b\u0002\u0010\u0014\u001a\u00020\b2\b\b\u0002\u0010\u0015\u001a\u00020\b2\b\b\u0002\u0010\u0016\u001a\u00020\u00172\b\b\u0002\u0010\u0018\u001a\u00020\b2\u0016\b\u0002\u0010\u0006\u001a\u0010\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\b\u0018\u00010\u0007H\u0002¢\u0006\u0002\u0010\u0019\u001ab\u0010\u001a\u001a\u00020\u001b\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u000e2\b\b\u0002\u0010\u0013\u001a\u00020\b2\b\b\u0002\u0010\u0014\u001a\u00020\b2\b\b\u0002\u0010\u0015\u001a\u00020\b2\b\b\u0002\u0010\u0016\u001a\u00020\u00172\b\b\u0002\u0010\u0018\u001a\u00020\b2\u0016\b\u0002\u0010\u0006\u001a\u0010\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\b\u0018\u00010\u0007H\u0000\u001aI\u0010\u001c\u001a\b\u0012\u0004\u0012\u0002H\u001d0\u000e\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u001d*\b\u0012\u0004\u0012\u0002H\u00020\u000e2\u0014\u0010\u0006\u001a\u0010\u0012\u0004\u0012\u0002H\u0002\u0012\u0006\u0012\u0004\u0018\u0001H\u001d0\u0007H\u0080\bø\u0001\u0000\u0082\u0002\b\n\u0006\b\u0001\u0012\u0002\u0010\u0001\u001a_\u0010\u001e\u001a\u0002H\u001f\"\u0004\b\u0000\u0010\u001f\"\b\b\u0001\u0010\u0002*\u0002H\u001f*\b\u0012\u0004\u0012\u0002H\u00020\u000e2'\u0010 \u001a#\u0012\u0013\u0012\u0011H\u001f¢\u0006\f\b\"\u0012\b\b#\u0012\u0004\b\b($\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u001f0!H\u0080\bø\u0001\u0000\u0082\u0002\b\n\u0006\b\u0001\u0012\u0002\u0010\u0001¢\u0006\u0002\u0010%\u001a\u007f\u0010&\u001a\b\u0012\u0004\u0012\u0002H\r0\u000e\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u001d\"\u0004\b\u0002\u0010\r*\b\u0012\u0004\u0012\u0002H\u00020\u000e2\f\u0010'\u001a\b\u0012\u0004\u0012\u0002H\u001d0\u000e26\u0010\u0006\u001a2\u0012\u0013\u0012\u0011H\u0002¢\u0006\f\b\"\u0012\b\b#\u0012\u0004\b\b((\u0012\u0013\u0012\u0011H\u001d¢\u0006\f\b\"\u0012\b\b#\u0012\u0004\b\b()\u0012\u0004\u0012\u0002H\r0!H\u0080\bø\u0001\u0000\u0082\u0002\b\n\u0006\b\u0001\u0012\u0002\u0010\u0002\u001aM\u0010*\u001a\b\u0012\u0004\u0012\u0002H\u001d0\u000e\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u001d*\b\u0012\u0004\u0012\u0002H\u00020\u000e2\u0018\u0010\u0006\u001a\u0014\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u001d0!H\u0080\bø\u0001\u0000\u0082\u0002\b\n\u0006\b\u0001\u0012\u0002\u0010\u0001\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006+"}, d2 = {"appendElement", "", ExifInterface.GPS_DIRECTION_TRUE, "Ljava/lang/Appendable;", "Lkotlin/text/Appendable;", "element", "transform", "Lkotlin/Function1;", "", "(Ljava/lang/Appendable;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)V", "fastAssociate", "", "K", ExifInterface.GPS_MEASUREMENT_INTERRUPTED, "", "Lkotlin/Pair;", "fastJoinTo", ExifInterface.GPS_MEASUREMENT_IN_PROGRESS, "buffer", "separator", "prefix", "postfix", "limit", "", "truncated", "(Ljava/util/List;Ljava/lang/Appendable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/Appendable;", "fastJoinToString", "", "fastMapNotNull", "R", "fastReduce", ExifInterface.LATITUDE_SOUTH, "operation", "Lkotlin/Function2;", "Lkotlin/ParameterName;", "name", "acc", "(Ljava/util/List;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;", "fastZip", "other", CmcdHeadersFactory.OBJECT_TYPE_AUDIO_ONLY, "b", "fastZipWithNext", "ui_release"}, k = 2, mv = {1, 8, 0}, xi = 48) /* loaded from: classes.dex */ public final class TempListUtilsKt { public static final List fastZipWithNext(List list, Function2 transform) { Intrinsics.checkNotNullParameter(list, ""); Intrinsics.checkNotNullParameter(transform, "transform"); if (list.size() == 0 || list.size() == 1) { return CollectionsKt.emptyList(); } ArrayList arrayList = new ArrayList(); int i = 0; DeviceControl$Companion$$ExternalSyntheticLambda4 deviceControl$Companion$$ExternalSyntheticLambda4 = list.get(0); int lastIndex = CollectionsKt.getLastIndex(list); while (i < lastIndex) { i++; T t = list.get(i); arrayList.add(transform.invoke(deviceControl$Companion$$ExternalSyntheticLambda4, t)); deviceControl$Companion$$ExternalSyntheticLambda4 = t; } return arrayList; } public static final S fastReduce(List list, Function2 operation) { Intrinsics.checkNotNullParameter(list, ""); Intrinsics.checkNotNullParameter(operation, "operation"); if (list.isEmpty()) { throw new UnsupportedOperationException("Empty collection can't be reduced."); } S s = (Object) CollectionsKt.first((List) list); int lastIndex = CollectionsKt.getLastIndex(list); int i = 1; if (1 <= lastIndex) { while (true) { s = operation.invoke(s, list.get(i)); if (i == lastIndex) { break; } i++; } } return s; } public static final Map fastAssociate(List list, Function1> transform) { Intrinsics.checkNotNullParameter(list, ""); Intrinsics.checkNotNullParameter(transform, "transform"); LinkedHashMap linkedHashMap = new LinkedHashMap(list.size()); int size = list.size(); for (int i = 0; i < size; i++) { Pair invoke = transform.invoke(list.get(i)); linkedHashMap.put(invoke.getFirst(), invoke.getSecond()); } return linkedHashMap; } public static final List fastZip(List list, List other, Function2 transform) { Intrinsics.checkNotNullParameter(list, ""); Intrinsics.checkNotNullParameter(other, "other"); Intrinsics.checkNotNullParameter(transform, "transform"); int min = Math.min(list.size(), other.size()); ArrayList arrayList = new ArrayList(min); for (int i = 0; i < min; i++) { arrayList.add(transform.invoke(list.get(i), other.get(i))); } return arrayList; } public static final List fastMapNotNull(List list, Function1 transform) { Intrinsics.checkNotNullParameter(list, ""); Intrinsics.checkNotNullParameter(transform, "transform"); ArrayList arrayList = new ArrayList(list.size()); int size = list.size(); for (int i = 0; i < size; i++) { R invoke = transform.invoke(list.get(i)); if (invoke != null) { arrayList.add(invoke); } } return arrayList; } public static /* synthetic */ String fastJoinToString$default(List list, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i, CharSequence charSequence4, Function1 function1, int i2, Object obj) { if ((i2 & 1) != 0) { } if ((i2 & 2) != 0) { } CharSequence charSequence5 = charSequence2; if ((i2 & 4) != 0) { } CharSequence charSequence6 = charSequence3; if ((i2 & 8) != 0) { i = -1; } int i3 = i; if ((i2 & 16) != 0) { } CharSequence charSequence7 = charSequence4; if ((i2 & 32) != 0) { function1 = null; } return fastJoinToString(list, charSequence, charSequence5, charSequence6, i3, charSequence7, function1); } public static final String fastJoinToString(List list, CharSequence separator, CharSequence prefix, CharSequence postfix, int i, CharSequence truncated, Function1 function1) { Intrinsics.checkNotNullParameter(list, ""); Intrinsics.checkNotNullParameter(separator, "separator"); Intrinsics.checkNotNullParameter(prefix, "prefix"); Intrinsics.checkNotNullParameter(postfix, "postfix"); Intrinsics.checkNotNullParameter(truncated, "truncated"); String sb = ((StringBuilder) fastJoinTo(list, new StringBuilder(), separator, prefix, postfix, i, truncated, function1)).toString(); Intrinsics.checkNotNullExpressionValue(sb, "fastJoinTo(StringBuilder…form)\n .toString()"); return sb; } /* JADX INFO: Access modifiers changed from: private */ public static final A fastJoinTo(List list, A a, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i, CharSequence charSequence4, Function1 function1) { a.append(charSequence2); int size = list.size(); int i2 = 0; for (int i3 = 0; i3 < size; i3++) { T t = list.get(i3); i2++; if (i2 > 1) { a.append(charSequence); } if (i >= 0 && i2 > i) { break; } appendElement(a, t, function1); } if (i >= 0 && i2 > i) { a.append(charSequence4); } a.append(charSequence3); return a; } /* JADX WARN: Multi-variable type inference failed */ private static final void appendElement(Appendable appendable, T t, Function1 function1) { if (function1 != null) { appendable.append(function1.invoke(t)); return; } if (t == 0 || (t instanceof CharSequence)) { appendable.append((CharSequence) t); } else if (t instanceof Character) { appendable.append(((Character) t).charValue()); } else { appendable.append(String.valueOf(t)); } } }