@earth-app/shovel
Version:
Kotlin Multiplatform Web Scraping Framework
1,043 lines (1,031 loc) • 316 kB
JavaScript
(function (factory) {
if (typeof define === 'function' && define.amd)
define(['exports', './kotlin-kotlin-stdlib.js', './kotlinx-coroutines-core.js', './ktor-ktor-utils.js', './kotlinx-atomicfu.js', './ktor-ktor-events.js', './ktor-ktor-io.js', './ktor-ktor-http.js', './kotlinx-io-kotlinx-io-core.js', './ktor-ktor-http-cio.js', './ktor-ktor-websockets.js'], factory);
else if (typeof exports === 'object')
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-coroutines-core.js'), require('./ktor-ktor-utils.js'), require('./kotlinx-atomicfu.js'), require('./ktor-ktor-events.js'), require('./ktor-ktor-io.js'), require('./ktor-ktor-http.js'), require('./kotlinx-io-kotlinx-io-core.js'), require('./ktor-ktor-http-cio.js'), require('./ktor-ktor-websockets.js'));
else {
if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-client-core'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'ktor-ktor-client-core'.");
}
if (typeof globalThis['kotlinx-coroutines-core'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-client-core'. Its dependency 'kotlinx-coroutines-core' was not found. Please, check whether 'kotlinx-coroutines-core' is loaded prior to 'ktor-ktor-client-core'.");
}
if (typeof globalThis['ktor-ktor-utils'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-client-core'. Its dependency 'ktor-ktor-utils' was not found. Please, check whether 'ktor-ktor-utils' is loaded prior to 'ktor-ktor-client-core'.");
}
if (typeof globalThis['kotlinx-atomicfu'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-client-core'. Its dependency 'kotlinx-atomicfu' was not found. Please, check whether 'kotlinx-atomicfu' is loaded prior to 'ktor-ktor-client-core'.");
}
if (typeof globalThis['ktor-ktor-events'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-client-core'. Its dependency 'ktor-ktor-events' was not found. Please, check whether 'ktor-ktor-events' is loaded prior to 'ktor-ktor-client-core'.");
}
if (typeof globalThis['ktor-ktor-io'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-client-core'. Its dependency 'ktor-ktor-io' was not found. Please, check whether 'ktor-ktor-io' is loaded prior to 'ktor-ktor-client-core'.");
}
if (typeof globalThis['ktor-ktor-http'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-client-core'. Its dependency 'ktor-ktor-http' was not found. Please, check whether 'ktor-ktor-http' is loaded prior to 'ktor-ktor-client-core'.");
}
if (typeof globalThis['kotlinx-io-kotlinx-io-core'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-client-core'. Its dependency 'kotlinx-io-kotlinx-io-core' was not found. Please, check whether 'kotlinx-io-kotlinx-io-core' is loaded prior to 'ktor-ktor-client-core'.");
}
if (typeof globalThis['ktor-ktor-http-cio'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-client-core'. Its dependency 'ktor-ktor-http-cio' was not found. Please, check whether 'ktor-ktor-http-cio' is loaded prior to 'ktor-ktor-client-core'.");
}
if (typeof globalThis['ktor-ktor-websockets'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-client-core'. Its dependency 'ktor-ktor-websockets' was not found. Please, check whether 'ktor-ktor-websockets' is loaded prior to 'ktor-ktor-client-core'.");
}
globalThis['ktor-ktor-client-core'] = factory(typeof globalThis['ktor-ktor-client-core'] === 'undefined' ? {} : globalThis['ktor-ktor-client-core'], globalThis['kotlin-kotlin-stdlib'], globalThis['kotlinx-coroutines-core'], globalThis['ktor-ktor-utils'], globalThis['kotlinx-atomicfu'], globalThis['ktor-ktor-events'], globalThis['ktor-ktor-io'], globalThis['ktor-ktor-http'], globalThis['kotlinx-io-kotlinx-io-core'], globalThis['ktor-ktor-http-cio'], globalThis['ktor-ktor-websockets']);
}
}(function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_io_ktor_ktor_utils, kotlin_org_jetbrains_kotlinx_atomicfu, kotlin_io_ktor_ktor_events, kotlin_io_ktor_ktor_io, kotlin_io_ktor_ktor_http, kotlin_org_jetbrains_kotlinx_kotlinx_io_core, kotlin_io_ktor_ktor_http_cio, kotlin_io_ktor_ktor_websockets) {
'use strict';
//region block: imports
var imul = Math.imul;
var protoOf = kotlin_kotlin.$_$.j8;
var objectCreate = kotlin_kotlin.$_$.i8;
var cancel = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.x;
var Unit_instance = kotlin_kotlin.$_$.v2;
var CoroutineImpl = kotlin_kotlin.$_$.h6;
var THROW_CCE = kotlin_kotlin.$_$.bc;
var PipelineContext = kotlin_io_ktor_ktor_utils.$_$.g;
var toString = kotlin_kotlin.$_$.m8;
var getKClassFromExpression = kotlin_kotlin.$_$.v8;
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.l1;
var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.r5;
var initMetadataForLambda = kotlin_kotlin.$_$.y7;
var VOID = kotlin_kotlin.$_$.b;
var initMetadataForCoroutine = kotlin_kotlin.$_$.v7;
var atomic$boolean$1 = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.b;
var Key_instance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.f;
var Job = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.u;
var AttributesJsFn = kotlin_io_ktor_ktor_utils.$_$.m;
var Events = kotlin_io_ktor_ktor_events.$_$.b;
var AttributeKey = kotlin_io_ktor_ktor_utils.$_$.l;
var AutoCloseable = kotlin_kotlin.$_$.lb;
var isInterface = kotlin_kotlin.$_$.d8;
var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.t;
var initMetadataForClass = kotlin_kotlin.$_$.t7;
var ensureNotNull = kotlin_kotlin.$_$.ic;
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.o;
var PlatformUtils_getInstance = kotlin_io_ktor_ktor_utils.$_$.a;
var ByteReadChannel = kotlin_io_ktor_ktor_io.$_$.e1;
var PrimitiveClasses_getInstance = kotlin_kotlin.$_$.t2;
var arrayOf = kotlin_kotlin.$_$.fc;
var createKType = kotlin_kotlin.$_$.u8;
var TypeInfo = kotlin_io_ktor_ktor_utils.$_$.j;
var initMetadataForCompanion = kotlin_kotlin.$_$.u7;
var instanceOf = kotlin_io_ktor_ktor_utils.$_$.k;
var NullBody_instance = kotlin_io_ktor_ktor_http.$_$.a;
var equals = kotlin_kotlin.$_$.m7;
var cancel_0 = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.z;
var throwUninitializedPropertyAccessException = kotlin_kotlin.$_$.k6;
var IllegalStateException = kotlin_kotlin.$_$.ub;
var IllegalStateException_init_$Init$ = kotlin_kotlin.$_$.j1;
var captureStack = kotlin_kotlin.$_$.d7;
var defineProp = kotlin_kotlin.$_$.l7;
var UnsupportedOperationException = kotlin_kotlin.$_$.dc;
var UnsupportedOperationException_init_$Init$ = kotlin_kotlin.$_$.z1;
var HttpHeaders_getInstance = kotlin_io_ktor_ktor_http.$_$.g;
var trimIndent = kotlin_kotlin.$_$.hb;
var contentLength = kotlin_io_ktor_ktor_http.$_$.d1;
var fromInt = kotlin_kotlin.$_$.s6;
var ByteReadChannel_0 = kotlin_io_ktor_ktor_io.$_$.d1;
var readRemaining = kotlin_io_ktor_ktor_io.$_$.d;
var readByteArray = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.k;
var IllegalStateException_init_$Init$_0 = kotlin_kotlin.$_$.k1;
var initMetadataForInterface = kotlin_kotlin.$_$.x7;
var noWhenBranchMatchedException = kotlin_kotlin.$_$.mc;
var GlobalScope_instance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.e;
var writer = kotlin_io_ktor_ktor_io.$_$.m1;
var WriteChannelContent = kotlin_io_ktor_ktor_http.$_$.r;
var ReadChannelContent = kotlin_io_ktor_ktor_http.$_$.q;
var Companion_getInstance = kotlin_io_ktor_ktor_io.$_$.l;
var NoContent = kotlin_io_ktor_ktor_http.$_$.o;
var ProtocolUpgrade = kotlin_io_ktor_ktor_http.$_$.p;
var ByteArrayContent = kotlin_io_ktor_ktor_http.$_$.m;
var ContentWrapper = kotlin_io_ktor_ktor_http.$_$.n;
var WriterScope = kotlin_io_ktor_ktor_io.$_$.f1;
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.i1;
var OutgoingContent = kotlin_io_ktor_ktor_http.$_$.s;
var get_job = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.b1;
var async = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.w;
var emptySet = kotlin_kotlin.$_$.b4;
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.j;
var UnsafeHeaderException = kotlin_io_ktor_ktor_http.$_$.y;
var CancellationException_init_$Create$ = kotlin_kotlin.$_$.q;
var CoroutineName = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.r;
var getKClass = kotlin_kotlin.$_$.w8;
var getStarKTypeProjection = kotlin_kotlin.$_$.x8;
var ioDispatcher = kotlin_io_ktor_ktor_io.$_$.k1;
var SilentSupervisor = kotlin_io_ktor_ktor_utils.$_$.o;
var lazy = kotlin_kotlin.$_$.lc;
var KProperty1 = kotlin_kotlin.$_$.a9;
var getPropertyCallableRef = kotlin_kotlin.$_$.q7;
var CompletableJob = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.p;
var KtMutableMap = kotlin_kotlin.$_$.f3;
var createInvariantKTypeProjection = kotlin_kotlin.$_$.s8;
var setOf = kotlin_kotlin.$_$.x4;
var get = kotlin_kotlin.$_$.d6;
var fold = kotlin_kotlin.$_$.c6;
var minusKey = kotlin_kotlin.$_$.e6;
var plus = kotlin_kotlin.$_$.g6;
var Element = kotlin_kotlin.$_$.f6;
var joinToString = kotlin_kotlin.$_$.i4;
var setOf_0 = kotlin_kotlin.$_$.y4;
var PipelinePhase = kotlin_io_ktor_ktor_utils.$_$.h;
var isSuspendFunction = kotlin_kotlin.$_$.e8;
var initMetadataForObject = kotlin_kotlin.$_$.z7;
var MalformedInputException = kotlin_io_ktor_ktor_io.$_$.n;
var Unit = kotlin_kotlin.$_$.cc;
var KtorSimpleLogger = kotlin_io_ktor_ktor_utils.$_$.e;
var Application_getInstance = kotlin_io_ktor_ktor_http.$_$.b;
var toLong = kotlin_kotlin.$_$.fb;
var contentType = kotlin_io_ktor_ktor_http.$_$.e1;
var isByteArray = kotlin_kotlin.$_$.a8;
var Text_getInstance = kotlin_io_ktor_ktor_http.$_$.e;
var TextContent = kotlin_io_ktor_ktor_http.$_$.t;
var Long = kotlin_kotlin.$_$.wb;
var copyTo = kotlin_io_ktor_ktor_io.$_$.a;
var CancellationException = kotlin_kotlin.$_$.q5;
var Companion_getInstance_0 = kotlin_io_ktor_ktor_http.$_$.c;
var MultiPart_getInstance = kotlin_io_ktor_ktor_http.$_$.d;
var CIOMultipartDataBase = kotlin_io_ktor_ktor_http_cio.$_$.a;
var MultiPartData = kotlin_io_ktor_ktor_http.$_$.k;
var cancel_1 = kotlin_io_ktor_ktor_io.$_$.g1;
var HttpStatusCode = kotlin_io_ktor_ktor_http.$_$.w;
var invokeOnCompletion = kotlin_io_ktor_ktor_io.$_$.j1;
var toByteArray = kotlin_io_ktor_ktor_io.$_$.h;
var Source = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.h;
var readText = kotlin_io_ktor_ktor_io.$_$.l1;
var toInt = kotlin_kotlin.$_$.cb;
var reversed = kotlin_kotlin.$_$.w4;
var Attributes = kotlin_io_ktor_ktor_utils.$_$.n;
var LinkedHashSet_init_$Create$ = kotlin_kotlin.$_$.p;
var Charsets_getInstance = kotlin_io_ktor_ktor_io.$_$.k;
var toList = kotlin_kotlin.$_$.f5;
var sortedWith = kotlin_kotlin.$_$.b5;
var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.x;
var charSequenceLength = kotlin_kotlin.$_$.i7;
var get_name = kotlin_io_ktor_ktor_io.$_$.r;
var roundToInt = kotlin_kotlin.$_$.o8;
var firstOrNull = kotlin_kotlin.$_$.e4;
var FunctionAdapter = kotlin_kotlin.$_$.a7;
var Comparator = kotlin_kotlin.$_$.pb;
var hashCode = kotlin_kotlin.$_$.s7;
var compareValues = kotlin_kotlin.$_$.p5;
var charset = kotlin_io_ktor_ktor_http.$_$.c1;
var withCharset = kotlin_io_ktor_ktor_http.$_$.l1;
var charset_0 = kotlin_io_ktor_ktor_http.$_$.b1;
var readText_0 = kotlin_io_ktor_ktor_io.$_$.t;
var Companion_getInstance_1 = kotlin_io_ktor_ktor_http.$_$.j;
var get_authority = kotlin_io_ktor_ktor_http.$_$.a1;
var takeFrom = kotlin_io_ktor_ktor_http.$_$.k1;
var isSecure = kotlin_io_ktor_ktor_http.$_$.g1;
var get_authority_0 = kotlin_io_ktor_ktor_http.$_$.z;
var Companion_getInstance_2 = kotlin_io_ktor_ktor_http.$_$.h;
var EventDefinition = kotlin_io_ktor_ktor_events.$_$.a;
var initMetadataForFunctionReference = kotlin_kotlin.$_$.w7;
var SupervisorJob = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.v;
var cancel_2 = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a1;
var Default_getInstance = kotlin_kotlin.$_$.s2;
var equalsLong = kotlin_kotlin.$_$.r6;
var delay = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.b;
var toLongOrNull = kotlin_kotlin.$_$.eb;
var multiply = kotlin_kotlin.$_$.u6;
var compare = kotlin_kotlin.$_$.o6;
var toNumber = kotlin_kotlin.$_$.z6;
var numberToLong = kotlin_kotlin.$_$.v6;
var add = kotlin_kotlin.$_$.m6;
var Companion_instance = kotlin_kotlin.$_$.u2;
var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.j2;
var createFailure = kotlin_kotlin.$_$.hc;
var Result__exceptionOrNull_impl_p6xea9 = kotlin_kotlin.$_$.k2;
var toString_0 = kotlin_kotlin.$_$.pc;
var trimMargin = kotlin_kotlin.$_$.ib;
var IOException = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.g;
var CopyableThrowable = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.q;
var KProperty0 = kotlin_kotlin.$_$.z8;
var get_isTraceEnabled = kotlin_io_ktor_ktor_utils.$_$.f;
var createKTypeParameter = kotlin_kotlin.$_$.t8;
var NullBody = kotlin_io_ktor_ktor_http.$_$.l;
var IllegalStateException_init_$Init$_1 = kotlin_kotlin.$_$.m1;
var URLBuilder = kotlin_io_ktor_ktor_http.$_$.x;
var HeadersBuilder = kotlin_io_ktor_ktor_http.$_$.v;
var takeFrom_0 = kotlin_io_ktor_ktor_http.$_$.j1;
var appendAll = kotlin_io_ktor_ktor_utils.$_$.v;
var putAll = kotlin_io_ktor_ktor_utils.$_$.x;
var GMTDate = kotlin_io_ktor_ktor_utils.$_$.c;
var Pipeline = kotlin_io_ktor_ktor_utils.$_$.i;
var decode = kotlin_io_ktor_ktor_io.$_$.o;
var get_ByteArrayPool = kotlin_io_ktor_ktor_io.$_$.z;
var readAvailable = kotlin_io_ktor_ktor_io.$_$.b;
var writeFully = kotlin_io_ktor_ktor_io.$_$.i;
var close = kotlin_io_ktor_ktor_io.$_$.h1;
var KtMutableList = kotlin_kotlin.$_$.e3;
var Companion_getInstance_3 = kotlin_io_ktor_ktor_http.$_$.i;
var CoroutineScope_0 = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.s;
var equals_0 = kotlin_kotlin.$_$.t9;
var flatten = kotlin_kotlin.$_$.g4;
var copyToArray = kotlin_kotlin.$_$.x3;
var await_0 = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a;
var CancellationException_0 = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.n;
var cancel_3 = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.y;
var Companion_getInstance_4 = kotlin_io_ktor_ktor_http.$_$.f;
var headersOf = kotlin_io_ktor_ktor_http.$_$.f1;
var intercepted = kotlin_kotlin.$_$.u5;
var CancellableContinuationImpl = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.m;
var toTypedArray = kotlin_kotlin.$_$.n5;
var get_supportsRequestBody = kotlin_io_ktor_ktor_http.$_$.i1;
var isEmpty = kotlin_io_ktor_ktor_http.$_$.u;
var SafeContinuation_init_$Create$ = kotlin_kotlin.$_$.t;
var Error_init_$Create$ = kotlin_kotlin.$_$.a1;
var Companion_getInstance_5 = kotlin_io_ktor_ktor_websockets.$_$.f;
var Codes_CLOSED_ABNORMALLY_getInstance = kotlin_io_ktor_ktor_websockets.$_$.a;
var Text_init_$Create$ = kotlin_io_ktor_ktor_websockets.$_$.e;
var Binary_init_$Create$ = kotlin_io_ktor_ktor_websockets.$_$.c;
var CloseReason = kotlin_io_ktor_ktor_websockets.$_$.g;
var Close_init_$Create$ = kotlin_io_ktor_ktor_websockets.$_$.d;
var decodeToString = kotlin_kotlin.$_$.p9;
var Buffer = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.f;
var writeFully_0 = kotlin_io_ktor_ktor_io.$_$.x;
var cancelConsumed = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.i;
var Codes_NORMAL_getInstance = kotlin_io_ktor_ktor_websockets.$_$.b;
var CompletableDeferred = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.o;
var Channel = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.g;
var launch = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.c1;
var atomic$ref$1 = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.d;
//endregion
//region block: pre-declaration
initMetadataForLambda(HttpClient$slambda, CoroutineImpl, VOID, [2]);
initMetadataForLambda(HttpClient$slambda_1, CoroutineImpl, VOID, [2]);
initMetadataForCoroutine($executeCOROUTINE$, CoroutineImpl);
initMetadataForClass(HttpClient, 'HttpClient', VOID, VOID, [CoroutineScope, AutoCloseable], [1]);
initMetadataForClass(HttpClientConfig, 'HttpClientConfig', HttpClientConfig);
initMetadataForClass(HttpClientCall, 'HttpClientCall', VOID, VOID, [CoroutineScope], [0, 1]);
initMetadataForClass(DelegatedCall, 'DelegatedCall', VOID, HttpClientCall, VOID, [0, 1]);
function get_coroutineContext() {
return this.e2g().vl();
}
initMetadataForInterface(HttpRequest_0, 'HttpRequest', VOID, VOID, [CoroutineScope]);
initMetadataForClass(DelegatedRequest, 'DelegatedRequest', VOID, VOID, [HttpRequest_0]);
initMetadataForClass(HttpResponse, 'HttpResponse', VOID, VOID, [CoroutineScope]);
initMetadataForClass(DelegatedResponse, 'DelegatedResponse', VOID, HttpResponse);
initMetadataForCompanion(Companion);
initMetadataForCoroutine($bodyNullableCOROUTINE$, CoroutineImpl);
initMetadataForClass(DoubleReceiveException, 'DoubleReceiveException', VOID, IllegalStateException);
initMetadataForClass(NoTransformationFoundException, 'NoTransformationFoundException', VOID, UnsupportedOperationException);
initMetadataForClass(SavedHttpCall, 'SavedHttpCall', VOID, HttpClientCall, VOID, [0, 1]);
initMetadataForClass(SavedHttpRequest, 'SavedHttpRequest', VOID, VOID, [HttpRequest_0]);
initMetadataForClass(SavedHttpResponse, 'SavedHttpResponse', VOID, HttpResponse);
initMetadataForCoroutine($saveCOROUTINE$, CoroutineImpl);
initMetadataForClass(UnsupportedContentTypeException, 'UnsupportedContentTypeException', VOID, IllegalStateException);
initMetadataForInterface(ProgressListener, 'ProgressListener', VOID, VOID, VOID, [2]);
initMetadataForLambda(ObservableContent$getContent$slambda, CoroutineImpl, VOID, [1]);
initMetadataForClass(ObservableContent, 'ObservableContent', VOID, ReadChannelContent);
initMetadataForLambda(HttpClientEngine$install$slambda, CoroutineImpl, VOID, [2]);
initMetadataForLambda(HttpClientEngine$executeWithinCallContext$slambda, CoroutineImpl, VOID, [1]);
initMetadataForCoroutine($executeWithinCallContextCOROUTINE$, CoroutineImpl);
function get_supportedCapabilities() {
return emptySet();
}
function install(client) {
var tmp = Phases_getInstance_0().b2f_1;
client.r2c_1.d1s(tmp, HttpClientEngine$install$slambda_0(client, this, null));
}
initMetadataForInterface(HttpClientEngine, 'HttpClientEngine', VOID, VOID, [CoroutineScope, AutoCloseable], [1]);
initMetadataForClass(HttpClientEngineBase, 'HttpClientEngineBase', VOID, VOID, [HttpClientEngine], [1]);
initMetadataForClass(ClientEngineClosedException, 'ClientEngineClosedException', ClientEngineClosedException, IllegalStateException);
initMetadataForInterface(HttpClientEngineCapability, 'HttpClientEngineCapability');
initMetadataForClass(HttpClientEngineConfig, 'HttpClientEngineConfig', HttpClientEngineConfig);
initMetadataForCompanion(Companion_0);
initMetadataForClass(KtorCallContextElement, 'KtorCallContextElement', VOID, VOID, [Element]);
initMetadataForLambda(AfterRenderHook$install$slambda, CoroutineImpl, VOID, [2]);
initMetadataForObject(AfterRenderHook, 'AfterRenderHook');
initMetadataForLambda(AfterReceiveHook$install$slambda, CoroutineImpl, VOID, [2]);
initMetadataForObject(AfterReceiveHook, 'AfterReceiveHook');
initMetadataForLambda(BodyProgress$lambda$slambda, CoroutineImpl, VOID, [2]);
initMetadataForLambda(BodyProgress$lambda$slambda_1, CoroutineImpl, VOID, [1]);
initMetadataForClass(ResponseException, 'ResponseException', VOID, IllegalStateException);
initMetadataForClass(RedirectResponseException, 'RedirectResponseException', VOID, ResponseException);
initMetadataForClass(ClientRequestException, 'ClientRequestException', VOID, ResponseException);
initMetadataForClass(ServerResponseException, 'ServerResponseException', VOID, ResponseException);
initMetadataForLambda(addDefaultResponseValidation$lambda$slambda, CoroutineImpl, VOID, [1]);
initMetadataForClass(defaultTransformers$2$content$1, VOID, VOID, ByteArrayContent);
initMetadataForClass(defaultTransformers$2$content$2, VOID, VOID, ReadChannelContent);
initMetadataForLambda(defaultTransformers$slambda, CoroutineImpl, VOID, [2]);
initMetadataForLambda(defaultTransformers$slambda$slambda, CoroutineImpl, VOID, [1]);
initMetadataForLambda(defaultTransformers$slambda_1, CoroutineImpl, VOID, [2]);
initMetadataForClass(HttpCallValidatorConfig, 'HttpCallValidatorConfig', HttpCallValidatorConfig);
initMetadataForClass(ExceptionHandlerWrapper, 'ExceptionHandlerWrapper');
initMetadataForClass(RequestExceptionHandlerWrapper, 'RequestExceptionHandlerWrapper');
initMetadataForLambda(RequestError$install$slambda, CoroutineImpl, VOID, [2]);
initMetadataForObject(RequestError, 'RequestError');
initMetadataForLambda(ReceiveError$install$slambda, CoroutineImpl, VOID, [2]);
initMetadataForObject(ReceiveError, 'ReceiveError');
initMetadataForLambda(HttpCallValidator$lambda$slambda, CoroutineImpl, VOID, [1]);
initMetadataForLambda(HttpCallValidator$lambda$slambda_1, CoroutineImpl, VOID, [2]);
initMetadataForLambda(HttpCallValidator$lambda$slambda_3, CoroutineImpl, VOID, [2]);
initMetadataForLambda(HttpCallValidator$lambda$slambda_5, CoroutineImpl, VOID, [2]);
initMetadataForCoroutine($invoke$validateResponseCOROUTINE$, CoroutineImpl);
initMetadataForCoroutine($invoke$processExceptionCOROUTINE$, CoroutineImpl);
initMetadataForClass(HttpRequest$1, VOID, VOID, VOID, [HttpRequest_0]);
initMetadataForClass(HttpPlainTextConfig, 'HttpPlainTextConfig', HttpPlainTextConfig);
initMetadataForLambda(RenderRequestHook$install$slambda, CoroutineImpl, VOID, [2]);
initMetadataForObject(RenderRequestHook, 'RenderRequestHook');
initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
initMetadataForLambda(HttpPlainText$lambda$slambda, CoroutineImpl, VOID, [2]);
initMetadataForLambda(HttpPlainText$lambda$slambda_1, CoroutineImpl, VOID, [4]);
initMetadataForClass(HttpRedirectConfig, 'HttpRedirectConfig', HttpRedirectConfig);
initMetadataForLambda(HttpRedirect$lambda$slambda, CoroutineImpl, VOID, [2]);
initMetadataForCoroutine($invoke$handleCallCOROUTINE$, CoroutineImpl);
initMetadataForCoroutine($invokeCOROUTINE$, CoroutineImpl);
initMetadataForFunctionReference(PipelineContext$proceed$ref, VOID, VOID, [0]);
initMetadataForLambda(SetupRequestContext$install$slambda, CoroutineImpl, VOID, [2]);
initMetadataForObject(SetupRequestContext, 'SetupRequestContext');
initMetadataForLambda(HttpRequestLifecycle$lambda$slambda, CoroutineImpl, VOID, [2]);
initMetadataForClass(HttpRetryEventData, 'HttpRetryEventData');
initMetadataForLambda(HttpRequestRetryConfig$delay$slambda, CoroutineImpl, VOID, [1]);
initMetadataForClass(HttpRequestRetryConfig, 'HttpRequestRetryConfig', HttpRequestRetryConfig);
initMetadataForClass(HttpRetryShouldRetryContext, 'HttpRetryShouldRetryContext');
initMetadataForClass(HttpRetryDelayContext, 'HttpRetryDelayContext');
initMetadataForClass(HttpRetryModifyRequestContext, 'HttpRetryModifyRequestContext');
initMetadataForLambda(HttpRequestRetry$lambda$slambda, CoroutineImpl, VOID, [3]);
initMetadataForLambda(HttpRequestRetry$lambda$slambda_1, CoroutineImpl, VOID, [2]);
initMetadataForCoroutine($throwOnInvalidResponseBodyCOROUTINE$, CoroutineImpl);
initMetadataForInterface(Sender, 'Sender', VOID, VOID, VOID, [1]);
initMetadataForLambda(HttpSend$Plugin$install$slambda, CoroutineImpl, VOID, [2]);
initMetadataForCoroutine($executeCOROUTINE$_0, CoroutineImpl);
initMetadataForClass(Config, 'Config', Config);
initMetadataForObject(Plugin, 'Plugin');
initMetadataForClass(InterceptedSender, 'InterceptedSender', VOID, VOID, [Sender], [1]);
initMetadataForClass(DefaultSender, 'DefaultSender', VOID, VOID, [Sender], [1]);
initMetadataForClass(HttpSend, 'HttpSend');
initMetadataForClass(SendCountExceedException, 'SendCountExceedException', VOID, IllegalStateException);
initMetadataForObject(HttpTimeoutCapability, 'HttpTimeoutCapability', VOID, VOID, [HttpClientEngineCapability]);
initMetadataForClass(HttpRequestTimeoutException, 'HttpRequestTimeoutException', VOID, IOException, [IOException, CopyableThrowable]);
initMetadataForClass(SaveBodyPluginConfig, 'SaveBodyPluginConfig', SaveBodyPluginConfig);
initMetadataForLambda(SaveBody$lambda$slambda, CoroutineImpl, VOID, [2]);
initMetadataForClass(HookHandler, 'HookHandler');
initMetadataForClass(ClientPluginBuilder, 'ClientPluginBuilder');
initMetadataForClass(ClientPluginInstance, 'ClientPluginInstance', VOID, VOID, [AutoCloseable]);
initMetadataForLambda(SetupRequest$install$slambda, CoroutineImpl, VOID, [2]);
initMetadataForObject(SetupRequest, 'SetupRequest');
initMetadataForClass(Sender_0, 'Sender', VOID, VOID, [CoroutineScope], [1]);
initMetadataForLambda(Send$install$slambda, CoroutineImpl, VOID, [2]);
initMetadataForObject(Send, 'Send');
initMetadataForClass(ClientPluginImpl, 'ClientPluginImpl');
initMetadataForClass(TransformResponseBodyContext, 'TransformResponseBodyContext');
initMetadataForClass(OnRequestContext, 'OnRequestContext');
initMetadataForLambda(RequestHook$install$slambda, CoroutineImpl, VOID, [2]);
initMetadataForObject(RequestHook, 'RequestHook');
initMetadataForLambda(TransformResponseBodyHook$install$slambda, CoroutineImpl, VOID, [2]);
initMetadataForObject(TransformResponseBodyHook, 'TransformResponseBodyHook');
initMetadataForObject(SSECapability, 'SSECapability', VOID, VOID, [HttpClientEngineCapability]);
initMetadataForObject(WebSocketCapability, 'WebSocketCapability', VOID, VOID, [HttpClientEngineCapability]);
initMetadataForClass(WebSocketException, 'WebSocketException', VOID, IllegalStateException);
initMetadataForClass(ClientUpgradeContent, 'ClientUpgradeContent', VOID, NoContent, VOID, [1]);
initMetadataForClass(DefaultHttpRequest, 'DefaultHttpRequest', VOID, VOID, [HttpRequest_0]);
initMetadataForCompanion(Companion_1);
initMetadataForClass(HttpRequestBuilder, 'HttpRequestBuilder', HttpRequestBuilder);
initMetadataForClass(HttpRequestData, 'HttpRequestData');
initMetadataForInterface(ResponseAdapter, 'ResponseAdapter');
initMetadataForClass(HttpResponseData, 'HttpResponseData');
initMetadataForObject(Phases, 'Phases');
initMetadataForClass(HttpRequestPipeline, 'HttpRequestPipeline', HttpRequestPipeline, Pipeline, VOID, [2]);
initMetadataForObject(Phases_0, 'Phases');
initMetadataForClass(HttpSendPipeline, 'HttpSendPipeline', HttpSendPipeline, Pipeline, VOID, [2]);
initMetadataForClass(DefaultHttpResponse, 'DefaultHttpResponse', VOID, HttpResponse);
initMetadataForCoroutine($bodyAsTextCOROUTINE$, CoroutineImpl);
initMetadataForObject(Phases_1, 'Phases');
initMetadataForClass(HttpReceivePipeline, 'HttpReceivePipeline', HttpReceivePipeline, Pipeline, VOID, [2]);
initMetadataForObject(Phases_2, 'Phases');
initMetadataForClass(HttpResponsePipeline, 'HttpResponsePipeline', HttpResponsePipeline, Pipeline, VOID, [2]);
initMetadataForClass(HttpResponseContainer, 'HttpResponseContainer');
initMetadataForCoroutine($fetchResponseCOROUTINE$, CoroutineImpl);
initMetadataForCoroutine($cleanupCOROUTINE$, CoroutineImpl);
initMetadataForClass(HttpStatement, 'HttpStatement', VOID, VOID, VOID, [1, 0]);
initMetadataForLambda(observable$slambda, CoroutineImpl, VOID, [1]);
initMetadataForClass(HttpResponseReceiveFail, 'HttpResponseReceiveFail');
initMetadataForObject(EmptyContent, 'EmptyContent', VOID, NoContent);
initMetadataForCompanion(Companion_2);
initMetadataForClass(FetchOptions, 'FetchOptions');
initMetadataForObject(Js, 'Js');
initMetadataForClass(JsClientEngineConfig, 'JsClientEngineConfig', JsClientEngineConfig, HttpClientEngineConfig);
initMetadataForClass(JsClientEngine$createWebSocket$headers_capturingHack$1);
initMetadataForCoroutine($executeCOROUTINE$_1, CoroutineImpl);
initMetadataForCoroutine($createWebSocketCOROUTINE$, CoroutineImpl);
initMetadataForCoroutine($executeWebSocketRequestCOROUTINE$, CoroutineImpl);
initMetadataForClass(JsClientEngine, 'JsClientEngine', VOID, HttpClientEngineBase, VOID, [1, 2]);
initMetadataForLambda(getBodyBytes$slambda, CoroutineImpl, VOID, [1]);
initMetadataForCoroutine($toRawCOROUTINE$, CoroutineImpl);
initMetadataForCoroutine($getBodyBytesCOROUTINE$, CoroutineImpl);
initMetadataForLambda(channelFromStream$slambda, CoroutineImpl, VOID, [1]);
initMetadataForLambda(JsWebSocketSession$slambda, CoroutineImpl, VOID, [1]);
initMetadataForClass(JsWebSocketSession, 'JsWebSocketSession', VOID, VOID, [CoroutineScope], [0, 1]);
initMetadataForClass(Node, 'Node');
initMetadataForClass(engines$iterator$1);
initMetadataForObject(engines, 'engines');
initMetadataForClass(ConnectTimeoutException, 'ConnectTimeoutException', VOID, IOException);
initMetadataForClass(InterruptedIOException, 'InterruptedIOException', VOID, IOException);
initMetadataForClass(SocketTimeoutException, 'SocketTimeoutException', VOID, InterruptedIOException);
//endregion
function HttpClient_init_$Init$(engine, userConfig, manageEngine, $this) {
HttpClient.call($this, engine, userConfig);
$this.l2c_1 = manageEngine;
return $this;
}
function HttpClient_init_$Create$(engine, userConfig, manageEngine) {
return HttpClient_init_$Init$(engine, userConfig, manageEngine, objectCreate(protoOf(HttpClient)));
}
function HttpClient$lambda(this$0) {
return function (it) {
var tmp;
if (!(it == null)) {
cancel(this$0.j2c_1);
tmp = Unit_instance;
}
return Unit_instance;
};
}
function HttpClient$slambda(this$0, resultContinuation) {
this.f2d_1 = this$0;
CoroutineImpl.call(this, resultContinuation);
}
protoOf(HttpClient$slambda).i2d = function ($this$intercept, call, $completion) {
var tmp = this.j2d($this$intercept, call, $completion);
tmp.j8_1 = Unit_instance;
tmp.k8_1 = null;
return tmp.p8();
};
protoOf(HttpClient$slambda).k2d = function (p1, p2, $completion) {
var tmp = p1 instanceof PipelineContext ? p1 : THROW_CCE();
return this.i2d(tmp, !(p2 == null) ? p2 : THROW_CCE(), $completion);
};
protoOf(HttpClient$slambda).p8 = function () {
var suspendResult = this.j8_1;
$sm: do
try {
var tmp = this.h8_1;
switch (tmp) {
case 0:
this.i8_1 = 3;
var tmp_0 = this.h2d_1;
if (!(tmp_0 instanceof HttpClientCall)) {
var message = 'Error: HttpClientCall expected, but found ' + toString(this.h2d_1) + '(' + toString(getKClassFromExpression(this.h2d_1)) + ').';
throw IllegalStateException_init_$Create$(toString(message));
}
this.h8_1 = 1;
suspendResult = this.f2d_1.s2c_1.y1r(Unit_instance, this.h2d_1.q2d(), this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
case 1:
var response = suspendResult;
this.h2d_1.r2d(response);
this.h8_1 = 2;
suspendResult = this.g2d_1.d1r(this.h2d_1, this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
case 2:
return Unit_instance;
case 3:
throw this.k8_1;
}
} catch ($p) {
var e = $p;
if (this.i8_1 === 3) {
throw e;
} else {
this.h8_1 = this.i8_1;
this.k8_1 = e;
}
}
while (true);
};
protoOf(HttpClient$slambda).j2d = function ($this$intercept, call, completion) {
var i = new HttpClient$slambda(this.f2d_1, completion);
i.g2d_1 = $this$intercept;
i.h2d_1 = call;
return i;
};
function HttpClient$slambda_0(this$0, resultContinuation) {
var i = new HttpClient$slambda(this$0, resultContinuation);
var l = function ($this$intercept, call, $completion) {
return i.i2d($this$intercept, call, $completion);
};
l.$arity = 2;
return l;
}
function HttpClient$lambda_0($this$install) {
defaultTransformers($this$install);
return Unit_instance;
}
function HttpClient$slambda_1(this$0, resultContinuation) {
this.a2e_1 = this$0;
CoroutineImpl.call(this, resultContinuation);
}
protoOf(HttpClient$slambda_1).e2e = function ($this$intercept, it, $completion) {
var tmp = this.f2e($this$intercept, it, $completion);
tmp.j8_1 = Unit_instance;
tmp.k8_1 = null;
return tmp.p8();
};
protoOf(HttpClient$slambda_1).k2d = function (p1, p2, $completion) {
var tmp = p1 instanceof PipelineContext ? p1 : THROW_CCE();
return this.e2e(tmp, p2 instanceof HttpResponseContainer ? p2 : THROW_CCE(), $completion);
};
protoOf(HttpClient$slambda_1).p8 = function () {
var suspendResult = this.j8_1;
$sm: do
try {
var tmp = this.h8_1;
switch (tmp) {
case 0:
this.i8_1 = 3;
this.i8_1 = 2;
this.h8_1 = 1;
suspendResult = this.b2e_1.e1r(this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
case 1:
this.d2e_1 = suspendResult;
this.i8_1 = 3;
this.h8_1 = 4;
continue $sm;
case 2:
this.i8_1 = 3;
var tmp_0 = this.k8_1;
if (tmp_0 instanceof Error) {
var cause = this.k8_1;
var tmp_1 = this;
this.a2e_1.v2c_1.l25(get_HttpResponseReceiveFailed(), new HttpResponseReceiveFail(this.b2e_1.z1r_1.q2d(), cause));
throw cause;
} else {
throw this.k8_1;
}
case 3:
throw this.k8_1;
case 4:
this.i8_1 = 3;
return Unit_instance;
}
} catch ($p) {
var e = $p;
if (this.i8_1 === 3) {
throw e;
} else {
this.h8_1 = this.i8_1;
this.k8_1 = e;
}
}
while (true);
};
protoOf(HttpClient$slambda_1).f2e = function ($this$intercept, it, completion) {
var i = new HttpClient$slambda_1(this.a2e_1, completion);
i.b2e_1 = $this$intercept;
i.c2e_1 = it;
return i;
};
function HttpClient$slambda_2(this$0, resultContinuation) {
var i = new HttpClient$slambda_1(this$0, resultContinuation);
var l = function ($this$intercept, it, $completion) {
return i.e2e($this$intercept, it, $completion);
};
l.$arity = 2;
return l;
}
function $executeCOROUTINE$(_this__u8e3s4, builder, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.o2e_1 = _this__u8e3s4;
this.p2e_1 = builder;
}
protoOf($executeCOROUTINE$).p8 = function () {
var suspendResult = this.j8_1;
$sm: do
try {
var tmp = this.h8_1;
switch (tmp) {
case 0:
this.i8_1 = 2;
this.o2e_1.v2c_1.l25(get_HttpRequestCreated(), this.p2e_1);
this.h8_1 = 1;
suspendResult = this.o2e_1.p2c_1.y1r(this.p2e_1, this.p2e_1.t2e_1, this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
case 1:
return suspendResult instanceof HttpClientCall ? suspendResult : THROW_CCE();
case 2:
throw this.k8_1;
}
} catch ($p) {
var e = $p;
if (this.i8_1 === 2) {
throw e;
} else {
this.h8_1 = this.i8_1;
this.k8_1 = e;
}
}
while (true);
};
function HttpClient(engine, userConfig) {
userConfig = userConfig === VOID ? new HttpClientConfig() : userConfig;
this.j2c_1 = engine;
this.k2c_1 = userConfig;
this.l2c_1 = false;
this.m2c_1 = atomic$boolean$1(false);
this.n2c_1 = Job(this.j2c_1.vl().u8(Key_instance));
this.o2c_1 = this.j2c_1.vl().ah(this.n2c_1);
this.p2c_1 = new HttpRequestPipeline();
this.q2c_1 = new HttpResponsePipeline();
this.r2c_1 = new HttpSendPipeline();
this.s2c_1 = new HttpReceivePipeline();
this.t2c_1 = AttributesJsFn(true);
this.u2c_1 = this.j2c_1.w2e();
this.v2c_1 = new Events();
this.w2c_1 = new HttpClientConfig();
if (this.l2c_1) {
this.n2c_1.xm(HttpClient$lambda(this));
}
this.j2c_1.x2e(this);
var tmp = Phases_getInstance_0().c2f_1;
this.r2c_1.d1s(tmp, HttpClient$slambda_0(this, null));
// Inline function 'kotlin.with' call
var $this$with = this.k2c_1;
this.w2c_1.l2f(get_HttpRequestLifecycle());
this.w2c_1.l2f(get_BodyProgress());
this.w2c_1.l2f(get_SaveBody());
if ($this$with.i2f_1) {
this.w2c_1.m2f('DefaultTransformers', HttpClient$lambda_0);
}
this.w2c_1.l2f(Plugin_getInstance());
this.w2c_1.l2f(get_HttpCallValidator());
if ($this$with.h2f_1) {
this.w2c_1.l2f(get_HttpRedirect());
}
this.w2c_1.n2f($this$with);
if ($this$with.i2f_1) {
this.w2c_1.l2f(get_HttpPlainText());
}
addDefaultResponseValidation(this.w2c_1);
this.w2c_1.x2e(this);
var tmp_0 = Phases_getInstance_2().o2f_1;
this.q2c_1.d1s(tmp_0, HttpClient$slambda_2(this, null));
}
protoOf(HttpClient).vl = function () {
return this.o2c_1;
};
protoOf(HttpClient).t2f = function (builder, $completion) {
var tmp = new $executeCOROUTINE$(this, builder, $completion);
tmp.j8_1 = Unit_instance;
tmp.k8_1 = null;
return tmp.p8();
};
protoOf(HttpClient).w3 = function () {
var success = this.m2c_1.atomicfu$compareAndSet(false, true);
if (!success)
return Unit_instance;
var installedFeatures = this.t2c_1.b1n(get_PLUGIN_INSTALLED_LIST());
// Inline function 'kotlin.collections.forEach' call
var _iterator__ex2g4s = installedFeatures.h1n().q();
while (_iterator__ex2g4s.r()) {
var element = _iterator__ex2g4s.s();
var plugin = installedFeatures.b1n(element instanceof AttributeKey ? element : THROW_CCE());
if (isInterface(plugin, AutoCloseable)) {
plugin.w3();
}
}
this.n2c_1.qs();
if (this.l2c_1) {
this.j2c_1.w3();
}
};
protoOf(HttpClient).toString = function () {
return 'HttpClient[' + toString(this.j2c_1) + ']';
};
function HttpClient_0(engine, block) {
// Inline function 'kotlin.apply' call
var this_0 = new HttpClientConfig();
block(this_0);
return HttpClient_init_$Create$(engine, this_0, false);
}
function HttpClientConfig$engineConfig$lambda(_this__u8e3s4) {
return Unit_instance;
}
function HttpClientConfig$install$lambda(_this__u8e3s4) {
return Unit_instance;
}
function HttpClientConfig$install$lambda_0($previousConfigBlock, $configure) {
return function (_this__u8e3s4) {
var tmp0_safe_receiver = $previousConfigBlock;
if (tmp0_safe_receiver == null)
null;
else
tmp0_safe_receiver(_this__u8e3s4);
$configure(!(_this__u8e3s4 == null) ? _this__u8e3s4 : THROW_CCE());
return Unit_instance;
};
}
function HttpClientConfig$install$lambda$lambda() {
return AttributesJsFn(true);
}
function HttpClientConfig$install$lambda_1($plugin) {
return function (scope) {
var tmp = get_PLUGIN_INSTALLED_LIST();
var attributes = scope.t2c_1.g1n(tmp, HttpClientConfig$install$lambda$lambda);
var config = ensureNotNull(scope.w2c_1.e2f_1.r2($plugin.i1()));
var pluginData = $plugin.u2f(config);
$plugin.v2f(pluginData, scope);
attributes.e1n($plugin.i1(), pluginData);
return Unit_instance;
};
}
function HttpClientConfig() {
var tmp = this;
// Inline function 'kotlin.collections.mutableMapOf' call
tmp.d2f_1 = LinkedHashMap_init_$Create$();
var tmp_0 = this;
// Inline function 'kotlin.collections.mutableMapOf' call
tmp_0.e2f_1 = LinkedHashMap_init_$Create$();
var tmp_1 = this;
// Inline function 'kotlin.collections.mutableMapOf' call
tmp_1.f2f_1 = LinkedHashMap_init_$Create$();
var tmp_2 = this;
tmp_2.g2f_1 = HttpClientConfig$engineConfig$lambda;
this.h2f_1 = true;
this.i2f_1 = true;
this.j2f_1 = false;
this.k2f_1 = PlatformUtils_getInstance().o1o_1;
}
protoOf(HttpClientConfig).w2f = function (plugin, configure) {
var previousConfigBlock = this.e2f_1.r2(plugin.i1());
var tmp0 = this.e2f_1;
var tmp2 = plugin.i1();
// Inline function 'kotlin.collections.set' call
var value = HttpClientConfig$install$lambda_0(previousConfigBlock, configure);
tmp0.j2(tmp2, value);
if (this.d2f_1.p2(plugin.i1()))
return Unit_instance;
var tmp0_0 = this.d2f_1;
var tmp2_0 = plugin.i1();
// Inline function 'kotlin.collections.set' call
var value_0 = HttpClientConfig$install$lambda_1(plugin);
tmp0_0.j2(tmp2_0, value_0);
};
protoOf(HttpClientConfig).l2f = function (plugin, configure, $super) {
var tmp;
if (configure === VOID) {
tmp = HttpClientConfig$install$lambda;
} else {
tmp = configure;
}
configure = tmp;
var tmp_0;
if ($super === VOID) {
this.w2f(plugin, configure);
tmp_0 = Unit_instance;
} else {
tmp_0 = $super.w2f.call(this, plugin, configure);
}
return tmp_0;
};
protoOf(HttpClientConfig).m2f = function (key, block) {
// Inline function 'kotlin.collections.set' call
this.f2f_1.j2(key, block);
};
protoOf(HttpClientConfig).x2e = function (client) {
// Inline function 'kotlin.collections.forEach' call
var _iterator__ex2g4s = this.d2f_1.o2().q();
while (_iterator__ex2g4s.r()) {
var element = _iterator__ex2g4s.s();
// Inline function 'kotlin.apply' call
element(client);
}
// Inline function 'kotlin.collections.forEach' call
var _iterator__ex2g4s_0 = this.f2f_1.o2().q();
while (_iterator__ex2g4s_0.r()) {
var element_0 = _iterator__ex2g4s_0.s();
// Inline function 'kotlin.apply' call
element_0(client);
}
};
protoOf(HttpClientConfig).n2f = function (other) {
this.h2f_1 = other.h2f_1;
this.i2f_1 = other.i2f_1;
this.j2f_1 = other.j2f_1;
var tmp0 = this.d2f_1;
// Inline function 'kotlin.collections.plusAssign' call
var map = other.d2f_1;
tmp0.l2(map);
var tmp0_0 = this.e2f_1;
// Inline function 'kotlin.collections.plusAssign' call
var map_0 = other.e2f_1;
tmp0_0.l2(map_0);
var tmp0_1 = this.f2f_1;
// Inline function 'kotlin.collections.plusAssign' call
var map_1 = other.f2f_1;
tmp0_1.l2(map_1);
};
function replaceResponse(_this__u8e3s4, headers, content) {
headers = headers === VOID ? _this__u8e3s4.q2d().o1z() : headers;
return new DelegatedCall(_this__u8e3s4.l2d_1, _this__u8e3s4, content, headers);
}
function DelegatedCall(client, originCall, responseContent, responseHeaders) {
responseHeaders = responseHeaders === VOID ? originCall.q2d().o1z() : responseHeaders;
HttpClientCall.call(this, client);
this.n2d_1 = new DelegatedRequest(this, originCall.x2f());
this.o2d_1 = new DelegatedResponse(this, originCall.q2d(), responseContent, responseHeaders);
}
function DelegatedRequest(call, origin) {
this.c2g_1 = origin;
this.d2g_1 = call;
}
protoOf(DelegatedRequest).e2g = function () {
return this.d2g_1;
};
protoOf(DelegatedRequest).vl = function () {
return this.c2g_1.vl();
};
protoOf(DelegatedRequest).f2g = function () {
return this.c2g_1.f2g();
};
protoOf(DelegatedRequest).g2g = function () {
return this.c2g_1.g2g();
};
protoOf(DelegatedRequest).y2f = function () {
return this.c2g_1.y2f();
};
protoOf(DelegatedRequest).o1z = function () {
return this.c2g_1.o1z();
};
function DelegatedResponse(call, origin, content, headers) {
headers = headers === VOID ? origin.o1z() : headers;
HttpResponse.call(this);
this.h2g_1 = call;
this.i2g_1 = origin;
this.j2g_1 = content;
this.k2g_1 = headers;
this.l2g_1 = this.i2g_1.vl();
}
protoOf(DelegatedResponse).e2g = function () {
return this.h2g_1;
};
protoOf(DelegatedResponse).o1z = function () {
return this.k2g_1;
};
protoOf(DelegatedResponse).m2g = function () {
return this.j2g_1(this.i2g_1);
};
protoOf(DelegatedResponse).vl = function () {
return this.l2g_1;
};
protoOf(DelegatedResponse).n2g = function () {
return this.i2g_1.n2g();
};
protoOf(DelegatedResponse).o2g = function () {
return this.i2g_1.o2g();
};
protoOf(DelegatedResponse).p2g = function () {
return this.i2g_1.p2g();
};
protoOf(DelegatedResponse).q2g = function () {
return this.i2g_1.q2g();
};
function HttpClientCall_init_$Init$(client, requestData, responseData, $this) {
HttpClientCall.call($this, client);
$this.n2d_1 = new DefaultHttpRequest($this, requestData);
$this.o2d_1 = new DefaultHttpResponse($this, responseData);
$this.y2f().f1n(Companion_getInstance_6().r2g_1);
var tmp = responseData.w2g_1;
if (!isInterface(tmp, ByteReadChannel)) {
$this.y2f().e1n(Companion_getInstance_6().r2g_1, responseData.w2g_1);
}
return $this;
}
function HttpClientCall_init_$Create$(client, requestData, responseData) {
return HttpClientCall_init_$Init$(client, requestData, responseData, objectCreate(protoOf(HttpClientCall)));
}
function Companion() {
Companion_instance_0 = this;
var tmp = this;
// Inline function 'io.ktor.util.AttributeKey' call
var name = 'CustomResponse';
// Inline function 'io.ktor.util.reflect.typeInfo' call
var tmp_0 = PrimitiveClasses_getInstance().wa();
// Inline function 'io.ktor.util.reflect.typeOfOrNull' call
var tmp_1;
try {
tmp_1 = createKType(PrimitiveClasses_getInstance().wa(), arrayOf([]), false);
} catch ($p) {
var tmp_2;
if ($p instanceof Error) {
var _unused_var__etf5q3 = $p;
tmp_2 = null;
} else {
throw $p;
}
tmp_1 = tmp_2;
}
var tmp$ret$0 = tmp_1;
var tmp$ret$1 = new TypeInfo(tmp_0, tmp$ret$0);
tmp.r2g_1 = new AttributeKey(name, tmp$ret$1);
}
var Companion_instance_0;
function Companion_getInstance_6() {
if (Companion_instance_0 == null)
new Companion();
return Companion_instance_0;
}
function $bodyNullableCOROUTINE$(_this__u8e3s4, info, resultContinuation) {
CoroutineImpl.call(this, resultContinuation);
this.h2h_1 = _this__u8e3s4;
this.i2h_1 = info;
}
protoOf($bodyNullableCOROUTINE$).p8 = function () {
var suspendResult = this.j8_1;
$sm: do
try {
var tmp = this.h8_1;
switch (tmp) {
case 0:
this.i8_1 = 5;
this.i8_1 = 4;
if (instanceOf(this.h2h_1.q2d(), this.i2h_1.q1s_1))
return this.h2h_1.q2d();
if (!this.h2h_1.z2f() && !get_isSaved(this.h2h_1.q2d()) && !this.h2h_1.m2d_1.atomicfu$compareAndSet(false, true)) {
throw new DoubleReceiveException(this.h2h_1);
}
var tmp0_elvis_lhs = this.h2h_1.y2f().c1n(Companion_getInstance_6().r2g_1);
if (tmp0_elvis_lhs == null) {
this.h8_1 = 1;
suspendResult = this.h2h_1.a2g(this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
} else {
this.j2h_1 = tmp0_elvis_lhs;
this.h8_1 = 2;
continue $sm;
}
case 1:
this.j2h_1 = suspendResult;
this.h8_1 = 2;
continue $sm;
case 2:
var responseData = this.j2h_1;
var subject = new HttpResponseContainer(this.i2h_1, responseData);
this.h8_1 = 3;
suspendResult = this.h2h_1.l2d_1.q2c_1.y1r(this.h2h_1, subject, this);
if (suspendResult === get_COROUTINE_SUSPENDED()) {
return suspendResult;
}
continue $sm;
case 3:
var this_0 = suspendResult.l2h_1;
var tmp_0;
if (!equals(this_0, NullBody_instance)) {
tmp_0 = this_0;
} else {
tmp_0 = null;
}
var result = tmp_0;
if (!(result == null) && !instanceOf(result, this.i2h_1.q1s_1)) {
var from = getKClassFromExpression(result);
var to = this.i2h_1.q1s_1;
throw new NoTransformationFoundException(this.h2h_1.q2d(), from, to);
}
return result;
case 4:
this.i8_1 = 5;
var tmp_1 = this.k8_1;
if (tmp_1 instanceof Error) {
var cause = this.k8_1;
cancel_0(this.h2h_1.q2d(), 'Receive failed', cause);
throw cause;
} else {
throw this.k8_1;
}
case 5:
throw this.k8_1;
}
} catch ($p) {
var e = $p;
if (this.i8_1 === 5) {
throw e;
} else {
this.h8_1 = this.i8_1;
this.k8_1 = e;
}
}
while (true);
};
function HttpClientCall(client) {
Companion_getInstance_6();
this.l2d_1 = cli