package androidx.compose.foundation.text; import androidx.compose.ui.geometry.Offset; import androidx.compose.ui.geometry.OffsetKt; import androidx.compose.ui.layout.LayoutCoordinates; import androidx.compose.ui.text.TextLayoutResult; import kotlin.Metadata; import kotlin.jvm.internal.Intrinsics; /* compiled from: TextLayoutResultProxy.kt */ @Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0007\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\r\b\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0018\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u00112\b\b\u0002\u0010\u0013\u001a\u00020\u0014J\u000e\u0010\u0015\u001a\u00020\u00112\u0006\u0010\u0016\u001a\u00020\u0017J%\u0010\u0018\u001a\u00020\u00112\u0006\u0010\u0019\u001a\u00020\u001a2\b\b\u0002\u0010\u001b\u001a\u00020\u0014ø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b\u001c\u0010\u001dJ\u001b\u0010\u001e\u001a\u00020\u00142\u0006\u0010\u001f\u001a\u00020\u001aø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b \u0010!J\u0019\u0010\"\u001a\u00020\u001a*\u00020\u001aH\u0002ø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b#\u0010$J\u0019\u0010%\u001a\u00020\u001a*\u00020\u001aH\u0002ø\u0001\u0000ø\u0001\u0001¢\u0006\u0004\b&\u0010$R\u001c\u0010\u0005\u001a\u0004\u0018\u00010\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\nR\u001c\u0010\u000b\u001a\u0004\u0018\u00010\u0006X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\f\u0010\b\"\u0004\b\r\u0010\nR\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u000e\u0010\u000f\u0082\u0002\u000b\n\u0005\b¡\u001e0\u0001\n\u0002\b\u0019¨\u0006'"}, d2 = {"Landroidx/compose/foundation/text/TextLayoutResultProxy;", "", "value", "Landroidx/compose/ui/text/TextLayoutResult;", "(Landroidx/compose/ui/text/TextLayoutResult;)V", "decorationBoxCoordinates", "Landroidx/compose/ui/layout/LayoutCoordinates;", "getDecorationBoxCoordinates", "()Landroidx/compose/ui/layout/LayoutCoordinates;", "setDecorationBoxCoordinates", "(Landroidx/compose/ui/layout/LayoutCoordinates;)V", "innerTextFieldCoordinates", "getInnerTextFieldCoordinates", "setInnerTextFieldCoordinates", "getValue", "()Landroidx/compose/ui/text/TextLayoutResult;", "getLineEnd", "", "lineIndex", "visibleEnd", "", "getLineForVerticalPosition", "vertical", "", "getOffsetForPosition", "position", "Landroidx/compose/ui/geometry/Offset;", "coerceInVisibleBounds", "getOffsetForPosition-3MmeM6k", "(JZ)I", "isPositionOnText", "offset", "isPositionOnText-k-4lQ0M", "(J)Z", "coercedInVisibleBoundsOfInputText", "coercedInVisibleBoundsOfInputText-MK-Hz9U", "(J)J", "relativeToInputText", "relativeToInputText-MK-Hz9U", "foundation_release"}, k = 1, mv = {1, 8, 0}, xi = 48) /* loaded from: classes.dex */ public final class TextLayoutResultProxy { private LayoutCoordinates decorationBoxCoordinates; private LayoutCoordinates innerTextFieldCoordinates; private final TextLayoutResult value; public final LayoutCoordinates getDecorationBoxCoordinates() { return this.decorationBoxCoordinates; } public final LayoutCoordinates getInnerTextFieldCoordinates() { return this.innerTextFieldCoordinates; } public final TextLayoutResult getValue() { return this.value; } public final void setDecorationBoxCoordinates(LayoutCoordinates layoutCoordinates) { this.decorationBoxCoordinates = layoutCoordinates; } public final void setInnerTextFieldCoordinates(LayoutCoordinates layoutCoordinates) { this.innerTextFieldCoordinates = layoutCoordinates; } public TextLayoutResultProxy(TextLayoutResult value) { Intrinsics.checkNotNullParameter(value, "value"); this.value = value; } /* renamed from: getOffsetForPosition-3MmeM6k$default, reason: not valid java name */ public static /* synthetic */ int m843getOffsetForPosition3MmeM6k$default(TextLayoutResultProxy textLayoutResultProxy, long j, boolean z, int i, Object obj) { if ((i & 2) != 0) { z = true; } return textLayoutResultProxy.m845getOffsetForPosition3MmeM6k(j, z); } /* renamed from: getOffsetForPosition-3MmeM6k, reason: not valid java name */ public final int m845getOffsetForPosition3MmeM6k(long position, boolean coerceInVisibleBounds) { if (coerceInVisibleBounds) { position = m842coercedInVisibleBoundsOfInputTextMKHz9U(position); } return this.value.m4386getOffsetForPositionk4lQ0M(m844relativeToInputTextMKHz9U(position)); } public final int getLineForVerticalPosition(float vertical) { return this.value.getLineForVerticalPosition(Offset.m2401getYimpl(m844relativeToInputTextMKHz9U(m842coercedInVisibleBoundsOfInputTextMKHz9U(OffsetKt.Offset(0.0f, vertical))))); } public static /* synthetic */ int getLineEnd$default(TextLayoutResultProxy textLayoutResultProxy, int i, boolean z, int i2, Object obj) { if ((i2 & 2) != 0) { z = false; } return textLayoutResultProxy.getLineEnd(i, z); } public final int getLineEnd(int lineIndex, boolean visibleEnd) { return this.value.getLineEnd(lineIndex, visibleEnd); } /* renamed from: isPositionOnText-k-4lQ0M, reason: not valid java name */ public final boolean m846isPositionOnTextk4lQ0M(long offset) { long m844relativeToInputTextMKHz9U = m844relativeToInputTextMKHz9U(m842coercedInVisibleBoundsOfInputTextMKHz9U(offset)); int lineForVerticalPosition = this.value.getLineForVerticalPosition(Offset.m2401getYimpl(m844relativeToInputTextMKHz9U)); return Offset.m2400getXimpl(m844relativeToInputTextMKHz9U) >= this.value.getLineLeft(lineForVerticalPosition) && Offset.m2400getXimpl(m844relativeToInputTextMKHz9U) <= this.value.getLineRight(lineForVerticalPosition); } /* renamed from: relativeToInputText-MK-Hz9U, reason: not valid java name */ private final long m844relativeToInputTextMKHz9U(long j) { Offset offset; LayoutCoordinates layoutCoordinates = this.innerTextFieldCoordinates; if (layoutCoordinates == null) { return j; } LayoutCoordinates layoutCoordinates2 = this.decorationBoxCoordinates; if (layoutCoordinates2 != null) { offset = Offset.m2389boximpl((layoutCoordinates.isAttached() && layoutCoordinates2.isAttached()) ? layoutCoordinates.mo3884localPositionOfR5De75A(layoutCoordinates2, j) : j); } else { offset = null; } return offset != null ? offset.getPackedValue() : j; } /* JADX WARN: Code restructure failed: missing block: B:8:0x001c, code lost: if (r1 == null) goto L11; */ /* renamed from: coercedInVisibleBoundsOfInputText-MK-Hz9U, reason: not valid java name */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private final long m842coercedInVisibleBoundsOfInputTextMKHz9U(long r5) { /* r4 = this; androidx.compose.ui.layout.LayoutCoordinates r0 = r4.innerTextFieldCoordinates if (r0 == 0) goto L1e boolean r1 = r0.isAttached() if (r1 == 0) goto L16 androidx.compose.ui.layout.LayoutCoordinates r4 = r4.decorationBoxCoordinates r1 = 0 if (r4 == 0) goto L1c r2 = 0 r3 = 2 androidx.compose.ui.geometry.Rect r1 = androidx.compose.ui.layout.LayoutCoordinates.localBoundingBoxOf$default(r4, r0, r2, r3, r1) goto L1c L16: androidx.compose.ui.geometry.Rect$Companion r4 = androidx.compose.ui.geometry.Rect.INSTANCE androidx.compose.ui.geometry.Rect r1 = r4.getZero() L1c: if (r1 != 0) goto L24 L1e: androidx.compose.ui.geometry.Rect$Companion r4 = androidx.compose.ui.geometry.Rect.INSTANCE androidx.compose.ui.geometry.Rect r1 = r4.getZero() L24: long r4 = androidx.compose.foundation.text.TextLayoutResultProxyKt.m847access$coerceIn3MmeM6k(r5, r1) return r4 */ throw new UnsupportedOperationException("Method not decompiled: androidx.compose.foundation.text.TextLayoutResultProxy.m842coercedInVisibleBoundsOfInputTextMKHz9U(long):long"); } }