package w2;

/* loaded from: classes.dex */
public final class a implements i {

    /* renamed from: a, reason: collision with root package name */
    private final q2.d f40727a;

    /* renamed from: b, reason: collision with root package name */
    private final int f40728b;

    public a(q2.d dVar, int i10) {
        this.f40727a = dVar;
        this.f40728b = i10;
    }

    @Override // w2.i
    public void a(l lVar) {
        int k10;
        if (lVar.l()) {
            lVar.m(lVar.f(), lVar.e(), c());
        } else {
            lVar.m(lVar.k(), lVar.j(), c());
        }
        int g10 = lVar.g();
        int i10 = this.f40728b;
        k10 = jn.o.k(i10 > 0 ? (g10 + i10) - 1 : (g10 + i10) - c().length(), 0, lVar.h());
        lVar.o(k10);
    }

    public final int b() {
        return this.f40728b;
    }

    public final String c() {
        return this.f40727a.j();
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof a)) {
            return false;
        }
        a aVar = (a) obj;
        return kotlin.jvm.internal.t.b(c(), aVar.c()) && this.f40728b == aVar.f40728b;
    }

    public int hashCode() {
        return (c().hashCode() * 31) + this.f40728b;
    }

    public String toString() {
        return "CommitTextCommand(text='" + c() + "', newCursorPosition=" + this.f40728b + ')';
    }

    public a(String str, int i10) {
        this(new q2.d(str, null, null, 6, null), i10);
    }
}
