content: package okhttp3;
  
  import java.time.Instant;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.Collections;
  import java.util.Date;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Locale;
  import java.util.Map;
  import java.util.Set;
  import java.util.TreeMap;
  import java.util.TreeSet;
  import kotlin.Deprecated;
  import kotlin.DeprecationLevel;
  import kotlin.Metadata;
  import kotlin.Pair;
  import kotlin.ReplaceWith;
  import kotlin.TuplesKt;
  import kotlin.collections.CollectionsKt;
  import kotlin.jvm.JvmStatic;
  import kotlin.jvm.internal.ArrayIteratorKt;
  import kotlin.jvm.internal.DefaultConstructorMarker;
  import kotlin.jvm.internal.Intrinsics;
  import kotlin.jvm.internal.StringCompanionObject;
  import kotlin.jvm.internal.markers.KMappedMarker;
  import kotlin.ranges.IntProgression;
  import kotlin.ranges.RangesKt;
  import kotlin.text.StringsKt;
  import mt.Log1F380D;
  import okhttp3.internal.Util;
  import okhttp3.internal.http.DatesKt;
  
  @Metadata(bv = {1, 0, 3}, d1 = {"\u0000f\n\u0002\u0018\u0002\n\u0002\u0010\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0011\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010(\n\u0002\b\u0002\n\u0002\u0010\"\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010$\n\u0002\u0010 \n\u0002\b\u0006\u0018\u0000 '2\u0014\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\u00030\u00020\u0001:\u0002&'B\u0015\b\u0002\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00030\u0005¢\u0006\u0002\u0010\u0006J\u0006\u0010\u000b\u001a\u00020\fJ\u0013\u0010\r\u001a\u00020\u000e2\b\u0010\u000f\u001a\u0004\u0018\u00010\u0010H\u0002J\u0013\u0010\u0011\u001a\u0004\u0018\u00010\u00032\u0006\u0010\u0012\u001a\u00020\u0003H\u0002J\u0010\u0010\u0013\u001a\u0004\u0018\u00010\u00142\u0006\u0010\u0012\u001a\u00020\u0003J\u0012\u0010\u0015\u001a\u0004\u0018\u00010\u00162\u0006\u0010\u0012\u001a\u00020\u0003H\u0007J\b\u0010\u0017\u001a\u00020\tH\u0016J\u001b\u0010\u0018\u001a\u0014\u0012\u0010\u0012\u000e\u0012\u0004\u0012\u00020\u0003\u0012\u0004\u0012\u00020\u00030\u00020\u0019H\u0002J\u000e\u0010\u0012\u001a\u00020\u00032\u0006\u0010\u001a\u001a\u00020\tJ\f\u0010\u001b\u001a\b\u0012\u0004\u0012\u00020\u00030\u001cJ\u0006\u0010\u001d\u001a\u00020\u001eJ\r\u0010\b\u001a\u00020\tH\u0007¢\u0006\u0002\b\u001fJ\u0018\u0010 \u001a\u0014\u0012\u0004\u0012\u00020\u0003\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\"0!J\b\u0010#\u001a\u00020\u0003H\u0016J\u000e\u0010$\u001a\u00020\u00032\u0006\u0010\u001a\u001a\u00020\tJ\u0014\u0010%\u001a\b\u0012\u0004\u0012\u00020\u00030\"2\u0006\u0010\u0012\u001a\u00020\u0003R\u0016\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00030\u0005X\u0004¢\u0006\u0004\n\u0002\u0010\u0007R\u0011\u0010\b\u001a\u00020\t8G¢\u0006\u0006\u001a\u0004\b\b\u0010\n¨\u0006("}, d2 = {"Lokhttp3/Headers;", "", "Lkotlin/Pair;", "", "namesAndValues", "", "([Ljava/lang/String;)V", "[Ljava/lang/String;", "size", "", "()I", "byteCount", "", "equals", "", "other", "", "get", "name", "getDate", "Ljava/util/Date;", "getInstant", "Ljava/time/Instant;", "hashCode", "iterator", "", "index", "names", "", "newBuilder", "Lokhttp3/Headers$Builder;", "-deprecated_size", "toMultimap", "", "", "toString", "value", "values", "Builder", "Companion", "okhttp"}, k = 1, mv = {1, 4, 0})
  /* compiled from: 01BC */
  public final class Headers implements Iterable<Pair<? extends String, ? extends String>>, KMappedMarker {
      public static final Companion Companion = new Companion((DefaultConstructorMarker) null);
      private final String[] namesAndValues;
  
      @Metadata(bv = {1, 0, 3}, d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010!\n\u0002\u0010\u000e\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u000e\u0010\b\u001a\u00020\u00002\u0006\u0010\t\u001a\u00020\u0005J\u0018\u0010\b\u001a\u00020\u00002\u0006\u0010\n\u001a\u00020\u00052\u0006\u0010\u000b\u001a\u00020\fH\u0007J\u0016\u0010\b\u001a\u00020\u00002\u0006\u0010\n\u001a\u00020\u00052\u0006\u0010\u000b\u001a\u00020\rJ\u0016\u0010\b\u001a\u00020\u00002\u0006\u0010\n\u001a\u00020\u00052\u0006\u0010\u000b\u001a\u00020\u0005J\u000e\u0010\u000e\u001a\u00020\u00002\u0006\u0010\u000f\u001a\u00020\u0010J\u0015\u0010\u0011\u001a\u00020\u00002\u0006\u0010\t\u001a\u00020\u0005H\u0000¢\u0006\u0002\b\u0012J\u001d\u0010\u0011\u001a\u00020\u00002\u0006\u0010\n\u001a\u00020\u00052\u0006\u0010\u000b\u001a\u00020\u0005H\u0000¢\u0006\u0002\b\u0012J\u0016\u0010\u0013\u001a\u00020\u00002\u0006\u0010\n\u001a\u00020\u00052\u0006\u0010\u000b\u001a\u00020\u0005J\u0006\u0010\u0014\u001a\u00020\u0010J\u0013\u0010\u0015\u001a\u0004\u0018\u00010\u00052\u0006\u0010\n\u001a\u00020\u0005H\u0002J\u000e\u0010\u0016\u001a\u00020\u00002\u0006\u0010\n\u001a\u00020\u0005J\u0019\u0010\u0017\u001a\u00020\u00002\u0006\u0010\n\u001a\u00020\u00052\u0006\u0010\u000b\u001a\u00020\fH\u0002J\u0019\u0010\u0017\u001a\u00020\u00002\u0006\u0010\n\u001a\u00020\u00052\u0006\u0010\u000b\u001a\u00020\rH\u0002J\u0019\u0010\u0017\u001a\u00020\u00002\u0006\u0010\n\u001a\u00020\u00052\u0006\u0010\u000b\u001a\u00020\u0005H\u0002R\u001a\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004X\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007¨\u0006\u0018"}, d2 = {"Lokhttp3/Headers$Builder;", "", "()V", "namesAndValues", "", "", "getNamesAndValues$okhttp", "()Ljava/util/List;", "add", "line", "name", "value", "Ljava/time/Instant;", "Ljava/util/Date;", "addAll", "headers", "Lokhttp3/Headers;", "addLenient", "addLenient$okhttp", "addUnsafeNonAscii", "build", "get", "removeAll", "set", "okhttp"}, k = 1, mv = {1, 4, 0})
      /* compiled from: 01BA */
      public static final class Builder {
          private final List<String> namesAndValues = new ArrayList(20);
  
          public final Builder add(String line) {
              Intrinsics.checkNotNullParameter(line, "line");
              Builder builder = this;
              int indexOf$default = StringsKt.indexOf$default((CharSequence) line, ':', 0, false, 6, (Object) null);
              if (indexOf$default != -1) {
                  String substring = line.substring(0, indexOf$default);
                  Intrinsics.checkNotNullExpressionValue(substring, "(this as java.lang.Strin…ing(startIndex, endIndex)");
                  if (substring != null) {
                      String obj = StringsKt.trim((CharSequence) substring).toString();
                      String substring2 = line.substring(indexOf$default + 1);
                      Intrinsics.checkNotNullExpressionValue(substring2, "(this as java.lang.String).substring(startIndex)");
                      builder.add(obj, substring2);
                      return this;
                  }
                  throw new NullPointerException("null cannot be cast to non-null type kotlin.CharSequence");
              }
              throw new IllegalArgumentException(("Unexpected header: " + line).toString());
          }
  
          public final Builder add(String name, String value) {
              Intrinsics.checkNotNullParameter(name, "name");
              Intrinsics.checkNotNullParameter(value, "value");
              Headers.Companion.checkName(name);
              Headers.Companion.checkValue(value, name);
              addLenient$okhttp(name, value);
              return this;
          }
  
          public final Builder add(String name, Instant value) {
              Intrinsics.checkNotNullParameter(name, "name");
              Intrinsics.checkNotNullParameter(value, "value");
              add(name, new Date(value.toEpochMilli()));
              return this;
          }
  
          public final Builder add(String name, Date value) {
              Intrinsics.checkNotNullParameter(name, "name");
              Intrinsics.checkNotNullParameter(value, "value");
              String httpDateString = DatesKt.toHttpDateString(value);
              Log1F380D.a((Object) httpDateString);
              add(name, httpDateString);
              return this;
          }
  
          public final Builder addAll(Headers headers) {
              Intrinsics.checkNotNullParameter(headers, "headers");
              Builder builder = this;
              int size = headers.size();
              for (int i = 0; i < size; i++) {
                  builder.addLenient$okhttp(headers.name(i), headers.value(i));
              }
              return this;
          }
  
          public final Builder addLenient$okhttp(String line) {
              Intrinsics.checkNotNullParameter(line, "line");
              Builder builder = this;
              int indexOf$default = StringsKt.indexOf$default((CharSequence) line, ':', 1, false, 4, (Object) null);
              if (indexOf$default != -1) {
                  String substring = line.substring(0, indexOf$default);
                  Intrinsics.checkNotNullExpressionValue(substring, "(this as java.lang.Strin…ing(startIndex, endIndex)");
                  String substring2 = line.substring(indexOf$default + 1);
                  Intrinsics.checkNotNullExpressionValue(substring2, "(this as java.lang.String).substring(startIndex)");
                  builder.addLenient$okhttp(substring, substring2);
              } else if (line.charAt(0) == ':') {
                  String substring3 = line.substring(1);
                  Intrinsics.checkNotNullExpressionValue(substring3, "(this as java.lang.String).substring(startIndex)");
                  builder.addLenient$okhttp(HttpUrl.FRAGMENT_ENCODE_SET, substring3);
              } else {
                  builder.addLenient$okhttp(HttpUrl.FRAGMENT_ENCODE_SET, line);
              }
              return this;
          }
  
          public final Builder addLenient$okhttp(String name, String value) {
              Intrinsics.checkNotNullParameter(name, "name");
              Intrinsics.checkNotNullParameter(value, "value");
              Builder builder = this;
              builder.namesAndValues.add(name);
              builder.namesAndValues.add(StringsKt.trim((CharSequence) value).toString());
              return this;
          }
  
          public final Builder addUnsafeNonAscii(String name, String value) {
              Intrinsics.checkNotNullParameter(name, "name");
              Intrinsics.checkNotNullParameter(value, "value");
              Headers.Companion.checkName(name);
              addLenient$okhttp(name, value);
              return this;
          }
  
          public final Headers build() {
              Object[] array = this.namesAndValues.toArray(new String[0]);
              if (array != null) {
                  return new Headers((String[]) array, (DefaultConstructorMarker) null);
              }
              throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<T>");
          }
  
          public final String get(String name) {
              Intrinsics.checkNotNullParameter(name, "name");
              IntProgression step = RangesKt.step(RangesKt.downTo(this.namesAndValues.size() - 2, 0), 2);
              int first = step.getFirst();
              int last = step.getLast();
              int step2 = step.getStep();
              if (step2 >= 0) {
                  if (first > last) {
                      return null;
                  }
              } else if (first < last) {
                  return null;
              }
              while (!StringsKt.equals(name, this.namesAndValues.get(first), true)) {
                  if (first == last) {
                      return null;
                  }
                  first += step2;
              }
              return this.namesAndValues.get(first + 1);
          }
  
          public final List<String> getNamesAndValues$okhttp() {
              return this.namesAndValues;
          }
  
          public final Builder removeAll(String name) {
              Intrinsics.checkNotNullParameter(name, "name");
              Builder builder = this;
              int i = 0;
              while (i < builder.namesAndValues.size()) {
                  if (StringsKt.equals(name, builder.namesAndValues.get(i), true)) {
                      builder.namesAndValues.remove(i);
                      builder.namesAndValues.remove(i);
                      i -= 2;
                  }
                  i += 2;
              }
              return this;
          }
  
          public final Builder set(String name, String value) {
              Intrinsics.checkNotNullParameter(name, "name");
              Intrinsics.checkNotNullParameter(value, "value");
              Builder builder = this;
              Headers.Companion.checkName(name);
              Headers.Companion.checkValue(value, name);
              builder.removeAll(name);
              builder.addLenient$okhttp(name, value);
              return this;
          }
  
          public final Builder set(String name, Instant value) {
              Intrinsics.checkNotNullParameter(name, "name");
              Intrinsics.checkNotNullParameter(value, "value");
              return set(name, new Date(value.toEpochMilli()));
          }
  
          public final Builder set(String name, Date value) {
              Intrinsics.checkNotNullParameter(name, "name");
              Intrinsics.checkNotNullParameter(value, "value");
              String httpDateString = DatesKt.toHttpDateString(value);
              Log1F380D.a((Object) httpDateString);
              set(name, httpDateString);
              return this;
          }
      }
  
      @Metadata(bv = {1, 0, 3}, d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0010\u0011\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010$\n\u0002\b\u0002\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0002J\u0018\u0010\u0007\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u00062\u0006\u0010\u0005\u001a\u00020\u0006H\u0002J%\u0010\t\u001a\u0004\u0018\u00010\u00062\f\u0010\n\u001a\b\u0012\u0004\u0012\u00020\u00060\u000b2\u0006\u0010\u0005\u001a\u00020\u0006H\u0002¢\u0006\u0002\u0010\fJ#\u0010\r\u001a\u00020\u000e2\u0012\u0010\n\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00060\u000b\"\u00020\u0006H\u0007¢\u0006\u0004\b\u000f\u0010\u0010J#\u0010\u000f\u001a\u00020\u000e2\u0012\u0010\n\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00060\u000b\"\u00020\u0006H\u0007¢\u0006\u0004\b\u0011\u0010\u0010J!\u0010\u000f\u001a\u00020\u000e2\u0012\u0010\u0012\u001a\u000e\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00060\u0013H\u0007¢\u0006\u0002\b\u0011J\u001d\u0010\u0014\u001a\u00020\u000e*\u000e\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00060\u0013H\u0007¢\u0006\u0002\b\u000f¨\u0006\u0015"}, d2 = {"Lokhttp3/Headers$Companion;", "", "()V", "checkName", "", "name", "", "checkValue", "value", "get", "namesAndValues", "", "([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "headersOf", "Lokhttp3/Headers;", "of", "([Ljava/lang/String;)Lokhttp3/Headers;", "-deprecated_of", "headers", "", "toHeaders", "okhttp"}, k = 1, mv = {1, 4, 0})
      /* compiled from: 01BB */
      public static final class Companion {
          private Companion() {
          }
  
          public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
              this();
          }
  
          /* access modifiers changed from: private */
          public final void checkName(String name) {
              if (name.length() > 0) {
                  int length = name.length();
                  int i = 0;
                  while (i < length) {
                      char charAt = name.charAt(i);
                      if ('!' <= charAt && '~' >= charAt) {
                          i++;
                      } else {
                          String format = Util.format("Unexpected char %#04x at %d in header name: %s", Integer.valueOf(charAt), Integer.valueOf(i), name);
                          Log1F380D.a((Object) format);
                          throw new IllegalArgumentException(format.toString());
                      }
                  }
                  return;
              }
              throw new IllegalArgumentException("name is empty".toString());
          }
  
          /* access modifiers changed from: private */
          public final String get(String[] namesAndValues, String name) {
              IntProgression step = RangesKt.step(RangesKt.downTo(namesAndValues.length - 2, 0), 2);
              int first = step.getFirst();
              int last = step.getLast();
              int step2 = step.getStep();
              if (step2 >= 0) {
                  if (first > last) {
                      return null;
                  }
              } else if (first < last) {
                  return null;
              }
              while (!StringsKt.equals(name, namesAndValues[first], true)) {
                  if (first == last) {
                      return null;
                  }
                  first += step2;
              }
              return namesAndValues[first + 1];
          }
  
          @Deprecated(level = DeprecationLevel.ERROR, message = "function moved to extension", replaceWith = @ReplaceWith(expression = "headers.toHeaders()", imports = {}))
          /* renamed from: -deprecated_of  reason: not valid java name */
          public final Headers m1639deprecated_of(Map<String, String> headers) {
              Intrinsics.checkNotNullParameter(headers, "headers");
              return of(headers);
          }
  
          @Deprecated(level = DeprecationLevel.ERROR, message = "function name changed", replaceWith = @ReplaceWith(expression = "headersOf(*namesAndValues)", imports = {}))
          /* renamed from: -deprecated_of  reason: not valid java name */
          public final Headers m1640deprecated_of(String... namesAndValues) {
              Intrinsics.checkNotNullParameter(namesAndValues, "namesAndValues");
              return of((String[]) Arrays.copyOf(namesAndValues, namesAndValues.length));
          }
  
          @JvmStatic
          public final Headers of(Map<String, String> $this$toHeaders) {
              Intrinsics.checkNotNullParameter($this$toHeaders, "$this$toHeaders");
              String[] strArr = new String[($this$toHeaders.size() * 2)];
              int i = 0;
              for (Map.Entry next : $this$toHeaders.entrySet()) {
                  String str = (String) next.getKey();
                  String str2 = (String) next.getValue();
                  if (str != null) {
                      String obj = StringsKt.trim((CharSequence) str).toString();
                      if (str2 != null) {
                          String obj2 = StringsKt.trim((CharSequence) str2).toString();
                          checkName(obj);
                          checkValue(obj2, obj);
                          strArr[i] = obj;
                          strArr[i + 1] = obj2;
                          i += 2;
                      } else {
                          throw new NullPointerException("null cannot be cast to non-null type kotlin.CharSequence");
                      }
                  } else {
                      throw new NullPointerException("null cannot be cast to non-null type kotlin.CharSequence");
                  }
              }
              return new Headers(strArr, (DefaultConstructorMarker) null);
          }
  
          @JvmStatic
          public final Headers of(String... namesAndValues) {
              Intrinsics.checkNotNullParameter(namesAndValues, "namesAndValues");
              if (namesAndValues.length % 2 == 0) {
                  Object clone = namesAndValues.clone();
                  if (clone != null) {
                      String[] strArr = (String[]) clone;
                      int length = strArr.length;
                      int i = 0;
                      while (i < length) {
                          if (strArr[i] != null) {
                              String str = strArr[i];
                              if (str != null) {
                                  strArr[i] = StringsKt.trim((CharSequence) str).toString();
                                  i++;
                              } else {
                                  throw new NullPointerException("null cannot be cast to non-null type kotlin.CharSequence");
                              }
                          } else {
                              throw new IllegalArgumentException("Headers cannot be null".toString());
                          }
                      }
                      IntProgression step = RangesKt.step((IntProgression) RangesKt.until(0, strArr.length), 2);
                      int first = step.getFirst();
                      int last = step.getLast();
                      int step2 = step.getStep();
                      if (step2 < 0 ? first >= last : first <= last) {
                          while (true) {
                              String str2 = strArr[first];
                              String str3 = strArr[first + 1];
                              checkName(str2);
                              checkValue(str3, str2);
                              if (first == last) {
                                  break;
                              }
                              first += step2;
                          }
                      }
                      return new Headers(strArr, (DefaultConstructorMarker) null);
                  }
                  throw new NullPointerException("null cannot be cast to non-null type kotlin.Array<kotlin.String>");
              }
              throw new IllegalArgumentException("Expected alternating header names and values".toString());
          }
  
          /* access modifiers changed from: private */
          public final void checkValue(String value, String name) {
              int length = value.length();
              int i = 0;
              while (i < length) {
                  char charAt = value.charAt(i);
                  if (charAt == 9 || (' ' <= charAt && '~' >= charAt)) {
                      i++;
                  } else {
                      String format = Util.format("Unexpected char %#04x at %d in %s value: %s", Integer.valueOf(charAt), Integer.valueOf(i), name, value);
                      Log1F380D.a((Object) format);
                      throw new IllegalArgumentException(format.toString());
                  }
              }
          }
      }
  
      private Headers(String[] namesAndValues2) {
          this.namesAndValues = namesAndValues2;
      }
  
      public /* synthetic */ Headers(String[] namesAndValues2, DefaultConstructorMarker $constructor_marker) {
          this(namesAndValues2);
      }
  
      @JvmStatic
      public static final Headers of(Map<String, String> map) {
          return Companion.of(map);
      }
  
      @JvmStatic
      public static final Headers of(String... strArr) {
          return Companion.of(strArr);
      }
  
      @Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "size", imports = {}))
      /* renamed from: -deprecated_size  reason: not valid java name */
      public final int m1638deprecated_size() {
          return size();
      }
  
      public final long byteCount() {
          String[] strArr = this.namesAndValues;
          long length = (long) (strArr.length * 2);
          int length2 = strArr.length;
          for (int i = 0; i < length2; i++) {
              length += (long) this.namesAndValues[i].length();
          }
          return length;
      }
  
      public boolean equals(Object other) {
          return (other instanceof Headers) && Arrays.equals(this.namesAndValues, ((Headers) other).namesAndValues);
      }
  
      public final String get(String name) {
          Intrinsics.checkNotNullParameter(name, "name");
          String access$get = Companion.get(this.namesAndValues, name);
          Log1F380D.a((Object) access$get);
          return access$get;
      }
  
      public final Date getDate(String name) {
          Intrinsics.checkNotNullParameter(name, "name");
          String str = get(name);
          if (str != null) {
              return DatesKt.toHttpDateOrNull(str);
          }
          return null;
      }
  
      public final Instant getInstant(String name) {
          Intrinsics.checkNotNullParameter(name, "name");
          Date date = getDate(name);
          if (date != null) {
              return date.toInstant();
          }
          return null;
      }
  
      public int hashCode() {
          return Arrays.hashCode(this.namesAndValues);
      }
  
      public Iterator<Pair<String, String>> iterator() {
          int size = size();
          Pair[] pairArr = new Pair[size];
          for (int i = 0; i < size; i++) {
              int i2 = i;
              pairArr[i] = TuplesKt.to(name(i2), value(i2));
          }
          return ArrayIteratorKt.iterator(pairArr);
      }
  
      public final String name(int index) {
          return this.namesAndValues[index * 2];
      }
  
      public final Set<String> names() {
          TreeSet treeSet = new TreeSet(StringsKt.getCASE_INSENSITIVE_ORDER(StringCompanionObject.INSTANCE));
          int size = size();
          for (int i = 0; i < size; i++) {
              treeSet.add(name(i));
          }
          Set<String> unmodifiableSet = Collections.unmodifiableSet(treeSet);
          Intrinsics.checkNotNullExpressionValue(unmodifiableSet, "Collections.unmodifiableSet(result)");
          return unmodifiableSet;
      }
  
      public final Builder newBuilder() {
          Builder builder = new Builder();
          CollectionsKt.addAll(builder.getNamesAndValues$okhttp(), (T[]) this.namesAndValues);
          return builder;
      }
  
      public final int size() {
          return this.namesAndValues.length / 2;
      }
  
      public final Map<String, List<String>> toMultimap() {
          TreeMap treeMap = new TreeMap(StringsKt.getCASE_INSENSITIVE_ORDER(StringCompanionObject.INSTANCE));
          int size = size();
          int i = 0;
          while (i < size) {
              String name = name(i);
              Locale locale = Locale.US;
              Intrinsics.checkNotNullExpressionValue(locale, "Locale.US");
              if (name != null) {
                  String lowerCase = name.toLowerCase(locale);
                  Intrinsics.checkNotNullExpressionValue(lowerCase, "(this as java.lang.String).toLowerCase(locale)");
                  List list = (List) treeMap.get(lowerCase);
                  if (list == null) {
                      list = new ArrayList(2);
                      treeMap.put(lowerCase, list);
                  }
                  list.add(value(i));
                  i++;
              } else {
                  throw new NullPointerException("null cannot be cast to non-null type java.lang.String");
              }
          }
          return treeMap;
      }
  
      public String toString() {
          StringBuilder sb = new StringBuilder();
          StringBuilder sb2 = sb;
          int size = size();
          for (int i = 0; i < size; i++) {
              sb2.append(name(i));
              sb2.append(": ");
              sb2.append(value(i));
              sb2.append("\n");
          }
          String sb3 = sb.toString();
          Intrinsics.checkNotNullExpressionValue(sb3, "StringBuilder().apply(builderAction).toString()");
          return sb3;
      }
  
      public final String value(int index) {
          return this.namesAndValues[(index * 2) + 1];
      }
  
      public final List<String> values(String name) {
          Intrinsics.checkNotNullParameter(name, "name");
          List list = null;
          int size = size();
          for (int i = 0; i < size; i++) {
              if (StringsKt.equals(name, name(i), true)) {
                  if (list == null) {
                      list = new ArrayList(2);
                  }
                  list.add(value(i));
              }
          }
          if (list == null) {
              return CollectionsKt.emptyList();
          }
          List<String> unmodifiableList = Collections.unmodifiableList(list);
          Intrinsics.checkNotNullExpressionValue(unmodifiableList, "Collections.unmodifiableList(result)");
          return unmodifiableList;
      }
  }
  