package o; import com.huawei.hms.framework.common.hianalytics.CrashHianalyticsData; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; import java.io.ObjectStreamException; import java.io.Serializable; import org.jmrtd.lds.CVCAFile; import org.threeten.bp.DateTimeException; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.temporal.UnsupportedTemporalTypeException; /* renamed from: o.gst, reason: case insensitive filesystem */ /* loaded from: classes6.dex */ public final class C15524gst extends gtE implements InterfaceC15536gtL, gtJ, Comparable, Serializable { private static final long serialVersionUID = 7264499704384272492L; private final gsI offset; private final C15521gsq time; public static final C15524gst MIN = C15521gsq.MIN.atOffset(gsI.MAX); public static final C15524gst MAX = C15521gsq.MAX.atOffset(gsI.MIN); public static final gtQ FROM = new gtQ() { // from class: o.gst.3 @Override // o.gtQ public final C15524gst queryFrom(gtK gtk) { return C15524gst.from(gtk); } }; public static C15524gst now() { return now(AbstractC15514gsj.systemDefaultZone()); } public static C15524gst now(AbstractC15502gsH abstractC15502gsH) { return now(AbstractC15514gsj.system(abstractC15502gsH)); } public static C15524gst now(AbstractC15514gsj abstractC15514gsj) { gtG.requireNonNull(abstractC15514gsj, "clock"); C15523gss instant = abstractC15514gsj.instant(); return ofInstant(instant, abstractC15514gsj.getZone().getRules().getOffset(instant)); } public static C15524gst of(C15521gsq c15521gsq, gsI gsi) { return new C15524gst(c15521gsq, gsi); } public static C15524gst of(int i, int i2, int i3, int i4, gsI gsi) { return new C15524gst(C15521gsq.of(i, i2, i3, i4), gsi); } public static C15524gst ofInstant(C15523gss c15523gss, AbstractC15502gsH abstractC15502gsH) { gtG.requireNonNull(c15523gss, "instant"); gtG.requireNonNull(abstractC15502gsH, "zone"); gsI offset = abstractC15502gsH.getRules().getOffset(c15523gss); long epochSecond = ((c15523gss.getEpochSecond() % 86400) + offset.getTotalSeconds()) % 86400; if (epochSecond < 0) { epochSecond += 86400; } return new C15524gst(C15521gsq.ofSecondOfDay(epochSecond, c15523gss.getNano()), offset); } public static C15524gst from(gtK gtk) { if (gtk instanceof C15524gst) { return (C15524gst) gtk; } try { return new C15524gst(C15521gsq.from(gtk), gsI.from(gtk)); } catch (DateTimeException unused) { StringBuilder sb = new StringBuilder("Unable to obtain OffsetTime from TemporalAccessor: "); sb.append(gtk); sb.append(", type "); sb.append(gtk.getClass().getName()); throw new DateTimeException(sb.toString()); } } public static C15524gst parse(CharSequence charSequence) { return parse(charSequence, C15554gto.ISO_OFFSET_TIME); } public static C15524gst parse(CharSequence charSequence, C15554gto c15554gto) { gtG.requireNonNull(c15554gto, "formatter"); return (C15524gst) c15554gto.parse(charSequence, FROM); } private C15524gst(C15521gsq c15521gsq, gsI gsi) { this.time = (C15521gsq) gtG.requireNonNull(c15521gsq, CrashHianalyticsData.TIME); this.offset = (gsI) gtG.requireNonNull(gsi, "offset"); } private C15524gst with(C15521gsq c15521gsq, gsI gsi) { return (this.time == c15521gsq && this.offset.equals(gsi)) ? this : new C15524gst(c15521gsq, gsi); } @Override // o.gtK public final boolean isSupported(InterfaceC15537gtP interfaceC15537gtP) { return interfaceC15537gtP instanceof EnumC15534gtD ? interfaceC15537gtP.isTimeBased() || interfaceC15537gtP == EnumC15534gtD.OFFSET_SECONDS : interfaceC15537gtP != null && interfaceC15537gtP.isSupportedBy(this); } @Override // o.InterfaceC15536gtL public final boolean isSupported(InterfaceC15539gtV interfaceC15539gtV) { if (interfaceC15539gtV instanceof gtH) { return interfaceC15539gtV.isTimeBased(); } return interfaceC15539gtV != null && interfaceC15539gtV.isSupportedBy(this); } @Override // o.gtE, o.gtK public final gtT range(InterfaceC15537gtP interfaceC15537gtP) { if (interfaceC15537gtP instanceof EnumC15534gtD) { if (interfaceC15537gtP == EnumC15534gtD.OFFSET_SECONDS) { return interfaceC15537gtP.range(); } return this.time.range(interfaceC15537gtP); } return interfaceC15537gtP.rangeRefinedBy(this); } @Override // o.gtE, o.gtK public final int get(InterfaceC15537gtP interfaceC15537gtP) { return super.get(interfaceC15537gtP); } @Override // o.gtK public final long getLong(InterfaceC15537gtP interfaceC15537gtP) { if (interfaceC15537gtP instanceof EnumC15534gtD) { if (interfaceC15537gtP == EnumC15534gtD.OFFSET_SECONDS) { return getOffset().getTotalSeconds(); } return this.time.getLong(interfaceC15537gtP); } return interfaceC15537gtP.getFrom(this); } public final C15524gst withOffsetSameLocal(gsI gsi) { return (gsi == null || !gsi.equals(this.offset)) ? new C15524gst(this.time, gsi) : this; } public final C15524gst withOffsetSameInstant(gsI gsi) { if (gsi.equals(this.offset)) { return this; } return new C15524gst(this.time.plusSeconds(gsi.getTotalSeconds() - this.offset.getTotalSeconds()), gsi); } public final int getHour() { return this.time.getHour(); } public final int getMinute() { return this.time.getMinute(); } public final int getSecond() { return this.time.getSecond(); } public final int getNano() { return this.time.getNano(); } @Override // o.InterfaceC15536gtL public final C15524gst with(gtJ gtj) { if (gtj instanceof C15521gsq) { return with((C15521gsq) gtj, this.offset); } if (gtj instanceof gsI) { return with(this.time, (gsI) gtj); } if (gtj instanceof C15524gst) { return (C15524gst) gtj; } return (C15524gst) gtj.adjustInto(this); } @Override // o.InterfaceC15536gtL public final C15524gst with(InterfaceC15537gtP interfaceC15537gtP, long j) { if (interfaceC15537gtP instanceof EnumC15534gtD) { if (interfaceC15537gtP == EnumC15534gtD.OFFSET_SECONDS) { return with(this.time, gsI.ofTotalSeconds(((EnumC15534gtD) interfaceC15537gtP).checkValidIntValue(j))); } return with(this.time.with(interfaceC15537gtP, j), this.offset); } return (C15524gst) interfaceC15537gtP.adjustInto(this, j); } public final C15524gst withHour(int i) { return with(this.time.withHour(i), this.offset); } public final C15524gst withMinute(int i) { return with(this.time.withMinute(i), this.offset); } public final C15524gst withSecond(int i) { return with(this.time.withSecond(i), this.offset); } public final C15524gst withNano(int i) { return with(this.time.withNano(i), this.offset); } public final C15524gst truncatedTo(InterfaceC15539gtV interfaceC15539gtV) { return with(this.time.truncatedTo(interfaceC15539gtV), this.offset); } @Override // o.InterfaceC15536gtL public final C15524gst plus(gtN gtn) { return (C15524gst) gtn.addTo(this); } @Override // o.InterfaceC15536gtL public final C15524gst plus(long j, InterfaceC15539gtV interfaceC15539gtV) { if (interfaceC15539gtV instanceof gtH) { return with(this.time.plus(j, interfaceC15539gtV), this.offset); } return (C15524gst) interfaceC15539gtV.addTo(this, j); } public final C15524gst plusHours(long j) { return with(this.time.plusHours(j), this.offset); } public final C15524gst plusMinutes(long j) { return with(this.time.plusMinutes(j), this.offset); } public final C15524gst plusSeconds(long j) { return with(this.time.plusSeconds(j), this.offset); } public final C15524gst plusNanos(long j) { return with(this.time.plusNanos(j), this.offset); } @Override // o.InterfaceC15536gtL public final C15524gst minus(gtN gtn) { return (C15524gst) gtn.subtractFrom(this); } @Override // o.InterfaceC15536gtL public final C15524gst minus(long j, InterfaceC15539gtV interfaceC15539gtV) { return j == Long.MIN_VALUE ? plus(Long.MAX_VALUE, interfaceC15539gtV).plus(1L, interfaceC15539gtV) : plus(-j, interfaceC15539gtV); } public final C15524gst minusHours(long j) { return with(this.time.minusHours(j), this.offset); } public final C15524gst minusMinutes(long j) { return with(this.time.minusMinutes(j), this.offset); } public final C15524gst minusSeconds(long j) { return with(this.time.minusSeconds(j), this.offset); } public final C15524gst minusNanos(long j) { return with(this.time.minusNanos(j), this.offset); } @Override // o.gtE, o.gtK public final R query(gtQ gtq) { if (gtq == gtM.precision()) { return (R) gtH.NANOS; } if (gtq == gtM.offset() || gtq == gtM.zone()) { return (R) getOffset(); } if (gtq == gtM.localTime()) { return (R) this.time; } if (gtq == gtM.chronology() || gtq == gtM.localDate() || gtq == gtM.zoneId()) { return null; } return (R) super.query(gtq); } @Override // o.gtJ public final InterfaceC15536gtL adjustInto(InterfaceC15536gtL interfaceC15536gtL) { return interfaceC15536gtL.with(EnumC15534gtD.NANO_OF_DAY, this.time.toNanoOfDay()).with(EnumC15534gtD.OFFSET_SECONDS, getOffset().getTotalSeconds()); } @Override // o.InterfaceC15536gtL public final long until(InterfaceC15536gtL interfaceC15536gtL, InterfaceC15539gtV interfaceC15539gtV) { C15524gst from = from(interfaceC15536gtL); if (interfaceC15539gtV instanceof gtH) { long epochNano = from.toEpochNano() - toEpochNano(); switch (AnonymousClass1.$SwitchMap$org$threeten$bp$temporal$ChronoUnit[((gtH) interfaceC15539gtV).ordinal()]) { case 1: return epochNano; case 2: return epochNano / 1000; case 3: return epochNano / 1000000; case 4: return epochNano / 1000000000; case 5: return epochNano / 60000000000L; case 6: return epochNano / 3600000000000L; case 7: return epochNano / 43200000000000L; default: throw new UnsupportedTemporalTypeException("Unsupported unit: ".concat(String.valueOf(interfaceC15539gtV))); } } return interfaceC15539gtV.between(this, from); } /* renamed from: o.gst$1, reason: invalid class name */ /* loaded from: classes6.dex */ static /* synthetic */ class AnonymousClass1 { static final int[] $SwitchMap$org$threeten$bp$temporal$ChronoUnit; static { int[] iArr = new int[gtH.values().length]; $SwitchMap$org$threeten$bp$temporal$ChronoUnit = iArr; try { iArr[gtH.NANOS.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { $SwitchMap$org$threeten$bp$temporal$ChronoUnit[gtH.MICROS.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { $SwitchMap$org$threeten$bp$temporal$ChronoUnit[gtH.MILLIS.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { $SwitchMap$org$threeten$bp$temporal$ChronoUnit[gtH.SECONDS.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } try { $SwitchMap$org$threeten$bp$temporal$ChronoUnit[gtH.MINUTES.ordinal()] = 5; } catch (NoSuchFieldError unused5) { } try { $SwitchMap$org$threeten$bp$temporal$ChronoUnit[gtH.HOURS.ordinal()] = 6; } catch (NoSuchFieldError unused6) { } try { $SwitchMap$org$threeten$bp$temporal$ChronoUnit[gtH.HALF_DAYS.ordinal()] = 7; } catch (NoSuchFieldError unused7) { } } } public final OffsetDateTime atDate(C15520gsp c15520gsp) { return OffsetDateTime.of(c15520gsp, this.time, this.offset); } private long toEpochNano() { return this.time.toNanoOfDay() - (this.offset.getTotalSeconds() * 1000000000); } @Override // java.lang.Comparable public final int compareTo(C15524gst c15524gst) { if (this.offset.equals(c15524gst.offset)) { return this.time.compareTo2(c15524gst.time); } int compareLongs = gtG.compareLongs(toEpochNano(), c15524gst.toEpochNano()); return compareLongs == 0 ? this.time.compareTo2(c15524gst.time) : compareLongs; } public final boolean isAfter(C15524gst c15524gst) { return toEpochNano() > c15524gst.toEpochNano(); } public final boolean isBefore(C15524gst c15524gst) { return toEpochNano() < c15524gst.toEpochNano(); } public final boolean isEqual(C15524gst c15524gst) { return toEpochNano() == c15524gst.toEpochNano(); } public final boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof C15524gst)) { return false; } C15524gst c15524gst = (C15524gst) obj; return this.time.equals(c15524gst.time) && this.offset.equals(c15524gst.offset); } public final int hashCode() { return this.time.hashCode() ^ this.offset.hashCode(); } public final String toString() { StringBuilder sb = new StringBuilder(); sb.append(this.time.toString()); sb.append(this.offset.toString()); return sb.toString(); } public final String format(C15554gto c15554gto) { gtG.requireNonNull(c15554gto, "formatter"); return c15554gto.format(this); } private Object writeReplace() { return new C15501gsD(CVCAFile.CAR_TAG, this); } private Object readResolve() throws ObjectStreamException { throw new InvalidObjectException("Deserialization via serialization delegate"); } /* JADX INFO: Access modifiers changed from: package-private */ public final void writeExternal(DataOutput dataOutput) throws IOException { this.time.writeExternal(dataOutput); this.offset.writeExternal(dataOutput); } /* JADX INFO: Access modifiers changed from: package-private */ public static C15524gst readExternal(DataInput dataInput) throws IOException { return of(C15521gsq.readExternal(dataInput), gsI.readExternal(dataInput)); } public final C15521gsq toLocalTime() { return this.time; } public final gsI getOffset() { return this.offset; } }