package Z0;

import T0.C0596g;

/* JADX INFO: loaded from: classes.dex */
public final class w implements InterfaceC0866g {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final C0596g f9131a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int f9132b;

    public w(String str, int i6) {
        this.f9131a = new C0596g(str);
        this.f9132b = i6;
    }

    @Override // Z0.InterfaceC0866g
    public final void a(C0867h c0867h) {
        int i6 = c0867h.f9107d;
        boolean z6 = i6 != -1;
        C0596g c0596g = this.f9131a;
        if (z6) {
            c0867h.d(i6, c0867h.f9108e, c0596g.f6510b);
            String str = c0596g.f6510b;
            if (str.length() > 0) {
                c0867h.e(i6, str.length() + i6);
            }
        } else {
            int i7 = c0867h.f9105b;
            c0867h.d(i7, c0867h.f9106c, c0596g.f6510b);
            String str2 = c0596g.f6510b;
            if (str2.length() > 0) {
                c0867h.e(i7, str2.length() + i7);
            }
        }
        int i8 = c0867h.f9105b;
        int i9 = c0867h.f9106c;
        int i10 = i8 == i9 ? i9 : -1;
        int i11 = this.f9132b;
        int iV = L4.a.v(i11 > 0 ? (i10 + i11) - 1 : (i10 + i11) - c0596g.f6510b.length(), 0, c0867h.f9104a.p());
        c0867h.f(iV, iV);
    }

    public final boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof w)) {
            return false;
        }
        w wVar = (w) obj;
        return kotlin.jvm.internal.o.c(this.f9131a.f6510b, wVar.f9131a.f6510b) && this.f9132b == wVar.f9132b;
    }

    public final int hashCode() {
        return (this.f9131a.f6510b.hashCode() * 31) + this.f9132b;
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder("SetComposingTextCommand(text='");
        sb.append(this.f9131a.f6510b);
        sb.append("', newCursorPosition=");
        return com.google.android.recaptcha.internal.a.m(sb, this.f9132b, ')');
    }
}
