package okio;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes3.dex */
@kotlin.Metadata(d1 = {"\u0000P\n\u0002\u0018\u0002\n\u0002\u0010\u000f\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0002\b\u000b\n\u0002\u0010 \n\u0002\b\u0005\n\u0002\u0010\f\n\u0002\b\u000b\u0018\u0000 %2\b\u0012\u0004\u0012\u00020\u00000\u0001:\u00019B\u0011\b\u0000\u0012\u0006\u0010\u0003\u001a\u00020\u0002¢\u0006\u0004\b\u0004\u0010\u0005J\u0018\u0010\b\u001a\u00020\u00002\u0006\u0010\u0007\u001a\u00020\u0006H\u0087\u0002¢\u0006\u0004\b\b\u0010\tJ\u0018\u0010\n\u001a\u00020\u00002\u0006\u0010\u0007\u001a\u00020\u0000H\u0087\u0002¢\u0006\u0004\b\n\u0010\u000bJ\u001f\u0010\u000e\u001a\u00020\u00002\u0006\u0010\u0007\u001a\u00020\u00002\b\b\u0002\u0010\r\u001a\u00020\f¢\u0006\u0004\b\u000e\u0010\u000fJ\u0015\u0010\u0011\u001a\u00020\u00002\u0006\u0010\u0010\u001a\u00020\u0000¢\u0006\u0004\b\u0011\u0010\u000bJ\r\u0010\u0012\u001a\u00020\u0000¢\u0006\u0004\b\u0012\u0010\u0013J\r\u0010\u0015\u001a\u00020\u0014¢\u0006\u0004\b\u0015\u0010\u0016J\r\u0010\u0018\u001a\u00020\u0017¢\u0006\u0004\b\u0018\u0010\u0019J\u0018\u0010\u001b\u001a\u00020\u001a2\u0006\u0010\u0010\u001a\u00020\u0000H\u0096\u0002¢\u0006\u0004\b\u001b\u0010\u001cJ\u001a\u0010\u001e\u001a\u00020\f2\b\u0010\u0010\u001a\u0004\u0018\u00010\u001dH\u0096\u0002¢\u0006\u0004\b\u001e\u0010\u001fJ\u000f\u0010 \u001a\u00020\u001aH\u0016¢\u0006\u0004\b \u0010!J\u000f\u0010\"\u001a\u00020\u0006H\u0016¢\u0006\u0004\b\"\u0010#R\u001a\u0010\u0003\u001a\u00020\u00028\u0000X\u0080\u0004¢\u0006\f\n\u0004\b\u001b\u0010$\u001a\u0004\b%\u0010&R\u0013\u0010(\u001a\u0004\u0018\u00010\u00008F¢\u0006\u0006\u001a\u0004\b'\u0010\u0013R\u0017\u0010,\u001a\b\u0012\u0004\u0012\u00020\u00020)8F¢\u0006\u0006\u001a\u0004\b*\u0010+R\u0011\u0010-\u001a\u00020\f8F¢\u0006\u0006\u001a\u0004\b-\u0010.R\u0013\u00102\u001a\u0004\u0018\u00010/8G¢\u0006\u0006\u001a\u0004\b0\u00101R\u0011\u00104\u001a\u00020\u00028G¢\u0006\u0006\u001a\u0004\b3\u0010&R\u0011\u00106\u001a\u00020\u00068G¢\u0006\u0006\u001a\u0004\b5\u0010#R\u0013\u00108\u001a\u0004\u0018\u00010\u00008G¢\u0006\u0006\u001a\u0004\b7\u0010\u0013¨\u0006:"}, d2 = {"Lokio/Path;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lokio/ByteString;", "bytes", "<init>", "(Lokio/ByteString;)V", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "child", "j", "(Ljava/lang/String;)Lokio/Path;", "k", "(Lokio/Path;)Lokio/Path;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "normalize", "l", "(Lokio/Path;Z)Lokio/Path;", "other", "i", "g", "()Lokio/Path;", "Ljava/io/File;", "toFile", "()Ljava/io/File;", "Ljava/nio/file/Path;", "n", "()Ljava/nio/file/Path;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "a", "(Lokio/Path;)I", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "equals", "(Ljava/lang/Object;)Z", "hashCode", "()I", "toString", "()Ljava/lang/String;", "Lokio/ByteString;", "b", "()Lokio/ByteString;", "c", "root", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "d", "()Ljava/util/List;", "segmentsBytes", "isAbsolute", "()Z", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "o", "()Ljava/lang/Character;", "volumeLetter", "f", "nameBytes", "e", "name", "h", "parent", "Companion", "okio"}, k = 1, mv = {1, 9, 0}, xi = 48)
@kotlin.jvm.internal.SourceDebugExtension
public final class Path implements java.lang.Comparable<okio.Path> {

    /* JADX INFO: renamed from: b, reason: from kotlin metadata */
    public static final okio.Path.Companion INSTANCE = new okio.Path.Companion(null);
    public static final java.lang.String c;

    /* JADX INFO: renamed from: a, reason: from kotlin metadata */
    private final okio.ByteString bytes;

    /* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
    @kotlin.Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003J\u001d\u0010\b\u001a\u00020\u0007*\u00020\u00042\b\b\u0002\u0010\u0006\u001a\u00020\u0005H\u0007¢\u0006\u0004\b\b\u0010\tJ\u001d\u0010\u000b\u001a\u00020\u0007*\u00020\n2\b\b\u0002\u0010\u0006\u001a\u00020\u0005H\u0007¢\u0006\u0004\b\u000b\u0010\fJ\u001d\u0010\u000e\u001a\u00020\u0007*\u00020\r2\b\b\u0002\u0010\u0006\u001a\u00020\u0005H\u0007¢\u0006\u0004\b\u000e\u0010\u000fR\u0014\u0010\u0010\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u0006\n\u0004\b\u0010\u0010\u0011¨\u0006\u0012"}, d2 = {"Lokio/Path$Companion;", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "<init>", "()V", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "normalize", "Lokio/Path;", "b", "(Ljava/lang/String;Z)Lokio/Path;", "Ljava/io/File;", "a", "(Ljava/io/File;Z)Lokio/Path;", "Ljava/nio/file/Path;", "c", "(Ljava/nio/file/Path;Z)Lokio/Path;", "DIRECTORY_SEPARATOR", "Ljava/lang/String;", "okio"}, k = 1, mv = {1, 9, 0}, xi = 48)
    public static final class Companion {
        public /* synthetic */ Companion(kotlin.jvm.internal.DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        public static /* synthetic */ okio.Path d(okio.Path.Companion companion, java.io.File file, boolean z, int i, java.lang.Object obj) {
            if ((i & 1) != 0) {
                z = false;
            }
            return companion.a(file, z);
        }

        public static /* synthetic */ okio.Path e(okio.Path.Companion companion, java.lang.String str, boolean z, int i, java.lang.Object obj) {
            if ((i & 1) != 0) {
                z = false;
            }
            return companion.b(str, z);
        }

        public static /* synthetic */ okio.Path f(okio.Path.Companion companion, java.nio.file.Path path, boolean z, int i, java.lang.Object obj) {
            if ((i & 1) != 0) {
                z = false;
            }
            return companion.c(path, z);
        }

        public final okio.Path a(java.io.File file, boolean z) {
            kotlin.jvm.internal.Intrinsics.l(file, "<this>");
            java.lang.String string = file.toString();
            kotlin.jvm.internal.Intrinsics.k(string, "toString(...)");
            return b(string, z);
        }

        public final okio.Path b(java.lang.String str, boolean z) {
            kotlin.jvm.internal.Intrinsics.l(str, "<this>");
            return okio.internal.Path.k(str, z);
        }

        public final okio.Path c(java.nio.file.Path path, boolean z) {
            kotlin.jvm.internal.Intrinsics.l(path, "<this>");
            return b(path.toString(), z);
        }

        private Companion() {
        }
    }

    static {
        java.lang.String str = java.io.File.separator;
        kotlin.jvm.internal.Intrinsics.k(str, "separator");
        c = str;
    }

    public Path(okio.ByteString byteString) {
        kotlin.jvm.internal.Intrinsics.l(byteString, "bytes");
        this.bytes = byteString;
    }

    public static /* synthetic */ okio.Path m(okio.Path path, okio.Path path2, boolean z, int i, java.lang.Object obj) {
        if ((i & 2) != 0) {
            z = false;
        }
        return path.l(path2, z);
    }

    @Override // java.lang.Comparable
    /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
    public int compareTo(okio.Path other) {
        kotlin.jvm.internal.Intrinsics.l(other, "other");
        return getBytes().compareTo(other.getBytes());
    }

    /* JADX INFO: renamed from: b, reason: from getter */
    public final okio.ByteString getBytes() {
        return this.bytes;
    }

    public final okio.Path c() {
        int iO = okio.internal.Path.o(this);
        if (iO == -1) {
            return null;
        }
        return new okio.Path(getBytes().D(0, iO));
    }

    public final java.util.List d() {
        java.util.ArrayList arrayList = new java.util.ArrayList();
        int iO = okio.internal.Path.o(this);
        if (iO == -1) {
            iO = 0;
        } else if (iO < getBytes().B() && getBytes().f(iO) == 92) {
            iO++;
        }
        int iB = getBytes().B();
        int i = iO;
        while (iO < iB) {
            if (getBytes().f(iO) == 47 || getBytes().f(iO) == 92) {
                arrayList.add(getBytes().D(i, iO));
                i = iO + 1;
            }
            iO++;
        }
        if (i < getBytes().B()) {
            arrayList.add(getBytes().D(i, getBytes().B()));
        }
        return arrayList;
    }

    public final java.lang.String e() {
        return f().H();
    }

    public boolean equals(java.lang.Object other) {
        return (other instanceof okio.Path) && kotlin.jvm.internal.Intrinsics.g(((okio.Path) other).getBytes(), getBytes());
    }

    public final okio.ByteString f() {
        int iL = okio.internal.Path.l(this);
        if (iL != -1) {
            return okio.ByteString.F(getBytes(), iL + 1, 0, 2, null);
        }
        return (o() == null || getBytes().B() != 2) ? getBytes() : okio.ByteString.e;
    }

    public final okio.Path g() {
        return INSTANCE.b(toString(), true);
    }

    public final okio.Path h() {
        if (kotlin.jvm.internal.Intrinsics.g(getBytes(), okio.internal.Path.d) || kotlin.jvm.internal.Intrinsics.g(getBytes(), okio.internal.Path.a) || kotlin.jvm.internal.Intrinsics.g(getBytes(), okio.internal.Path.b) || okio.internal.Path.n(this)) {
            return null;
        }
        int iL = okio.internal.Path.l(this);
        if (iL == 2 && o() != null) {
            if (getBytes().B() == 3) {
                return null;
            }
            return new okio.Path(okio.ByteString.F(getBytes(), 0, 3, 1, null));
        }
        if (iL == 1 && getBytes().C(okio.internal.Path.b)) {
            return null;
        }
        if (iL != -1 || o() == null) {
            if (iL == -1) {
                return new okio.Path(okio.internal.Path.d);
            }
            return iL == 0 ? new okio.Path(okio.ByteString.F(getBytes(), 0, 1, 1, null)) : new okio.Path(okio.ByteString.F(getBytes(), 0, iL, 1, null));
        }
        if (getBytes().B() == 2) {
            return null;
        }
        return new okio.Path(okio.ByteString.F(getBytes(), 0, 2, 1, null));
    }

    public int hashCode() {
        return getBytes().hashCode();
    }

    public final okio.Path i(okio.Path other) {
        kotlin.jvm.internal.Intrinsics.l(other, "other");
        if (!kotlin.jvm.internal.Intrinsics.g(c(), other.c())) {
            throw new java.lang.IllegalArgumentException(("Paths of different roots cannot be relative to each other: " + this + " and " + other).toString());
        }
        java.util.List listD = d();
        java.util.List listD2 = other.d();
        int iMin = java.lang.Math.min(listD.size(), listD2.size());
        int i = 0;
        while (i < iMin && kotlin.jvm.internal.Intrinsics.g(listD.get(i), listD2.get(i))) {
            i++;
        }
        if (i == iMin && getBytes().B() == other.getBytes().B()) {
            return okio.Path.Companion.e(INSTANCE, ".", false, 1, null);
        }
        if (listD2.subList(i, listD2.size()).indexOf(okio.internal.Path.e) != -1) {
            throw new java.lang.IllegalArgumentException(("Impossible relative path to resolve: " + this + " and " + other).toString());
        }
        okio.Buffer buffer = new okio.Buffer();
        okio.ByteString byteStringM = okio.internal.Path.m(other);
        if (byteStringM == null && (byteStringM = okio.internal.Path.m(this)) == null) {
            byteStringM = okio.internal.Path.s(c);
        }
        int size = listD2.size();
        for (int i2 = i; i2 < size; i2++) {
            buffer.U0(okio.internal.Path.e);
            buffer.U0(byteStringM);
        }
        int size2 = listD.size();
        while (i < size2) {
            buffer.U0((okio.ByteString) listD.get(i));
            buffer.U0(byteStringM);
            i++;
        }
        return okio.internal.Path.q(buffer, false);
    }

    public final boolean isAbsolute() {
        return okio.internal.Path.o(this) != -1;
    }

    public final okio.Path j(java.lang.String child) {
        kotlin.jvm.internal.Intrinsics.l(child, "child");
        return okio.internal.Path.j(this, okio.internal.Path.q(new okio.Buffer().C1(child), false), false);
    }

    public final okio.Path k(okio.Path child) {
        kotlin.jvm.internal.Intrinsics.l(child, "child");
        return okio.internal.Path.j(this, child, false);
    }

    public final okio.Path l(okio.Path child, boolean normalize) {
        kotlin.jvm.internal.Intrinsics.l(child, "child");
        return okio.internal.Path.j(this, child, normalize);
    }

    public final java.nio.file.Path n() {
        java.nio.file.Path path = java.nio.file.Paths.get(toString(), new java.lang.String[0]);
        kotlin.jvm.internal.Intrinsics.k(path, "get(...)");
        return path;
    }

    public final java.lang.Character o() {
        if (okio.ByteString.n(getBytes(), okio.internal.Path.a, 0, 2, null) != -1 || getBytes().B() < 2 || getBytes().f(1) != 58) {
            return null;
        }
        char cF = (char) getBytes().f(0);
        if (('a' > cF || cF >= '{') && ('A' > cF || cF >= '[')) {
            return null;
        }
        return java.lang.Character.valueOf(cF);
    }

    public final java.io.File toFile() {
        return new java.io.File(toString());
    }

    public java.lang.String toString() {
        return getBytes().H();
    }
}
