package kotlin.sequences; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.exifinterface.media.ExifInterface; import io.sentry.protocol.TransactionInfo; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import kotlin.Metadata; import kotlin.Pair; import kotlin.TuplesKt; import kotlin.collections.ArraysKt; import kotlin.jvm.functions.Function0; import kotlin.jvm.functions.Function1; import kotlin.jvm.functions.Function2; import kotlin.jvm.internal.Intrinsics; import kotlin.random.Random; /* JADX INFO: Access modifiers changed from: package-private */ /* compiled from: Sequences.kt */ @Metadata(d1 = {"\u0000L\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010(\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0006\n\u0002\u0010\u0011\n\u0002\b\u0005\n\u0002\u0010\u001c\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0000\u001a.\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u00022\u0014\b\u0004\u0010\u0003\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\u00050\u0004H\u0087\bø\u0001\u0000\u001a\u0012\u0010\u0006\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002\u001ab\u0010\u0007\u001a\b\u0012\u0004\u0012\u0002H\b0\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\t\"\u0004\b\u0002\u0010\b2\f\u0010\n\u001a\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0018\u0010\u000b\u001a\u0014\u0012\u0004\u0012\u00020\r\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\t0\f2\u0018\u0010\u0003\u001a\u0014\u0012\u0004\u0012\u0002H\t\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\b0\u00050\u000eH\u0000\u001a&\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\b\b\u0000\u0010\u0002*\u00020\u00102\u000e\u0010\u0011\u001a\n\u0012\u0006\u0012\u0004\u0018\u0001H\u00020\u0004\u001a<\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\b\b\u0000\u0010\u0002*\u00020\u00102\u000e\u0010\u0012\u001a\n\u0012\u0006\u0012\u0004\u0018\u0001H\u00020\u00042\u0014\u0010\u0011\u001a\u0010\u0012\u0004\u0012\u0002H\u0002\u0012\u0006\u0012\u0004\u0018\u0001H\u00020\u000e\u001a=\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\b\b\u0000\u0010\u0002*\u00020\u00102\b\u0010\u0013\u001a\u0004\u0018\u0001H\u00022\u0014\u0010\u0011\u001a\u0010\u0012\u0004\u0012\u0002H\u0002\u0012\u0006\u0012\u0004\u0018\u0001H\u00020\u000eH\u0007¢\u0006\u0002\u0010\u0014\u001a+\u0010\u0015\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u00022\u0012\u0010\u0016\u001a\n\u0012\u0006\b\u0001\u0012\u0002H\u00020\u0017\"\u0002H\u0002¢\u0006\u0002\u0010\u0018\u001a\u001c\u0010\u0019\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u0005\u001a\u001c\u0010\u001a\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u0001\u001aC\u0010\u001b\u001a\b\u0012\u0004\u0012\u0002H\b0\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\b*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0018\u0010\u0003\u001a\u0014\u0012\u0004\u0012\u0002H\u0002\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\b0\u00050\u000eH\u0002¢\u0006\u0002\b\u001c\u001a)\u0010\u001b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\u001d0\u0001H\u0007¢\u0006\u0002\b\u001e\u001a\"\u0010\u001b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\u00010\u0001\u001a2\u0010\u001f\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0012\u0010 \u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020\u00010\u0004H\u0007\u001a!\u0010!\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0004\u0012\u0002H\u0002\u0018\u00010\u0001H\u0087\b\u001a\u001e\u0010\"\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u0001H\u0007\u001a&\u0010\"\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0006\u0010#\u001a\u00020$H\u0007\u001a@\u0010%\u001a\u001a\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00020'\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\b0'0&\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\b*\u0014\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\b0&0\u0001\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006("}, d2 = {"Sequence", "Lkotlin/sequences/Sequence;", ExifInterface.GPS_DIRECTION_TRUE, "iterator", "Lkotlin/Function0;", "", "emptySequence", "flatMapIndexed", "R", "C", TransactionInfo.JsonKeys.SOURCE, "transform", "Lkotlin/Function2;", "", "Lkotlin/Function1;", "generateSequence", "", "nextFunction", "seedFunction", "seed", "(Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;", "sequenceOf", "elements", "", "([Ljava/lang/Object;)Lkotlin/sequences/Sequence;", "asSequence", "constrainOnce", "flatten", "flatten$SequencesKt__SequencesKt", "", "flattenSequenceOfIterable", "ifEmpty", "defaultValue", "orEmpty", "shuffled", "random", "Lkotlin/random/Random;", "unzip", "Lkotlin/Pair;", "", "kotlin-stdlib"}, k = 5, mv = {1, 9, 0}, xi = ConstraintLayout.LayoutParams.Table.LAYOUT_EDITOR_ABSOLUTEX, xs = "kotlin/sequences/SequencesKt") /* loaded from: classes3.dex */ public class SequencesKt__SequencesKt extends SequencesKt__SequencesJVMKt { private static final Sequence Sequence(final Function0> iterator) { Intrinsics.checkNotNullParameter(iterator, "iterator"); return new Sequence() { // from class: kotlin.sequences.SequencesKt__SequencesKt$Sequence$1 @Override // kotlin.sequences.Sequence public Iterator iterator() { return iterator.invoke(); } }; } public static final Sequence asSequence(final Iterator it) { Intrinsics.checkNotNullParameter(it, ""); return SequencesKt.constrainOnce(new Sequence() { // from class: kotlin.sequences.SequencesKt__SequencesKt$asSequence$$inlined$Sequence$1 @Override // kotlin.sequences.Sequence public Iterator iterator() { return it; } }); } public static final Sequence sequenceOf(T... elements) { Intrinsics.checkNotNullParameter(elements, "elements"); return elements.length == 0 ? SequencesKt.emptySequence() : ArraysKt.asSequence(elements); } public static final Sequence emptySequence() { return EmptySequence.INSTANCE; } /* JADX WARN: Multi-variable type inference failed */ private static final Sequence orEmpty(Sequence sequence) { return sequence == 0 ? SequencesKt.emptySequence() : sequence; } public static final Sequence ifEmpty(Sequence sequence, Function0> defaultValue) { Intrinsics.checkNotNullParameter(sequence, ""); Intrinsics.checkNotNullParameter(defaultValue, "defaultValue"); return SequencesKt.sequence(new SequencesKt__SequencesKt$ifEmpty$1(sequence, defaultValue, null)); } public static final Sequence flatten(Sequence> sequence) { Intrinsics.checkNotNullParameter(sequence, ""); return flatten$SequencesKt__SequencesKt(sequence, new Function1, Iterator>() { // from class: kotlin.sequences.SequencesKt__SequencesKt$flatten$1 @Override // kotlin.jvm.functions.Function1 public final Iterator invoke(Sequence it) { Intrinsics.checkNotNullParameter(it, "it"); return it.iterator(); } }); } public static final Sequence flattenSequenceOfIterable(Sequence> sequence) { Intrinsics.checkNotNullParameter(sequence, ""); return flatten$SequencesKt__SequencesKt(sequence, new Function1, Iterator>() { // from class: kotlin.sequences.SequencesKt__SequencesKt$flatten$2 @Override // kotlin.jvm.functions.Function1 public final Iterator invoke(Iterable it) { Intrinsics.checkNotNullParameter(it, "it"); return it.iterator(); } }); } private static final Sequence flatten$SequencesKt__SequencesKt(Sequence sequence, Function1> function1) { if (sequence instanceof TransformingSequence) { return ((TransformingSequence) sequence).flatten$kotlin_stdlib(function1); } return new FlatteningSequence(sequence, new Function1() { // from class: kotlin.sequences.SequencesKt__SequencesKt$flatten$3 @Override // kotlin.jvm.functions.Function1 public final T invoke(T t) { return t; } }, function1); } public static final Pair, List> unzip(Sequence> sequence) { Intrinsics.checkNotNullParameter(sequence, ""); ArrayList arrayList = new ArrayList(); ArrayList arrayList2 = new ArrayList(); for (Pair pair : sequence) { arrayList.add(pair.getFirst()); arrayList2.add(pair.getSecond()); } return TuplesKt.to(arrayList, arrayList2); } public static final Sequence shuffled(Sequence sequence) { Intrinsics.checkNotNullParameter(sequence, ""); return SequencesKt.shuffled(sequence, Random.INSTANCE); } public static final Sequence shuffled(Sequence sequence, Random random) { Intrinsics.checkNotNullParameter(sequence, ""); Intrinsics.checkNotNullParameter(random, "random"); return SequencesKt.sequence(new SequencesKt__SequencesKt$shuffled$1(sequence, random, null)); } public static final Sequence flatMapIndexed(Sequence source, Function2 transform, Function1> iterator) { Intrinsics.checkNotNullParameter(source, "source"); Intrinsics.checkNotNullParameter(transform, "transform"); Intrinsics.checkNotNullParameter(iterator, "iterator"); return SequencesKt.sequence(new SequencesKt__SequencesKt$flatMapIndexed$1(source, transform, iterator, null)); } /* JADX WARN: Multi-variable type inference failed */ public static final Sequence constrainOnce(Sequence sequence) { Intrinsics.checkNotNullParameter(sequence, ""); return sequence instanceof ConstrainedOnceSequence ? sequence : new ConstrainedOnceSequence(sequence); } public static final Sequence generateSequence(final Function0 nextFunction) { Intrinsics.checkNotNullParameter(nextFunction, "nextFunction"); return SequencesKt.constrainOnce(new GeneratorSequence(nextFunction, new Function1() { // from class: kotlin.sequences.SequencesKt__SequencesKt$generateSequence$1 /* JADX INFO: Access modifiers changed from: package-private */ /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ /* JADX WARN: Multi-variable type inference failed */ { super(1); } @Override // kotlin.jvm.functions.Function1 public final T invoke(T it) { Intrinsics.checkNotNullParameter(it, "it"); return nextFunction.invoke(); } })); } public static final Sequence generateSequence(final T t, Function1 nextFunction) { Intrinsics.checkNotNullParameter(nextFunction, "nextFunction"); if (t == null) { return EmptySequence.INSTANCE; } return new GeneratorSequence(new Function0() { // from class: kotlin.sequences.SequencesKt__SequencesKt$generateSequence$2 /* JADX INFO: Access modifiers changed from: package-private */ /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ { super(0); } @Override // kotlin.jvm.functions.Function0 public final T invoke() { return t; } }, nextFunction); } public static final Sequence generateSequence(Function0 seedFunction, Function1 nextFunction) { Intrinsics.checkNotNullParameter(seedFunction, "seedFunction"); Intrinsics.checkNotNullParameter(nextFunction, "nextFunction"); return new GeneratorSequence(seedFunction, nextFunction); } }