(function (_, kotlin_kotlin, kotlin_io_ktor_ktor_utils, kotlin_io_ktor_ktor_client_core, kotlin_io_ktor_ktor_http, kotlin_io_ktor_ktor_serialization, kotlin_io_ktor_ktor_io) {
  'use strict';
  //region block: imports
  var protoOf = kotlin_kotlin.$_$.uc;
  var classMeta = kotlin_kotlin.$_$.jb;
  var setMetadataFor = kotlin_kotlin.$_$.vc;
  var VOID = kotlin_kotlin.$_$.f;
  var CoroutineImpl = kotlin_kotlin.$_$.ta;
  var Unit_instance = kotlin_kotlin.$_$.m5;
  var THROW_CCE = kotlin_kotlin.$_$.ci;
  var PipelineContext = kotlin_io_ktor_ktor_utils.$_$.g;
  var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.fa;
  var HttpResponseContainer = kotlin_io_ktor_ktor_client_core.$_$.o;
  var contentType = kotlin_io_ktor_ktor_http.$_$.c1;
  var suitableCharset = kotlin_io_ktor_ktor_serialization.$_$.f;
  var plus = kotlin_kotlin.$_$.t8;
  var toMutableSet = kotlin_kotlin.$_$.x9;
  var ArrayList_init_$Create$ = kotlin_kotlin.$_$.m;
  var Application_getInstance = kotlin_io_ktor_ktor_http.$_$.b;
  var register$default = kotlin_io_ktor_ktor_serialization.$_$.b;
  var Configuration = kotlin_io_ktor_ktor_serialization.$_$.c;
  var AttributeKey = kotlin_io_ktor_ktor_utils.$_$.l;
  var Phases_getInstance = kotlin_io_ktor_ktor_client_core.$_$.d;
  var Phases_getInstance_0 = kotlin_io_ktor_ktor_client_core.$_$.e;
  var HttpClientPlugin = kotlin_io_ktor_ktor_client_core.$_$.g;
  var objectMeta = kotlin_kotlin.$_$.tc;
  var toString = kotlin_kotlin.$_$.zc;
  var HttpHeaders_getInstance = kotlin_io_ktor_ktor_http.$_$.f;
  var accept = kotlin_io_ktor_ktor_client_core.$_$.k;
  var Collection = kotlin_kotlin.$_$.p5;
  var isInterface = kotlin_kotlin.$_$.ec;
  var OutgoingContent = kotlin_io_ktor_ktor_http.$_$.p;
  var getKClassFromExpression = kotlin_kotlin.$_$.d;
  var contentType_0 = kotlin_io_ktor_ktor_http.$_$.a1;
  var EmptyContent_getInstance = kotlin_io_ktor_ktor_client_core.$_$.f;
  var Unit = kotlin_kotlin.$_$.oi;
  var charset = kotlin_io_ktor_ktor_http.$_$.y;
  var Charsets_getInstance = kotlin_io_ktor_ktor_io.$_$.f;
  var ensureNotNull = kotlin_kotlin.$_$.ui;
  var NullBody_instance = kotlin_io_ktor_ktor_http.$_$.a;
  var equals = kotlin_kotlin.$_$.mb;
  var joinToString = kotlin_kotlin.$_$.z7;
  var ByteReadChannel = kotlin_io_ktor_ktor_io.$_$.f1;
  var collectionSizeOrDefault = kotlin_kotlin.$_$.n6;
  var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.l;
  var deserialize = kotlin_io_ktor_ktor_serialization.$_$.a;
  var Exception = kotlin_kotlin.$_$.rh;
  var Exception_init_$Init$ = kotlin_kotlin.$_$.m1;
  var captureStack = kotlin_kotlin.$_$.db;
  var KtorSimpleLogger = kotlin_io_ktor_ktor_utils.$_$.f;
  var PrimitiveClasses_getInstance = kotlin_kotlin.$_$.c5;
  var HttpStatusCode = kotlin_io_ktor_ktor_http.$_$.s;
  var getKClass = kotlin_kotlin.$_$.e;
  var setOf = kotlin_kotlin.$_$.i9;
  var endsWith = kotlin_kotlin.$_$.ve;
  var startsWith = kotlin_kotlin.$_$.wf;
  var LinkedHashSet_init_$Create$ = kotlin_kotlin.$_$.x;
  //endregion
  //region block: pre-declaration
  setMetadataFor(ConverterRegistration, 'ConverterRegistration', classMeta);
  setMetadataFor(ContentNegotiation$Config$defaultMatcher$1, VOID, classMeta);
  setMetadataFor(ContentNegotiation$Plugin$install$slambda, 'ContentNegotiation$Plugin$install$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [2]);
  setMetadataFor(ContentNegotiation$Plugin$install$slambda_1, 'ContentNegotiation$Plugin$install$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [2]);
  setMetadataFor(Config, 'Config', classMeta, VOID, [Configuration], Config);
  setMetadataFor(Plugin, 'Plugin', objectMeta, VOID, [HttpClientPlugin]);
  setMetadataFor($convertRequestCOROUTINE$0, '$convertRequestCOROUTINE$0', classMeta, CoroutineImpl);
  setMetadataFor($convertResponseCOROUTINE$1, '$convertResponseCOROUTINE$1', classMeta, CoroutineImpl);
  setMetadataFor(ContentNegotiation, 'ContentNegotiation', classMeta, VOID, VOID, VOID, VOID, VOID, [2, 5]);
  setMetadataFor(ContentConverterException, 'ContentConverterException', classMeta, Exception);
  setMetadataFor(JsonContentTypeMatcher, 'JsonContentTypeMatcher', objectMeta);
  //endregion
  function get_LOGGER() {
    _init_properties_ContentNegotiation_kt__o183go();
    return LOGGER;
  }
  var LOGGER;
  function get_DefaultCommonIgnoredTypes() {
    _init_properties_ContentNegotiation_kt__o183go();
    return DefaultCommonIgnoredTypes;
  }
  var DefaultCommonIgnoredTypes;
  function ConverterRegistration(converter, contentTypeToSend, contentTypeMatcher) {
    this.r4z_1 = converter;
    this.s4z_1 = contentTypeToSend;
    this.t4z_1 = contentTypeMatcher;
  }
  function defaultMatcher($this, pattern) {
    return new ContentNegotiation$Config$defaultMatcher$1(pattern);
  }
  function ContentNegotiation$Config$defaultMatcher$1($pattern) {
    this.u4z_1 = $pattern;
  }
  protoOf(ContentNegotiation$Config$defaultMatcher$1).v4z = function (contentType) {
    return contentType.p2s(this.u4z_1);
  };
  function ContentNegotiation$Plugin$install$slambda($plugin, resultContinuation) {
    this.e50_1 = $plugin;
    CoroutineImpl.call(this, resultContinuation);
  }
  protoOf(ContentNegotiation$Plugin$install$slambda).c37 = function ($this$intercept, it, $completion) {
    var tmp = this.d37($this$intercept, it, $completion);
    tmp.jd_1 = Unit_instance;
    tmp.kd_1 = null;
    return tmp.ud();
  };
  protoOf(ContentNegotiation$Plugin$install$slambda).um = function (p1, p2, $completion) {
    var tmp = p1 instanceof PipelineContext ? p1 : THROW_CCE();
    return this.c37(tmp, !(p2 == null) ? p2 : THROW_CCE(), $completion);
  };
  protoOf(ContentNegotiation$Plugin$install$slambda).ud = function () {
    var suspendResult = this.jd_1;
    $sm: do
      try {
        var tmp = this.hd_1;
        switch (tmp) {
          case 0:
            this.id_1 = 3;
            this.hd_1 = 1;
            suspendResult = this.e50_1.l50(this.f50_1.z2p_1, this.f50_1.c2p(), this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            this.h50_1 = suspendResult;
            var tmp_0 = this;
            var tmp_1;
            if (this.h50_1 == null) {
              return Unit_instance;
            } else {
              tmp_1 = this.h50_1;
            }

            tmp_0.i50_1 = tmp_1;
            this.hd_1 = 2;
            suspendResult = this.f50_1.d2p(this.i50_1, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 2:
            return Unit_instance;
          case 3:
            throw this.kd_1;
        }
      } catch ($p) {
        var e = $p;
        if (this.id_1 === 3) {
          throw e;
        } else {
          this.hd_1 = this.id_1;
          this.kd_1 = e;
        }
      }
     while (true);
  };
  protoOf(ContentNegotiation$Plugin$install$slambda).d37 = function ($this$intercept, it, completion) {
    var i = new ContentNegotiation$Plugin$install$slambda(this.e50_1, completion);
    i.f50_1 = $this$intercept;
    i.g50_1 = it;
    return i;
  };
  function ContentNegotiation$Plugin$install$slambda_0($plugin, resultContinuation) {
    var i = new ContentNegotiation$Plugin$install$slambda($plugin, resultContinuation);
    var l = function ($this$intercept, it, $completion) {
      return i.c37($this$intercept, it, $completion);
    };
    l.$arity = 2;
    return l;
  }
  function ContentNegotiation$Plugin$install$slambda_1($plugin, resultContinuation) {
    this.u50_1 = $plugin;
    CoroutineImpl.call(this, resultContinuation);
  }
  protoOf(ContentNegotiation$Plugin$install$slambda_1).w37 = function ($this$intercept, _name_for_destructuring_parameter_0__wldtmu, $completion) {
    var tmp = this.x37($this$intercept, _name_for_destructuring_parameter_0__wldtmu, $completion);
    tmp.jd_1 = Unit_instance;
    tmp.kd_1 = null;
    return tmp.ud();
  };
  protoOf(ContentNegotiation$Plugin$install$slambda_1).um = function (p1, p2, $completion) {
    var tmp = p1 instanceof PipelineContext ? p1 : THROW_CCE();
    return this.w37(tmp, p2 instanceof HttpResponseContainer ? p2 : THROW_CCE(), $completion);
  };
  protoOf(ContentNegotiation$Plugin$install$slambda_1).ud = function () {
    var suspendResult = this.jd_1;
    $sm: do
      try {
        var tmp = this.hd_1;
        switch (tmp) {
          case 0:
            this.id_1 = 3;
            this.x50_1 = this.w50_1.y6();
            this.y50_1 = this.w50_1.z6();
            var tmp_0 = this;
            var tmp0_elvis_lhs = contentType(this.v50_1.z2p_1.j37());
            var tmp_1;
            if (tmp0_elvis_lhs == null) {
              this.v50_1;
              get_LOGGER().u2q('Response doesn\'t have "Content-Type" header, skipping ContentNegotiation plugin');
              return Unit_instance;
            } else {
              tmp_1 = tmp0_elvis_lhs;
            }

            tmp_0.z50_1 = tmp_1;
            this.a51_1 = suitableCharset(this.v50_1.z2p_1.s3a().x2w());
            this.hd_1 = 1;
            suspendResult = this.u50_1.e51(this.v50_1.z2p_1.s3a().v3a(), this.x50_1, this.y50_1, this.z50_1, this.a51_1, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            this.b51_1 = suspendResult;
            var tmp_2 = this;
            var tmp_3;
            if (this.b51_1 == null) {
              return Unit_instance;
            } else {
              tmp_3 = this.b51_1;
            }

            tmp_2.c51_1 = tmp_3;
            this.d51_1 = new HttpResponseContainer(this.x50_1, this.c51_1);
            this.hd_1 = 2;
            suspendResult = this.v50_1.d2p(this.d51_1, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 2:
            return Unit_instance;
          case 3:
            throw this.kd_1;
        }
      } catch ($p) {
        var e = $p;
        if (this.id_1 === 3) {
          throw e;
        } else {
          this.hd_1 = this.id_1;
          this.kd_1 = e;
        }
      }
     while (true);
  };
  protoOf(ContentNegotiation$Plugin$install$slambda_1).x37 = function ($this$intercept, _name_for_destructuring_parameter_0__wldtmu, completion) {
    var i = new ContentNegotiation$Plugin$install$slambda_1(this.u50_1, completion);
    i.v50_1 = $this$intercept;
    i.w50_1 = _name_for_destructuring_parameter_0__wldtmu;
    return i;
  };
  function ContentNegotiation$Plugin$install$slambda_2($plugin, resultContinuation) {
    var i = new ContentNegotiation$Plugin$install$slambda_1($plugin, resultContinuation);
    var l = function ($this$intercept, _name_for_destructuring_parameter_0__wldtmu, $completion) {
      return i.w37($this$intercept, _name_for_destructuring_parameter_0__wldtmu, $completion);
    };
    l.$arity = 2;
    return l;
  }
  function Config() {
    this.f51_1 = toMutableSet(plus(get_DefaultIgnoredTypes(), get_DefaultCommonIgnoredTypes()));
    var tmp = this;
    // Inline function 'kotlin.collections.mutableListOf' call
    tmp.g51_1 = ArrayList_init_$Create$();
  }
  protoOf(Config).p33 = function (contentType, converter, configuration) {
    var matcher = contentType.equals(Application_getInstance().i2r_1) ? JsonContentTypeMatcher_instance : defaultMatcher(this, contentType);
    this.h51(contentType, converter, matcher, configuration);
  };
  protoOf(Config).h51 = function (contentTypeToSend, converter, contentTypeMatcher, configuration) {
    // Inline function 'kotlin.apply' call
    // Inline function 'kotlin.contracts.contract' call
    configuration(converter);
    var registration = new ConverterRegistration(converter, contentTypeToSend, contentTypeMatcher);
    this.g51_1.i1(registration);
  };
  function Plugin() {
    Plugin_instance = this;
    this.i51_1 = new AttributeKey('ContentNegotiation');
  }
  protoOf(Plugin).s2 = function () {
    return this.i51_1;
  };
  protoOf(Plugin).j51 = function (block) {
    // Inline function 'kotlin.apply' call
    var this_0 = new Config();
    // Inline function 'kotlin.contracts.contract' call
    block(this_0);
    var config = this_0;
    return new ContentNegotiation(config.g51_1, config.f51_1);
  };
  protoOf(Plugin).n39 = function (block) {
    return this.j51(block);
  };
  protoOf(Plugin).k51 = function (plugin, scope) {
    var tmp = Phases_getInstance().i3f_1;
    scope.i36_1.d2q(tmp, ContentNegotiation$Plugin$install$slambda_0(plugin, null));
    var tmp_0 = Phases_getInstance_0().i39_1;
    scope.j36_1.d2q(tmp_0, ContentNegotiation$Plugin$install$slambda_2(plugin, null));
  };
  protoOf(Plugin).o39 = function (plugin, scope) {
    return this.k51(plugin instanceof ContentNegotiation ? plugin : THROW_CCE(), scope);
  };
  var Plugin_instance;
  function Plugin_getInstance() {
    if (Plugin_instance == null)
      new Plugin();
    return Plugin_instance;
  }
  function ContentNegotiation$convertRequest$lambda(it) {
    return toString(it.r4z_1);
  }
  function $convertRequestCOROUTINE$0(_this__u8e3s4, request, body, resultContinuation) {
    CoroutineImpl.call(this, resultContinuation);
    this.t51_1 = _this__u8e3s4;
    this.u51_1 = request;
    this.v51_1 = body;
  }
  protoOf($convertRequestCOROUTINE$0).ud = function () {
    var suspendResult = this.jd_1;
    $sm: do
      try {
        var tmp = this.hd_1;
        switch (tmp) {
          case 0:
            this.id_1 = 7;
            var tmp0_iterator = this.t51_1.j50_1.w();
            while (tmp0_iterator.f()) {
              var element = tmp0_iterator.e();
              l$ret$1: do {
                get_LOGGER().u2q('Adding Accept=' + element.s4z_1.l2s_1 + ' header for ' + this.u51_1.i38_1);
                if (this.u51_1.k38_1.i2n(HttpHeaders_getInstance().u2s_1, element.s4z_1.toString())) {
                  break l$ret$1;
                }
                accept(this.u51_1, element.s4z_1);
              }
               while (false);
            }

            var tmp_0;
            var tmp_1 = this.v51_1;
            if (tmp_1 instanceof OutgoingContent) {
              tmp_0 = true;
            } else {
              var tmp$ret$2;
              l$ret$3: do {
                var this_0 = this.t51_1.k50_1;
                var tmp_2;
                if (isInterface(this_0, Collection)) {
                  tmp_2 = this_0.c1();
                } else {
                  tmp_2 = false;
                }
                if (tmp_2) {
                  tmp$ret$2 = false;
                  break l$ret$3;
                }
                var tmp0_iterator_0 = this_0.w();
                while (tmp0_iterator_0.f()) {
                  var element_0 = tmp0_iterator_0.e();
                  if (element_0.g7(this.v51_1)) {
                    tmp$ret$2 = true;
                    break l$ret$3;
                  }
                }
                tmp$ret$2 = false;
              }
               while (false);
              tmp_0 = tmp$ret$2;
            }

            if (tmp_0) {
              get_LOGGER().u2q('Body type ' + getKClassFromExpression(this.v51_1) + ' is in ignored types. ' + ('Skipping ContentNegotiation for ' + this.u51_1.i38_1 + '.'));
              return null;
            }

            var tmp_3 = this;
            var tmp0_elvis_lhs = contentType_0(this.u51_1);
            var tmp_4;
            if (tmp0_elvis_lhs == null) {
              this.t51_1;
              get_LOGGER().u2q("Request doesn't have Content-Type header. Skipping ContentNegotiation for " + this.u51_1.i38_1 + '.');
              return null;
            } else {
              tmp_4 = tmp0_elvis_lhs;
            }

            tmp_3.w51_1 = tmp_4;
            var tmp_5 = this.v51_1;
            if (tmp_5 instanceof Unit) {
              get_LOGGER().u2q('Sending empty body for ' + this.u51_1.i38_1);
              this.u51_1.k38_1.n2n(HttpHeaders_getInstance().m2t_1);
              return EmptyContent_getInstance();
            }

            var tmp_6 = this;
            var this_1 = this.t51_1.j50_1;
            var destination = ArrayList_init_$Create$();
            var tmp0_iterator_1 = this_1.w();
            while (tmp0_iterator_1.f()) {
              var element_1 = tmp0_iterator_1.e();
              if (element_1.t4z_1.v4z(this.w51_1)) {
                destination.i1(element_1);
              }
            }

            var tmp_7;
            if (!destination.c1()) {
              tmp_7 = destination;
            } else {
              tmp_7 = null;
            }

            var tmp1_elvis_lhs = tmp_7;
            var tmp_8;
            if (tmp1_elvis_lhs == null) {
              this.t51_1;
              get_LOGGER().u2q('None of the registered converters match request Content-Type=' + this.w51_1 + '. ' + ('Skipping ContentNegotiation for ' + this.u51_1.i38_1 + '.'));
              return null;
            } else {
              tmp_8 = tmp1_elvis_lhs;
            }

            tmp_6.x51_1 = tmp_8;
            if (this.u51_1.n3u() == null) {
              get_LOGGER().u2q('Request has unknown body type. Skipping ContentNegotiation for ' + this.u51_1.i38_1 + '.');
              return null;
            }

            this.u51_1.k38_1.n2n(HttpHeaders_getInstance().m2t_1);
            this.hd_1 = 1;
            continue $sm;
          case 1:
            var tmp_9 = this;
            tmp_9.z51_1 = this.x51_1;
            this.a52_1 = this.z51_1.w();
            this.hd_1 = 2;
            continue $sm;
          case 2:
            if (!this.a52_1.f()) {
              this.hd_1 = 5;
              continue $sm;
            }

            this.b52_1 = this.a52_1.e();
            var tmp_10 = this;
            tmp_10.c52_1 = this.b52_1;
            this.hd_1 = 3;
            var tmp0_elvis_lhs_0 = charset(this.w51_1);
            var tmp_11 = tmp0_elvis_lhs_0 == null ? Charsets_getInstance().m2h_1 : tmp0_elvis_lhs_0;
            var tmp_12 = ensureNotNull(this.u51_1.n3u());
            var this_2 = this.v51_1;
            var tmp_13;
            if (!equals(this_2, NullBody_instance)) {
              tmp_13 = this_2;
            } else {
              tmp_13 = null;
            }

            suspendResult = this.c52_1.r4z_1.s33(this.w51_1, tmp_11, tmp_12, tmp_13, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 3:
            var result = suspendResult;
            if (!(result == null)) {
              get_LOGGER().u2q('Converted request body using ' + this.c52_1.r4z_1 + ' for ' + this.u51_1.i38_1);
            }

            var result_0 = result;
            if (!(result_0 == null)) {
              this.y51_1 = result_0;
              this.hd_1 = 6;
              continue $sm;
            } else {
              this.hd_1 = 4;
              continue $sm;
            }

          case 4:
            this.hd_1 = 2;
            continue $sm;
          case 5:
            this.y51_1 = null;
            if (false) {
              this.hd_1 = 1;
              continue $sm;
            }

            this.hd_1 = 6;
            continue $sm;
          case 6:
            var tmp2_elvis_lhs = this.y51_1;
            var tmp_14;
            if (tmp2_elvis_lhs == null) {
              var tmp_15 = "Can't convert " + toString(this.v51_1) + ' with contentType ' + this.w51_1 + ' using converters ';
              throw new ContentConverterException(tmp_15 + joinToString(this.x51_1, VOID, VOID, VOID, VOID, VOID, ContentNegotiation$convertRequest$lambda));
            } else {
              tmp_14 = tmp2_elvis_lhs;
            }

            var serializedContent = tmp_14;
            return serializedContent;
          case 7:
            throw this.kd_1;
        }
      } catch ($p) {
        var e = $p;
        if (this.id_1 === 7) {
          throw e;
        } else {
          this.hd_1 = this.id_1;
          this.kd_1 = e;
        }
      }
     while (true);
  };
  function $convertResponseCOROUTINE$1(_this__u8e3s4, requestUrl, info, body, responseContentType, charset, resultContinuation) {
    CoroutineImpl.call(this, resultContinuation);
    this.l52_1 = _this__u8e3s4;
    this.m52_1 = requestUrl;
    this.n52_1 = info;
    this.o52_1 = body;
    this.p52_1 = responseContentType;
    this.q52_1 = charset;
  }
  protoOf($convertResponseCOROUTINE$1).ud = function () {
    var suspendResult = this.jd_1;
    $sm: do
      try {
        var tmp = this.hd_1;
        switch (tmp) {
          case 0:
            this.id_1 = 2;
            var tmp_0 = this.o52_1;
            if (!isInterface(tmp_0, ByteReadChannel)) {
              get_LOGGER().u2q('Response body is already transformed. Skipping ContentNegotiation for ' + this.m52_1 + '.');
              return null;
            }

            if (this.l52_1.k50_1.a1(this.n52_1.p2q_1)) {
              get_LOGGER().u2q('Response body type ' + this.n52_1.p2q_1 + ' is in ignored types. ' + ('Skipping ContentNegotiation for ' + this.m52_1 + '.'));
              return null;
            }

            var tmp_1 = this;
            var this_0 = this.l52_1.j50_1;
            var destination = ArrayList_init_$Create$();
            var tmp0_iterator = this_0.w();
            while (tmp0_iterator.f()) {
              var element = tmp0_iterator.e();
              if (element.t4z_1.v4z(this.p52_1)) {
                destination.i1(element);
              }
            }

            var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
            var tmp0_iterator_0 = destination.w();
            while (tmp0_iterator_0.f()) {
              var item = tmp0_iterator_0.e();
              destination_0.i1(item.r4z_1);
            }

            var tmp_2;
            if (!destination_0.c1()) {
              tmp_2 = destination_0;
            } else {
              tmp_2 = null;
            }

            var tmp0_elvis_lhs = tmp_2;
            var tmp_3;
            if (tmp0_elvis_lhs == null) {
              this.l52_1;
              get_LOGGER().u2q('None of the registered converters match response with Content-Type=' + this.p52_1 + '. ' + ('Skipping ContentNegotiation for ' + this.m52_1 + '.'));
              return null;
            } else {
              tmp_3 = tmp0_elvis_lhs;
            }

            tmp_1.r52_1 = tmp_3;
            this.hd_1 = 1;
            suspendResult = deserialize(this.r52_1, this.o52_1, this.n52_1, this.q52_1, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            var result = suspendResult;
            if (!isInterface(result, ByteReadChannel)) {
              get_LOGGER().u2q('Response body was converted to ' + getKClassFromExpression(result) + ' for ' + this.m52_1 + '.');
            }

            return result;
          case 2:
            throw this.kd_1;
        }
      } catch ($p) {
        var e = $p;
        if (this.id_1 === 2) {
          throw e;
        } else {
          this.hd_1 = this.id_1;
          this.kd_1 = e;
        }
      }
     while (true);
  };
  function ContentNegotiation(registrations, ignoredTypes) {
    Plugin_getInstance();
    this.j50_1 = registrations;
    this.k50_1 = ignoredTypes;
  }
  protoOf(ContentNegotiation).l50 = function (request, body, $completion) {
    var tmp = new $convertRequestCOROUTINE$0(this, request, body, $completion);
    tmp.jd_1 = Unit_instance;
    tmp.kd_1 = null;
    return tmp.ud();
  };
  protoOf(ContentNegotiation).e51 = function (requestUrl, info, body, responseContentType, charset, $completion) {
    var tmp = new $convertResponseCOROUTINE$1(this, requestUrl, info, body, responseContentType, charset, $completion);
    tmp.jd_1 = Unit_instance;
    tmp.kd_1 = null;
    return tmp.ud();
  };
  function ContentConverterException(message) {
    Exception_init_$Init$(message, this);
    captureStack(this, ContentConverterException);
  }
  var properties_initialized_ContentNegotiation_kt_1ayduy;
  function _init_properties_ContentNegotiation_kt__o183go() {
    if (!properties_initialized_ContentNegotiation_kt_1ayduy) {
      properties_initialized_ContentNegotiation_kt_1ayduy = true;
      LOGGER = KtorSimpleLogger('io.ktor.client.plugins.contentnegotiation.ContentNegotiation');
      DefaultCommonIgnoredTypes = setOf([PrimitiveClasses_getInstance().k8(), PrimitiveClasses_getInstance().g8(), getKClass(HttpStatusCode), getKClass(ByteReadChannel), getKClass(OutgoingContent)]);
    }
  }
  function JsonContentTypeMatcher() {
  }
  protoOf(JsonContentTypeMatcher).v4z = function (contentType) {
    if (contentType.p2s(Application_getInstance().i2r_1)) {
      return true;
    }
    var value = contentType.o2s().toString();
    return startsWith(value, 'application/') ? endsWith(value, '+json') : false;
  };
  var JsonContentTypeMatcher_instance;
  function JsonContentTypeMatcher_getInstance() {
    return JsonContentTypeMatcher_instance;
  }
  function get_DefaultIgnoredTypes() {
    _init_properties_DefaultIgnoredTypesJs_kt__rjtdk1();
    return DefaultIgnoredTypes;
  }
  var DefaultIgnoredTypes;
  var properties_initialized_DefaultIgnoredTypesJs_kt_65g2xt;
  function _init_properties_DefaultIgnoredTypesJs_kt__rjtdk1() {
    if (!properties_initialized_DefaultIgnoredTypesJs_kt_65g2xt) {
      properties_initialized_DefaultIgnoredTypesJs_kt_65g2xt = true;
      // Inline function 'kotlin.collections.mutableSetOf' call
      DefaultIgnoredTypes = LinkedHashSet_init_$Create$();
    }
  }
  //region block: post-declaration
  protoOf(Config).q33 = register$default;
  //endregion
  //region block: init
  JsonContentTypeMatcher_instance = new JsonContentTypeMatcher();
  //endregion
  //region block: exports
  _.$_$ = _.$_$ || {};
  _.$_$.a = Plugin_getInstance;
  //endregion
  return _;
}(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./ktor-ktor-utils.js'), require('./ktor-ktor-client-core.js'), require('./ktor-ktor-http.js'), require('./ktor-ktor-serialization.js'), require('./ktor-ktor-io.js')));

//# sourceMappingURL=ktor-ktor-client-content-negotiation.js.map
