@earth-app/shovel
Version:
Kotlin Multiplatform Web Scraping Framework
1,132 lines (1,130 loc) • 123 kB
JavaScript
(function (factory) {
if (typeof define === 'function' && define.amd)
define(['exports', './kotlin-kotlin-stdlib.js', './ktor-ktor-io.js', './ktor-ktor-utils.js'], factory);
else if (typeof exports === 'object')
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./ktor-ktor-io.js'), require('./ktor-ktor-utils.js'));
else {
if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-http'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'ktor-ktor-http'.");
}
if (typeof globalThis['ktor-ktor-io'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-http'. Its dependency 'ktor-ktor-io' was not found. Please, check whether 'ktor-ktor-io' is loaded prior to 'ktor-ktor-http'.");
}
if (typeof globalThis['ktor-ktor-utils'] === 'undefined') {
throw new Error("Error loading module 'ktor-ktor-http'. Its dependency 'ktor-ktor-utils' was not found. Please, check whether 'ktor-ktor-utils' is loaded prior to 'ktor-ktor-http'.");
}
globalThis['ktor-ktor-http'] = factory(typeof globalThis['ktor-ktor-http'] === 'undefined' ? {} : globalThis['ktor-ktor-http'], globalThis['kotlin-kotlin-stdlib'], globalThis['ktor-ktor-io'], globalThis['ktor-ktor-utils']);
}
}(function (_, kotlin_kotlin, kotlin_io_ktor_ktor_io, kotlin_io_ktor_ktor_utils) {
'use strict';
//region block: imports
var imul = Math.imul;
var VOID = kotlin_kotlin.$_$.b;
var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.x;
var Charsets_getInstance = kotlin_io_ktor_ktor_io.$_$.k;
var encode = kotlin_io_ktor_ktor_io.$_$.p;
var Unit_instance = kotlin_kotlin.$_$.v2;
var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.b2;
var Char__plus_impl_qi7pgj = kotlin_kotlin.$_$.f2;
var Char__minus_impl_a2frrh = kotlin_kotlin.$_$.e2;
var takeWhile = kotlin_io_ktor_ktor_io.$_$.v;
var charArray = kotlin_kotlin.$_$.f7;
var concatToString = kotlin_kotlin.$_$.k9;
var charCodeAt = kotlin_kotlin.$_$.g7;
var substring = kotlin_kotlin.$_$.xa;
var toString = kotlin_kotlin.$_$.m8;
var Char = kotlin_kotlin.$_$.nb;
var isSurrogate = kotlin_kotlin.$_$.ea;
var StringBuilder_init_$Create$_0 = kotlin_kotlin.$_$.w;
var charSequenceGet = kotlin_kotlin.$_$.h7;
var charSequenceLength = kotlin_kotlin.$_$.i7;
var charSequenceSubSequence = kotlin_kotlin.$_$.j7;
var toString_0 = kotlin_kotlin.$_$.i2;
var toByte = kotlin_kotlin.$_$.k8;
var decodeToString = kotlin_kotlin.$_$.p9;
var Exception = kotlin_kotlin.$_$.sb;
var Exception_init_$Init$ = kotlin_kotlin.$_$.d1;
var captureStack = kotlin_kotlin.$_$.d7;
var protoOf = kotlin_kotlin.$_$.j8;
var initMetadataForClass = kotlin_kotlin.$_$.t7;
var Char__minus_impl_a2frrh_0 = kotlin_kotlin.$_$.d2;
var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.h2;
var numberToChar = kotlin_kotlin.$_$.h8;
var canRead = kotlin_io_ktor_ktor_io.$_$.s;
var Char__rangeTo_impl_tkncvp = kotlin_kotlin.$_$.g2;
var plus = kotlin_kotlin.$_$.s4;
var plus_0 = kotlin_kotlin.$_$.t4;
var collectionSizeOrDefault = kotlin_kotlin.$_$.p3;
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.i;
var toSet = kotlin_kotlin.$_$.m5;
var setOf = kotlin_kotlin.$_$.y4;
var plus_1 = kotlin_kotlin.$_$.r4;
var listOf = kotlin_kotlin.$_$.o4;
var emptyList = kotlin_kotlin.$_$.z3;
var objectCreate = kotlin_kotlin.$_$.i8;
var equals = kotlin_kotlin.$_$.t9;
var Collection = kotlin_kotlin.$_$.x2;
var isInterface = kotlin_kotlin.$_$.d8;
var isBlank = kotlin_kotlin.$_$.y9;
var last = kotlin_kotlin.$_$.m4;
var indexOf = kotlin_kotlin.$_$.x9;
var THROW_CCE = kotlin_kotlin.$_$.bc;
var isCharSequence = kotlin_kotlin.$_$.b8;
var trim = kotlin_kotlin.$_$.jb;
var substring_0 = kotlin_kotlin.$_$.wa;
var contains = kotlin_kotlin.$_$.n9;
var initMetadataForCompanion = kotlin_kotlin.$_$.u7;
var initMetadataForObject = kotlin_kotlin.$_$.z7;
var startsWith = kotlin_kotlin.$_$.sa;
var plus_2 = kotlin_kotlin.$_$.u4;
var equals_0 = kotlin_kotlin.$_$.m7;
var getStringHashCode = kotlin_kotlin.$_$.r7;
var hashCode = kotlin_kotlin.$_$.s7;
var forName = kotlin_io_ktor_ktor_io.$_$.q;
var IllegalArgumentException = kotlin_kotlin.$_$.tb;
var get_name = kotlin_io_ktor_ktor_io.$_$.r;
var get_lastIndex = kotlin_kotlin.$_$.l4;
var first = kotlin_kotlin.$_$.u9;
var last_0 = kotlin_kotlin.$_$.ia;
var get_lastIndex_0 = kotlin_kotlin.$_$.ga;
var StringValuesBuilderImpl = kotlin_io_ktor_ktor_utils.$_$.r;
var listOf_0 = kotlin_kotlin.$_$.n4;
var emptySet = kotlin_kotlin.$_$.b4;
var get = kotlin_io_ktor_ktor_utils.$_$.q;
var forEach = kotlin_io_ktor_ktor_utils.$_$.p;
var StringValues = kotlin_io_ktor_ktor_utils.$_$.u;
var StringValuesImpl = kotlin_io_ktor_ktor_utils.$_$.s;
var emptyMap = kotlin_kotlin.$_$.a4;
var StringValuesSingleImpl = kotlin_io_ktor_ktor_utils.$_$.t;
var toDoubleOrNull = kotlin_kotlin.$_$.ab;
var LazyThreadSafetyMode_NONE_getInstance = kotlin_kotlin.$_$.e;
var lazy = kotlin_kotlin.$_$.kc;
var to = kotlin_kotlin.$_$.qc;
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.j;
var asList = kotlin_kotlin.$_$.l3;
var Char__compareTo_impl_ypi4mb = kotlin_kotlin.$_$.c2;
var IllegalArgumentException_init_$Init$ = kotlin_kotlin.$_$.h1;
var toLongOrNull = kotlin_kotlin.$_$.eb;
var mapCapacity = kotlin_kotlin.$_$.p4;
var coerceAtLeast = kotlin_kotlin.$_$.p8;
var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.n;
var Comparable = kotlin_kotlin.$_$.ob;
var initMetadataForInterface = kotlin_kotlin.$_$.x7;
var isWhitespace = kotlin_kotlin.$_$.fa;
var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.i1;
var startsWith_0 = kotlin_kotlin.$_$.ra;
var charArrayOf = kotlin_kotlin.$_$.e7;
var split = kotlin_kotlin.$_$.oa;
var toMutableList = kotlin_kotlin.$_$.k5;
var first_0 = kotlin_kotlin.$_$.f4;
var joinToString = kotlin_kotlin.$_$.i4;
var toCharArray = kotlin_io_ktor_ktor_utils.$_$.y;
var indexOfAny = kotlin_kotlin.$_$.v9;
var dropLast = kotlin_kotlin.$_$.y3;
var IllegalStateException = kotlin_kotlin.$_$.ub;
var IllegalStateException_init_$Init$ = kotlin_kotlin.$_$.m1;
var indexOf_0 = kotlin_kotlin.$_$.w9;
var toInt = kotlin_kotlin.$_$.cb;
var toLowerCasePreservingASCIIRules = kotlin_io_ktor_ktor_utils.$_$.z;
var isLowerCase = kotlin_io_ktor_ktor_utils.$_$.w;
var appendAll = kotlin_io_ktor_ktor_utils.$_$.v;
var startsWith_1 = kotlin_kotlin.$_$.qa;
var addAll = kotlin_kotlin.$_$.h3;
var joinTo = kotlin_kotlin.$_$.k4;
var toString_1 = kotlin_kotlin.$_$.pc;
var lazy_0 = kotlin_kotlin.$_$.lc;
var KProperty1 = kotlin_kotlin.$_$.a9;
var getPropertyCallableRef = kotlin_kotlin.$_$.q7;
var getKClassFromExpression = kotlin_kotlin.$_$.v8;
var toByteArray = kotlin_io_ktor_ktor_io.$_$.w;
var fromInt = kotlin_kotlin.$_$.s6;
var take = kotlin_kotlin.$_$.ya;
var PlatformUtils_getInstance = kotlin_io_ktor_ktor_utils.$_$.a;
//endregion
//region block: pre-declaration
initMetadataForClass(URLDecodeException, 'URLDecodeException', VOID, Exception);
initMetadataForCompanion(Companion);
initMetadataForObject(Application, 'Application');
initMetadataForObject(MultiPart, 'MultiPart');
initMetadataForObject(Text, 'Text');
initMetadataForClass(HeaderValueWithParameters, 'HeaderValueWithParameters');
initMetadataForClass(ContentType, 'ContentType', VOID, HeaderValueWithParameters);
initMetadataForClass(BadContentTypeFormatException, 'BadContentTypeFormatException', VOID, Exception);
initMetadataForCompanion(Companion_0);
initMetadataForCompanion(Companion_1);
initMetadataForClass(HeadersBuilder, 'HeadersBuilder', HeadersBuilder, StringValuesBuilderImpl);
initMetadataForObject(EmptyHeaders, 'EmptyHeaders', VOID, VOID, [StringValues]);
initMetadataForClass(HeadersImpl, 'HeadersImpl', HeadersImpl, StringValuesImpl, [StringValues, StringValuesImpl]);
initMetadataForClass(HeadersSingleImpl, 'HeadersSingleImpl', VOID, StringValuesSingleImpl, [StringValues, StringValuesSingleImpl]);
initMetadataForClass(HeaderValueParam, 'HeaderValueParam');
initMetadataForClass(HeaderValue, 'HeaderValue');
initMetadataForObject(HttpHeaders, 'HttpHeaders');
initMetadataForClass(UnsafeHeaderException, 'UnsafeHeaderException', VOID, IllegalArgumentException);
initMetadataForClass(IllegalHeaderNameException, 'IllegalHeaderNameException', VOID, IllegalArgumentException);
initMetadataForClass(IllegalHeaderValueException, 'IllegalHeaderValueException', VOID, IllegalArgumentException);
initMetadataForCompanion(Companion_2);
initMetadataForClass(HttpMethod, 'HttpMethod');
initMetadataForCompanion(Companion_3);
initMetadataForClass(HttpProtocolVersion, 'HttpProtocolVersion');
initMetadataForCompanion(Companion_4);
initMetadataForClass(HttpStatusCode, 'HttpStatusCode', VOID, VOID, [Comparable]);
initMetadataForCompanion(Companion_5);
initMetadataForInterface(Parameters, 'Parameters', VOID, VOID, [StringValues]);
initMetadataForObject(EmptyParameters, 'EmptyParameters', VOID, VOID, [Parameters]);
initMetadataForClass(ParametersBuilderImpl, 'ParametersBuilderImpl', ParametersBuilderImpl, StringValuesBuilderImpl);
initMetadataForClass(ParametersImpl, 'ParametersImpl', ParametersImpl, StringValuesImpl, [Parameters, StringValuesImpl]);
initMetadataForCompanion(Companion_6);
initMetadataForClass(URLBuilder, 'URLBuilder', URLBuilder);
initMetadataForClass(URLParserException, 'URLParserException', VOID, IllegalStateException);
initMetadataForCompanion(Companion_7);
initMetadataForClass(URLProtocol, 'URLProtocol');
initMetadataForCompanion(Companion_8);
initMetadataForClass(Url_0, 'Url');
initMetadataForClass(UrlDecodedParametersBuilder, 'UrlDecodedParametersBuilder');
initMetadataForInterface(MultiPartData, 'MultiPartData', VOID, VOID, VOID, [0]);
initMetadataForClass(OutgoingContent, 'OutgoingContent');
initMetadataForClass(NoContent, 'NoContent', VOID, OutgoingContent);
initMetadataForClass(ReadChannelContent, 'ReadChannelContent', VOID, OutgoingContent);
initMetadataForClass(WriteChannelContent, 'WriteChannelContent', VOID, OutgoingContent, VOID, [1]);
initMetadataForClass(ByteArrayContent, 'ByteArrayContent', VOID, OutgoingContent);
initMetadataForClass(ProtocolUpgrade, 'ProtocolUpgrade', VOID, OutgoingContent, VOID, [4]);
initMetadataForClass(ContentWrapper, 'ContentWrapper', VOID, OutgoingContent);
initMetadataForObject(NullBody, 'NullBody');
initMetadataForClass(TextContent, 'TextContent', VOID, ByteArrayContent);
//endregion
function get_URL_ALPHABET() {
_init_properties_Codecs_kt__fudxxf();
return URL_ALPHABET;
}
var URL_ALPHABET;
function get_URL_ALPHABET_CHARS() {
_init_properties_Codecs_kt__fudxxf();
return URL_ALPHABET_CHARS;
}
var URL_ALPHABET_CHARS;
function get_HEX_ALPHABET() {
_init_properties_Codecs_kt__fudxxf();
return HEX_ALPHABET;
}
var HEX_ALPHABET;
function get_URL_PROTOCOL_PART() {
_init_properties_Codecs_kt__fudxxf();
return URL_PROTOCOL_PART;
}
var URL_PROTOCOL_PART;
function get_VALID_PATH_PART() {
_init_properties_Codecs_kt__fudxxf();
return VALID_PATH_PART;
}
var VALID_PATH_PART;
var ATTRIBUTE_CHARACTERS;
function get_SPECIAL_SYMBOLS() {
_init_properties_Codecs_kt__fudxxf();
return SPECIAL_SYMBOLS;
}
var SPECIAL_SYMBOLS;
function encodeURLParameter(_this__u8e3s4, spaceToPlus) {
spaceToPlus = spaceToPlus === VOID ? false : spaceToPlus;
_init_properties_Codecs_kt__fudxxf();
// Inline function 'kotlin.text.buildString' call
// Inline function 'kotlin.apply' call
var this_0 = StringBuilder_init_$Create$();
var content = encode(Charsets_getInstance().i1j_1.m1j(), _this__u8e3s4);
forEach_0(content, encodeURLParameter$lambda(this_0, spaceToPlus));
return this_0.toString();
}
function decodeURLPart(_this__u8e3s4, start, end, charset) {
start = start === VOID ? 0 : start;
end = end === VOID ? _this__u8e3s4.length : end;
charset = charset === VOID ? Charsets_getInstance().i1j_1 : charset;
_init_properties_Codecs_kt__fudxxf();
return decodeScan(_this__u8e3s4, start, end, false, charset);
}
function encodeURLQueryComponent(_this__u8e3s4, encodeFull, spaceToPlus, charset) {
encodeFull = encodeFull === VOID ? false : encodeFull;
spaceToPlus = spaceToPlus === VOID ? false : spaceToPlus;
charset = charset === VOID ? Charsets_getInstance().i1j_1 : charset;
_init_properties_Codecs_kt__fudxxf();
// Inline function 'kotlin.text.buildString' call
// Inline function 'kotlin.apply' call
var this_0 = StringBuilder_init_$Create$();
var content = encode(charset.m1j(), _this__u8e3s4);
forEach_0(content, encodeURLQueryComponent$lambda(spaceToPlus, this_0, encodeFull));
return this_0.toString();
}
function decodeURLQueryComponent(_this__u8e3s4, start, end, plusIsSpace, charset) {
start = start === VOID ? 0 : start;
end = end === VOID ? _this__u8e3s4.length : end;
plusIsSpace = plusIsSpace === VOID ? false : plusIsSpace;
charset = charset === VOID ? Charsets_getInstance().i1j_1 : charset;
_init_properties_Codecs_kt__fudxxf();
return decodeScan(_this__u8e3s4, start, end, plusIsSpace, charset);
}
function encodeURLPathPart(_this__u8e3s4) {
_init_properties_Codecs_kt__fudxxf();
return encodeURLPath(_this__u8e3s4, true);
}
function encodeURLParameterValue(_this__u8e3s4) {
_init_properties_Codecs_kt__fudxxf();
return encodeURLParameter(_this__u8e3s4, true);
}
function hexDigitToChar(digit) {
_init_properties_Codecs_kt__fudxxf();
return (0 <= digit ? digit <= 9 : false) ? Char__plus_impl_qi7pgj(_Char___init__impl__6a9atx(48), digit) : Char__minus_impl_a2frrh(Char__plus_impl_qi7pgj(_Char___init__impl__6a9atx(65), digit), 10);
}
function forEach_0(_this__u8e3s4, block) {
_init_properties_Codecs_kt__fudxxf();
takeWhile(_this__u8e3s4, forEach$lambda(block));
}
function percentEncode(_this__u8e3s4) {
_init_properties_Codecs_kt__fudxxf();
var code = _this__u8e3s4 & 255;
var array = charArray(3);
array[0] = _Char___init__impl__6a9atx(37);
array[1] = hexDigitToChar(code >> 4);
array[2] = hexDigitToChar(code & 15);
return concatToString(array);
}
function decodeScan(_this__u8e3s4, start, end, plusIsSpace, charset) {
_init_properties_Codecs_kt__fudxxf();
var inductionVariable = start;
if (inductionVariable < end)
do {
var index = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var ch = charCodeAt(_this__u8e3s4, index);
if (ch === _Char___init__impl__6a9atx(37) || (plusIsSpace && ch === _Char___init__impl__6a9atx(43))) {
return decodeImpl(_this__u8e3s4, start, end, index, plusIsSpace, charset);
}
}
while (inductionVariable < end);
return start === 0 && end === _this__u8e3s4.length ? toString(_this__u8e3s4) : substring(_this__u8e3s4, start, end);
}
function encodeURLPath(_this__u8e3s4, encodeSlash, encodeEncoded) {
encodeSlash = encodeSlash === VOID ? false : encodeSlash;
encodeEncoded = encodeEncoded === VOID ? true : encodeEncoded;
_init_properties_Codecs_kt__fudxxf();
// Inline function 'kotlin.text.buildString' call
// Inline function 'kotlin.apply' call
var this_0 = StringBuilder_init_$Create$();
var charset = Charsets_getInstance().i1j_1;
var index = 0;
$l$loop_0: while (index < _this__u8e3s4.length) {
var current = charCodeAt(_this__u8e3s4, index);
if (!encodeSlash && current === _Char___init__impl__6a9atx(47) || get_URL_ALPHABET_CHARS().c2(new Char(current)) || get_VALID_PATH_PART().c2(new Char(current))) {
this_0.p(current);
index = index + 1 | 0;
continue $l$loop_0;
}
if (!encodeEncoded && current === _Char___init__impl__6a9atx(37) && (index + 2 | 0) < _this__u8e3s4.length && get_HEX_ALPHABET().c2(new Char(charCodeAt(_this__u8e3s4, index + 1 | 0))) && get_HEX_ALPHABET().c2(new Char(charCodeAt(_this__u8e3s4, index + 2 | 0)))) {
this_0.p(current);
this_0.p(charCodeAt(_this__u8e3s4, index + 1 | 0));
this_0.p(charCodeAt(_this__u8e3s4, index + 2 | 0));
index = index + 3 | 0;
continue $l$loop_0;
}
var symbolSize = isSurrogate(current) ? 2 : 1;
var tmp = encode(charset.m1j(), _this__u8e3s4, index, index + symbolSize | 0);
forEach_0(tmp, encodeURLPath$lambda(this_0));
index = index + symbolSize | 0;
}
return this_0.toString();
}
function decodeImpl(_this__u8e3s4, start, end, prefixEnd, plusIsSpace, charset) {
_init_properties_Codecs_kt__fudxxf();
var length = end - start | 0;
var sbSize = length > 255 ? length / 3 | 0 : length;
var sb = StringBuilder_init_$Create$_0(sbSize);
if (prefixEnd > start) {
sb.rb(_this__u8e3s4, start, prefixEnd);
}
var index = prefixEnd;
var bytes = null;
while (index < end) {
var c = charSequenceGet(_this__u8e3s4, index);
if (plusIsSpace && c === _Char___init__impl__6a9atx(43)) {
sb.p(_Char___init__impl__6a9atx(32));
index = index + 1 | 0;
} else if (c === _Char___init__impl__6a9atx(37)) {
if (bytes == null) {
bytes = new Int8Array((end - index | 0) / 3 | 0);
}
var count = 0;
while (index < end && charSequenceGet(_this__u8e3s4, index) === _Char___init__impl__6a9atx(37)) {
if ((index + 2 | 0) >= end) {
// Inline function 'kotlin.text.substring' call
var startIndex = index;
var endIndex = charSequenceLength(_this__u8e3s4);
var tmp$ret$0 = toString(charSequenceSubSequence(_this__u8e3s4, startIndex, endIndex));
throw new URLDecodeException('Incomplete trailing HEX escape: ' + tmp$ret$0 + ', in ' + toString(_this__u8e3s4) + ' at ' + index);
}
var digit1 = charToHexDigit(charSequenceGet(_this__u8e3s4, index + 1 | 0));
var digit2 = charToHexDigit(charSequenceGet(_this__u8e3s4, index + 2 | 0));
if (digit1 === -1 || digit2 === -1) {
throw new URLDecodeException('Wrong HEX escape: %' + toString_0(charSequenceGet(_this__u8e3s4, index + 1 | 0)) + toString_0(charSequenceGet(_this__u8e3s4, index + 2 | 0)) + ', in ' + toString(_this__u8e3s4) + ', at ' + index);
}
var tmp = bytes;
var _unary__edvuaz = count;
count = _unary__edvuaz + 1 | 0;
tmp[_unary__edvuaz] = toByte(imul(digit1, 16) + digit2 | 0);
index = index + 3 | 0;
}
sb.n(decodeToString(bytes, 0, 0 + count | 0));
} else {
sb.p(c);
index = index + 1 | 0;
}
}
return sb.toString();
}
function URLDecodeException(message) {
Exception_init_$Init$(message, this);
captureStack(this, URLDecodeException);
}
function charToHexDigit(c2) {
_init_properties_Codecs_kt__fudxxf();
return (_Char___init__impl__6a9atx(48) <= c2 ? c2 <= _Char___init__impl__6a9atx(57) : false) ? Char__minus_impl_a2frrh_0(c2, _Char___init__impl__6a9atx(48)) : (_Char___init__impl__6a9atx(65) <= c2 ? c2 <= _Char___init__impl__6a9atx(70) : false) ? Char__minus_impl_a2frrh_0(c2, _Char___init__impl__6a9atx(65)) + 10 | 0 : (_Char___init__impl__6a9atx(97) <= c2 ? c2 <= _Char___init__impl__6a9atx(102) : false) ? Char__minus_impl_a2frrh_0(c2, _Char___init__impl__6a9atx(97)) + 10 | 0 : -1;
}
function encodeURLParameter$lambda($$this$buildString, $spaceToPlus) {
return function (it) {
if (get_URL_ALPHABET().c2(it) || get_SPECIAL_SYMBOLS().c2(it))
$$this$buildString.p(numberToChar(it));
else {
var tmp;
if ($spaceToPlus) {
var tmp_0 = it;
// Inline function 'kotlin.code' call
var this_0 = _Char___init__impl__6a9atx(32);
var tmp$ret$0 = Char__toInt_impl_vasixd(this_0);
tmp = tmp_0 === toByte(tmp$ret$0);
} else {
tmp = false;
}
if (tmp)
$$this$buildString.p(_Char___init__impl__6a9atx(43));
else {
$$this$buildString.n(percentEncode(it));
}
}
return Unit_instance;
};
}
function encodeURLQueryComponent$lambda($spaceToPlus, $$this$buildString, $encodeFull) {
return function (it) {
var tmp = it;
// Inline function 'kotlin.code' call
var this_0 = _Char___init__impl__6a9atx(32);
var tmp$ret$0 = Char__toInt_impl_vasixd(this_0);
if (tmp === toByte(tmp$ret$0))
if ($spaceToPlus)
$$this$buildString.p(_Char___init__impl__6a9atx(43));
else
$$this$buildString.n('%20');
else {
if (get_URL_ALPHABET().c2(it) || (!$encodeFull && get_URL_PROTOCOL_PART().c2(it)))
$$this$buildString.p(numberToChar(it));
else {
$$this$buildString.n(percentEncode(it));
}
}
return Unit_instance;
};
}
function forEach$lambda($block) {
return function (buffer) {
while (canRead(buffer)) {
$block(buffer.p15());
}
return true;
};
}
function encodeURLPath$lambda($$this$buildString) {
return function (it) {
$$this$buildString.n(percentEncode(it));
return Unit_instance;
};
}
var properties_initialized_Codecs_kt_hkj9s1;
function _init_properties_Codecs_kt__fudxxf() {
if (!properties_initialized_Codecs_kt_hkj9s1) {
properties_initialized_Codecs_kt_hkj9s1 = true;
// Inline function 'kotlin.collections.map' call
var this_0 = plus_0(plus(Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(97), _Char___init__impl__6a9atx(122)), Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(65), _Char___init__impl__6a9atx(90))), Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(48), _Char___init__impl__6a9atx(57)));
// Inline function 'kotlin.collections.mapTo' call
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
var _iterator__ex2g4s = this_0.q();
while (_iterator__ex2g4s.r()) {
var item = _iterator__ex2g4s.s();
// Inline function 'kotlin.code' call
var this_1 = item.p1_1;
var tmp$ret$0 = Char__toInt_impl_vasixd(this_1);
var tmp$ret$1 = toByte(tmp$ret$0);
destination.y(tmp$ret$1);
}
URL_ALPHABET = toSet(destination);
URL_ALPHABET_CHARS = toSet(plus_0(plus(Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(97), _Char___init__impl__6a9atx(122)), Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(65), _Char___init__impl__6a9atx(90))), Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(48), _Char___init__impl__6a9atx(57))));
HEX_ALPHABET = toSet(plus_0(plus(Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(97), _Char___init__impl__6a9atx(102)), Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(65), _Char___init__impl__6a9atx(70))), Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(48), _Char___init__impl__6a9atx(57))));
// Inline function 'kotlin.collections.map' call
var this_2 = setOf([new Char(_Char___init__impl__6a9atx(58)), new Char(_Char___init__impl__6a9atx(47)), new Char(_Char___init__impl__6a9atx(63)), new Char(_Char___init__impl__6a9atx(35)), new Char(_Char___init__impl__6a9atx(91)), new Char(_Char___init__impl__6a9atx(93)), new Char(_Char___init__impl__6a9atx(64)), new Char(_Char___init__impl__6a9atx(33)), new Char(_Char___init__impl__6a9atx(36)), new Char(_Char___init__impl__6a9atx(38)), new Char(_Char___init__impl__6a9atx(39)), new Char(_Char___init__impl__6a9atx(40)), new Char(_Char___init__impl__6a9atx(41)), new Char(_Char___init__impl__6a9atx(42)), new Char(_Char___init__impl__6a9atx(44)), new Char(_Char___init__impl__6a9atx(59)), new Char(_Char___init__impl__6a9atx(61)), new Char(_Char___init__impl__6a9atx(45)), new Char(_Char___init__impl__6a9atx(46)), new Char(_Char___init__impl__6a9atx(95)), new Char(_Char___init__impl__6a9atx(126)), new Char(_Char___init__impl__6a9atx(43))]);
// Inline function 'kotlin.collections.mapTo' call
var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_2, 10));
var _iterator__ex2g4s_0 = this_2.q();
while (_iterator__ex2g4s_0.r()) {
var item_0 = _iterator__ex2g4s_0.s();
// Inline function 'kotlin.code' call
var this_3 = item_0.p1_1;
var tmp$ret$0_0 = Char__toInt_impl_vasixd(this_3);
var tmp$ret$1_0 = toByte(tmp$ret$0_0);
destination_0.y(tmp$ret$1_0);
}
URL_PROTOCOL_PART = destination_0;
VALID_PATH_PART = setOf([new Char(_Char___init__impl__6a9atx(58)), new Char(_Char___init__impl__6a9atx(64)), new Char(_Char___init__impl__6a9atx(33)), new Char(_Char___init__impl__6a9atx(36)), new Char(_Char___init__impl__6a9atx(38)), new Char(_Char___init__impl__6a9atx(39)), new Char(_Char___init__impl__6a9atx(40)), new Char(_Char___init__impl__6a9atx(41)), new Char(_Char___init__impl__6a9atx(42)), new Char(_Char___init__impl__6a9atx(43)), new Char(_Char___init__impl__6a9atx(44)), new Char(_Char___init__impl__6a9atx(59)), new Char(_Char___init__impl__6a9atx(61)), new Char(_Char___init__impl__6a9atx(45)), new Char(_Char___init__impl__6a9atx(46)), new Char(_Char___init__impl__6a9atx(95)), new Char(_Char___init__impl__6a9atx(126))]);
ATTRIBUTE_CHARACTERS = plus_1(get_URL_ALPHABET_CHARS(), setOf([new Char(_Char___init__impl__6a9atx(33)), new Char(_Char___init__impl__6a9atx(35)), new Char(_Char___init__impl__6a9atx(36)), new Char(_Char___init__impl__6a9atx(38)), new Char(_Char___init__impl__6a9atx(43)), new Char(_Char___init__impl__6a9atx(45)), new Char(_Char___init__impl__6a9atx(46)), new Char(_Char___init__impl__6a9atx(94)), new Char(_Char___init__impl__6a9atx(95)), new Char(_Char___init__impl__6a9atx(96)), new Char(_Char___init__impl__6a9atx(124)), new Char(_Char___init__impl__6a9atx(126))]));
// Inline function 'kotlin.collections.map' call
var this_4 = listOf([new Char(_Char___init__impl__6a9atx(45)), new Char(_Char___init__impl__6a9atx(46)), new Char(_Char___init__impl__6a9atx(95)), new Char(_Char___init__impl__6a9atx(126))]);
// Inline function 'kotlin.collections.mapTo' call
var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(this_4, 10));
var _iterator__ex2g4s_1 = this_4.q();
while (_iterator__ex2g4s_1.r()) {
var item_1 = _iterator__ex2g4s_1.s();
// Inline function 'kotlin.code' call
var this_5 = item_1.p1_1;
var tmp$ret$0_1 = Char__toInt_impl_vasixd(this_5);
var tmp$ret$1_1 = toByte(tmp$ret$0_1);
destination_1.y(tmp$ret$1_1);
}
SPECIAL_SYMBOLS = destination_1;
}
}
function ContentType_init_$Init$(contentType, contentSubtype, parameters, $this) {
parameters = parameters === VOID ? emptyList() : parameters;
ContentType.call($this, contentType, contentSubtype, contentType + '/' + contentSubtype, parameters);
return $this;
}
function ContentType_init_$Create$(contentType, contentSubtype, parameters) {
return ContentType_init_$Init$(contentType, contentSubtype, parameters, objectCreate(protoOf(ContentType)));
}
function hasParameter($this, name, value) {
var tmp;
switch ($this.z1s_1.a1()) {
case 0:
tmp = false;
break;
case 1:
// Inline function 'kotlin.let' call
var it = $this.z1s_1.b1(0);
tmp = (equals(it.a1t_1, name, true) && equals(it.b1t_1, value, true));
break;
default:
var tmp0 = $this.z1s_1;
var tmp$ret$2;
$l$block_0: {
// Inline function 'kotlin.collections.any' call
var tmp_0;
if (isInterface(tmp0, Collection)) {
tmp_0 = tmp0.o();
} else {
tmp_0 = false;
}
if (tmp_0) {
tmp$ret$2 = false;
break $l$block_0;
}
var _iterator__ex2g4s = tmp0.q();
while (_iterator__ex2g4s.r()) {
var element = _iterator__ex2g4s.s();
if (equals(element.a1t_1, name, true) && equals(element.b1t_1, value, true)) {
tmp$ret$2 = true;
break $l$block_0;
}
}
tmp$ret$2 = false;
}
tmp = tmp$ret$2;
break;
}
return tmp;
}
function Companion() {
Companion_instance = this;
this.d1t_1 = ContentType_init_$Create$('*', '*');
}
protoOf(Companion).e1t = function (value) {
if (isBlank(value))
return this.d1t_1;
// Inline function 'io.ktor.http.Companion.parse' call
var headerValue = last(parseHeaderValue(value));
var tmp0 = headerValue.f1t_1;
var parameters = headerValue.g1t_1;
var slash = indexOf(tmp0, _Char___init__impl__6a9atx(47));
if (slash === -1) {
// Inline function 'kotlin.text.trim' call
if (toString(trim(isCharSequence(tmp0) ? tmp0 : THROW_CCE())) === '*')
return Companion_getInstance().d1t_1;
throw new BadContentTypeFormatException(value);
}
// Inline function 'kotlin.text.trim' call
var this_0 = substring(tmp0, 0, slash);
var type = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
// Inline function 'kotlin.text.isEmpty' call
if (charSequenceLength(type) === 0) {
throw new BadContentTypeFormatException(value);
}
// Inline function 'kotlin.text.trim' call
var this_1 = substring_0(tmp0, slash + 1 | 0);
var subtype = toString(trim(isCharSequence(this_1) ? this_1 : THROW_CCE()));
if (contains(type, _Char___init__impl__6a9atx(32)) || contains(subtype, _Char___init__impl__6a9atx(32))) {
throw new BadContentTypeFormatException(value);
}
var tmp;
// Inline function 'kotlin.text.isEmpty' call
if (charSequenceLength(subtype) === 0) {
tmp = true;
} else {
tmp = contains(subtype, _Char___init__impl__6a9atx(47));
}
if (tmp) {
throw new BadContentTypeFormatException(value);
}
return ContentType_init_$Create$(type, subtype, parameters);
};
var Companion_instance;
function Companion_getInstance() {
if (Companion_instance == null)
new Companion();
return Companion_instance;
}
function Application() {
Application_instance = this;
this.i1t_1 = 'application';
this.j1t_1 = ContentType_init_$Create$('application', '*');
this.k1t_1 = ContentType_init_$Create$('application', 'atom+xml');
this.l1t_1 = ContentType_init_$Create$('application', 'cbor');
this.m1t_1 = ContentType_init_$Create$('application', 'json');
this.n1t_1 = ContentType_init_$Create$('application', 'hal+json');
this.o1t_1 = ContentType_init_$Create$('application', 'javascript');
this.p1t_1 = ContentType_init_$Create$('application', 'octet-stream');
this.q1t_1 = ContentType_init_$Create$('application', 'rss+xml');
this.r1t_1 = ContentType_init_$Create$('application', 'soap+xml');
this.s1t_1 = ContentType_init_$Create$('application', 'xml');
this.t1t_1 = ContentType_init_$Create$('application', 'xml-dtd');
this.u1t_1 = ContentType_init_$Create$('application', 'yaml');
this.v1t_1 = ContentType_init_$Create$('application', 'zip');
this.w1t_1 = ContentType_init_$Create$('application', 'gzip');
this.x1t_1 = ContentType_init_$Create$('application', 'x-www-form-urlencoded');
this.y1t_1 = ContentType_init_$Create$('application', 'pdf');
this.z1t_1 = ContentType_init_$Create$('application', 'vnd.openxmlformats-officedocument.spreadsheetml.sheet');
this.a1u_1 = ContentType_init_$Create$('application', 'vnd.openxmlformats-officedocument.wordprocessingml.document');
this.b1u_1 = ContentType_init_$Create$('application', 'vnd.openxmlformats-officedocument.presentationml.presentation');
this.c1u_1 = ContentType_init_$Create$('application', 'protobuf');
this.d1u_1 = ContentType_init_$Create$('application', 'wasm');
this.e1u_1 = ContentType_init_$Create$('application', 'problem+json');
this.f1u_1 = ContentType_init_$Create$('application', 'problem+xml');
}
var Application_instance;
function Application_getInstance() {
if (Application_instance == null)
new Application();
return Application_instance;
}
function MultiPart() {
MultiPart_instance = this;
this.g1u_1 = 'multipart';
this.h1u_1 = ContentType_init_$Create$('multipart', '*');
this.i1u_1 = ContentType_init_$Create$('multipart', 'mixed');
this.j1u_1 = ContentType_init_$Create$('multipart', 'alternative');
this.k1u_1 = ContentType_init_$Create$('multipart', 'related');
this.l1u_1 = ContentType_init_$Create$('multipart', 'form-data');
this.m1u_1 = ContentType_init_$Create$('multipart', 'signed');
this.n1u_1 = ContentType_init_$Create$('multipart', 'encrypted');
this.o1u_1 = ContentType_init_$Create$('multipart', 'byteranges');
}
protoOf(MultiPart).p1u = function (contentType) {
return startsWith(contentType, 'multipart/', true);
};
var MultiPart_instance;
function MultiPart_getInstance() {
if (MultiPart_instance == null)
new MultiPart();
return MultiPart_instance;
}
function Text() {
Text_instance = this;
this.q1u_1 = 'text';
this.r1u_1 = ContentType_init_$Create$('text', '*');
this.s1u_1 = ContentType_init_$Create$('text', 'plain');
this.t1u_1 = ContentType_init_$Create$('text', 'css');
this.u1u_1 = ContentType_init_$Create$('text', 'csv');
this.v1u_1 = ContentType_init_$Create$('text', 'html');
this.w1u_1 = ContentType_init_$Create$('text', 'javascript');
this.x1u_1 = ContentType_init_$Create$('text', 'vcard');
this.y1u_1 = ContentType_init_$Create$('text', 'xml');
this.z1u_1 = ContentType_init_$Create$('text', 'event-stream');
}
var Text_instance;
function Text_getInstance() {
if (Text_instance == null)
new Text();
return Text_instance;
}
function ContentType(contentType, contentSubtype, existingContent, parameters) {
Companion_getInstance();
parameters = parameters === VOID ? emptyList() : parameters;
HeaderValueWithParameters.call(this, existingContent, parameters);
this.c1v_1 = contentType;
this.d1v_1 = contentSubtype;
}
protoOf(ContentType).e1v = function (name, value) {
if (hasParameter(this, name, value))
return this;
return new ContentType(this.c1v_1, this.d1v_1, this.y1s_1, plus_2(this.z1s_1, HeaderValueParam_init_$Create$(name, value)));
};
protoOf(ContentType).f1v = function (pattern) {
if (!(pattern.c1v_1 === '*') && !equals(pattern.c1v_1, this.c1v_1, true)) {
return false;
}
if (!(pattern.d1v_1 === '*') && !equals(pattern.d1v_1, this.d1v_1, true)) {
return false;
}
var _iterator__ex2g4s = pattern.z1s_1.q();
while (_iterator__ex2g4s.r()) {
var _destruct__k2r9zo = _iterator__ex2g4s.s();
var patternName = _destruct__k2r9zo.mf();
var patternValue = _destruct__k2r9zo.nf();
var tmp;
if (patternName === '*') {
var tmp_0;
if (patternValue === '*') {
tmp_0 = true;
} else {
var tmp0 = this.z1s_1;
var tmp$ret$0;
$l$block_0: {
// Inline function 'kotlin.collections.any' call
var tmp_1;
if (isInterface(tmp0, Collection)) {
tmp_1 = tmp0.o();
} else {
tmp_1 = false;
}
if (tmp_1) {
tmp$ret$0 = false;
break $l$block_0;
}
var _iterator__ex2g4s_0 = tmp0.q();
while (_iterator__ex2g4s_0.r()) {
var element = _iterator__ex2g4s_0.s();
if (equals(element.b1t_1, patternValue, true)) {
tmp$ret$0 = true;
break $l$block_0;
}
}
tmp$ret$0 = false;
}
tmp_0 = tmp$ret$0;
}
tmp = tmp_0;
} else {
var value = this.g1v(patternName);
tmp = patternValue === '*' ? !(value == null) : equals(value, patternValue, true);
}
var matches = tmp;
if (!matches) {
return false;
}
}
return true;
};
protoOf(ContentType).equals = function (other) {
var tmp;
var tmp_0;
var tmp_1;
if (other instanceof ContentType) {
tmp_1 = equals(this.c1v_1, other.c1v_1, true);
} else {
tmp_1 = false;
}
if (tmp_1) {
tmp_0 = equals(this.d1v_1, other.d1v_1, true);
} else {
tmp_0 = false;
}
if (tmp_0) {
tmp = equals_0(this.z1s_1, other.z1s_1);
} else {
tmp = false;
}
return tmp;
};
protoOf(ContentType).hashCode = function () {
// Inline function 'kotlin.text.lowercase' call
// Inline function 'kotlin.js.asDynamic' call
var tmp$ret$1 = this.c1v_1.toLowerCase();
var result = getStringHashCode(tmp$ret$1);
var tmp = result;
var tmp_0 = imul(31, result);
// Inline function 'kotlin.text.lowercase' call
// Inline function 'kotlin.js.asDynamic' call
var tmp$ret$3 = this.d1v_1.toLowerCase();
result = tmp + (tmp_0 + getStringHashCode(tmp$ret$3) | 0) | 0;
result = result + imul(31, hashCode(this.z1s_1)) | 0;
return result;
};
function charset(_this__u8e3s4) {
var tmp0_safe_receiver = _this__u8e3s4.g1v('charset');
var tmp;
if (tmp0_safe_receiver == null) {
tmp = null;
} else {
// Inline function 'kotlin.let' call
var tmp_0;
try {
tmp_0 = forName(Charsets_getInstance(), tmp0_safe_receiver);
} catch ($p) {
var tmp_1;
if ($p instanceof IllegalArgumentException) {
var exception = $p;
tmp_1 = null;
} else {
throw $p;
}
tmp_0 = tmp_1;
}
tmp = tmp_0;
}
return tmp;
}
function withCharset(_this__u8e3s4, charset) {
return _this__u8e3s4.e1v('charset', get_name(charset));
}
function BadContentTypeFormatException(value) {
Exception_init_$Init$('Bad Content-Type format: ' + value, this);
captureStack(this, BadContentTypeFormatException);
}
function get_HeaderFieldValueSeparators() {
_init_properties_HeaderValueWithParameters_kt__z6luvy();
return HeaderFieldValueSeparators;
}
var HeaderFieldValueSeparators;
function Companion_0() {
}
var Companion_instance_0;
function Companion_getInstance_0() {
return Companion_instance_0;
}
function HeaderValueWithParameters(content, parameters) {
parameters = parameters === VOID ? emptyList() : parameters;
this.y1s_1 = content;
this.z1s_1 = parameters;
}
protoOf(HeaderValueWithParameters).g1v = function (name) {
var inductionVariable = 0;
var last = get_lastIndex(this.z1s_1);
if (inductionVariable <= last)
do {
var index = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var parameter = this.z1s_1.b1(index);
if (equals(parameter.a1t_1, name, true)) {
return parameter.b1t_1;
}
}
while (!(index === last));
return null;
};
protoOf(HeaderValueWithParameters).toString = function () {
var tmp;
if (this.z1s_1.o()) {
tmp = this.y1s_1;
} else {
var tmp_0 = this.y1s_1.length;
// Inline function 'kotlin.collections.sumOf' call
var sum = 0;
var _iterator__ex2g4s = this.z1s_1.q();
while (_iterator__ex2g4s.r()) {
var element = _iterator__ex2g4s.s();
var tmp_1 = sum;
sum = tmp_1 + ((element.a1t_1.length + element.b1t_1.length | 0) + 3 | 0) | 0;
}
var size = tmp_0 + sum | 0;
// Inline function 'kotlin.apply' call
var this_0 = StringBuilder_init_$Create$_0(size);
this_0.n(this.y1s_1);
var inductionVariable = 0;
var last = get_lastIndex(this.z1s_1);
if (inductionVariable <= last)
do {
var index = inductionVariable;
inductionVariable = inductionVariable + 1 | 0;
var element_0 = this.z1s_1.b1(index);
this_0.n('; ');
this_0.n(element_0.a1t_1);
this_0.n('=');
// Inline function 'io.ktor.http.escapeIfNeededTo' call
var this_1 = element_0.b1t_1;
if (needQuotes(this_1))
this_0.n(quote(this_1));
else
this_0.n(this_1);
}
while (!(index === last));
tmp = this_0.toString();
}
return tmp;
};
function needQuotes(_this__u8e3s4) {
_init_properties_HeaderValueWithParameters_kt__z6luvy();
// Inline function 'kotlin.text.isEmpty' call
if (charSequenceLength(_this__u8e3s4) === 0)
return true;
if (isQuoted(_this__u8e3s4))
return false;
var inductionVariable = 0;
var last = _this__u8e3s4.length;
while (inductionVariable < last) {
var element = charCodeAt(_this__u8e3s4, inductionVariable);
inductionVariable = inductionVariable + 1 | 0;
if (get_HeaderFieldValueSeparators().c2(new Char(element)))
return true;
}
return false;
}
function quote(_this__u8e3s4) {
_init_properties_HeaderValueWithParameters_kt__z6luvy();
// Inline function 'kotlin.text.buildString' call
// Inline function 'kotlin.apply' call
var this_0 = StringBuilder_init_$Create$();
quoteTo(_this__u8e3s4, this_0);
return this_0.toString();
}
function isQuoted(_this__u8e3s4) {
_init_properties_HeaderValueWithParameters_kt__z6luvy();
if (_this__u8e3s4.length < 2) {
return false;
}
if (!(first(_this__u8e3s4) === _Char___init__impl__6a9atx(34)) || !(last_0(_this__u8e3s4) === _Char___init__impl__6a9atx(34))) {
return false;
}
var startIndex = 1;
$l$loop: do {
var index = indexOf(_this__u8e3s4, _Char___init__impl__6a9atx(34), startIndex);
if (index === get_lastIndex_0(_this__u8e3s4)) {
break $l$loop;
}
var slashesCount = 0;
var slashIndex = index - 1 | 0;
while (charCodeAt(_this__u8e3s4, slashIndex) === _Char___init__impl__6a9atx(92)) {
slashesCount = slashesCount + 1 | 0;
slashIndex = slashIndex - 1 | 0;
}
if ((slashesCount % 2 | 0) === 0) {
return false;
}
startIndex = index + 1 | 0;
}
while (startIndex < _this__u8e3s4.length);
return true;
}
function quoteTo(_this__u8e3s4, out) {
_init_properties_HeaderValueWithParameters_kt__z6luvy();
out.n('"');
var inductionVariable = 0;
var last = _this__u8e3s4.length;
while (inductionVariable < last) {
var element = charCodeAt(_this__u8e3s4, inductionVariable);
inductionVariable = inductionVariable + 1 | 0;
var ch = element;
if (ch === _Char___init__impl__6a9atx(92))
out.n('\\\\');
else if (ch === _Char___init__impl__6a9atx(10))
out.n('\\n');
else if (ch === _Char___init__impl__6a9atx(13))
out.n('\\r');
else if (ch === _Char___init__impl__6a9atx(9))
out.n('\\t');
else if (ch === _Char___init__impl__6a9atx(34))
out.n('\\"');
else
out.p(ch);
}
out.n('"');
}
var properties_initialized_HeaderValueWithParameters_kt_yu5xg;
function _init_properties_HeaderValueWithParameters_kt__z6luvy() {
if (!properties_initialized_HeaderValueWithParameters_kt_yu5xg) {
properties_initialized_HeaderValueWithParameters_kt_yu5xg = true;
HeaderFieldValueSeparators = setOf([new Char(_Char___init__impl__6a9atx(40)), new Char(_Char___init__impl__6a9atx(41)), new Char(_Char___init__impl__6a9atx(60)), new Char(_Char___init__impl__6a9atx(62)), new Char(_Char___init__impl__6a9atx(64)), new Char(_Char___init__impl__6a9atx(44)), new Char(_Char___init__impl__6a9atx(59)), new Char(_Char___init__impl__6a9atx(58)), new Char(_Char___init__impl__6a9atx(92)), new Char(_Char___init__impl__6a9atx(34)), new Char(_Char___init__impl__6a9atx(47)), new Char(_Char___init__impl__6a9atx(91)), new Char(_Char___init__impl__6a9atx(93)), new Char(_Char___init__impl__6a9atx(63)), new Char(_Char___init__impl__6a9atx(61)), new Char(_Char___init__impl__6a9atx(123)), new Char(_Char___init__impl__6a9atx(125)), new Char(_Char___init__impl__6a9atx(32)), new Char(_Char___init__impl__6a9atx(9)), new Char(_Char___init__impl__6a9atx(10)), new Char(_Char___init__impl__6a9atx(13))]);
}
}
function Companion_1() {
Companion_instance_1 = this;
this.h1v_1 = EmptyHeaders_instance;
}
var Companion_instance_1;
function Companion_getInstance_1() {
if (Companion_instance_1 == null)
new Companion_1();
return Companion_instance_1;
}
function HeadersBuilder(size) {
size = size === VOID ? 8 : size;
StringValuesBuilderImpl.call(this, true, size);
}
protoOf(HeadersBuilder).k1v = function () {
return new HeadersImpl(this.x1o_1);
};
protoOf(HeadersBuilder).y1o = function (name) {
protoOf(StringValuesBuilderImpl).y1o.call(this, name);
HttpHeaders_getInstance().i1z(name);
};
protoOf(HeadersBuilder).a1p = function (value) {
protoOf(StringValuesBuilderImpl).a1p.call(this, value);
HttpHeaders_getInstance().j1z(value);
};
function headersOf(name, value) {
return new HeadersSingleImpl(name, listOf_0(value));
}
function EmptyHeaders() {
}
protoOf(EmptyHeaders).s1o = function () {
return true;
};
protoOf(EmptyHeaders).t1o = function (name) {
return null;
};
protoOf(EmptyHeaders).u1o = function () {
return emptySet();
};
protoOf(EmptyHeaders).q1o = function () {
return emptySet();
};
protoOf(EmptyHeaders).o = function () {
return true;
};
protoOf(EmptyHeaders).toString = function () {
return 'Headers ' + toString(this.q1o());
};
var EmptyHeaders_instance;
function EmptyHeaders_getInstance() {
return EmptyHeaders_instance;
}
function HeadersImpl(values) {
values = values === VOID ? emptyMap() : values;
StringValuesImpl.call(this, true, values);
}
protoOf(HeadersImpl).toString = function () {
return 'Headers ' + toString(this.q1o());
};
function HeadersSingleImpl(name, values) {
StringValuesSingleImpl.call(this, true, name, values);
}
protoOf(HeadersSingleImpl).toString = function () {
return 'Headers ' + toString(this.q1o());
};
function HeaderValueParam_init_$Init$(name, value, $this) {
HeaderValueParam.call($this, name, value, false);
return $this;
}
function HeaderValueParam_init_$Create$(name, value) {
return HeaderValueParam_init_$Init$(name, value, objectCreate(protoOf(HeaderValueParam)));
}
function HeaderValueParam(name, value, escapeValue) {
this.a1t_1 = name;
this.b1t_1 = value;
this.c1t_1 = escapeValue;
}
protoOf(HeaderValueParam).equals = function (other) {
var tmp;
var tmp_0;
if (other instanceof HeaderValueParam) {
tmp_0 = equals(other.a1t_1, this.a1t_1, true);
} else {
tmp_0 = false;
}
if (tmp_0) {
tmp = equals(other.b1t_1, this.b1t_1, true);
} else {
tmp = false;
}
return tmp;
};
protoOf(HeaderValueParam).hashCode = function () {
// Inline function 'kotlin.text.lowercase' call
// Inline function 'kotlin.js.asDynamic' call
var tmp$ret$1 = this.a1t_1.toLowerCase();
var result = getStringHashCode(tmp$ret$1);
var tmp = result;
var tmp_0 = imul(31, result);
// Inline function 'kotlin.text.lowercase' call
// Inline function 'kotlin.js.asDynamic' call
var tmp$ret$3 = this.b1t_1.toLowerCase();
result = tmp + (tmp_0 + getStringHashCode(tmp$ret$3) | 0) | 0;
return result;
};
protoOf(HeaderValueParam).mf = function () {
return this.a1t_1;
};
protoOf(HeaderValueParam).nf = function () {
return this.b1t_1;
};
protoOf(HeaderValueParam).toString = function () {
return 'HeaderValueParam(name=' + this.a1t_1 + ', value=' + this.b1t_1 + ', escapeValue=' + this.c1t_1 + ')';
};
function HeaderValue(value, params) {
params = params === VOID ? emptyList() : params;
this.f1t_1 = value;
this.g1t_1 = params;
var tmp = this;
var tmp0 = this.g1t_1;
var tmp$ret$1;
$l$block: {
// Inline function 'kotlin.collections.firstOrNull' call
var _iterator__ex2g4s = tmp0.q();
while (_iterator__ex2g4s.r()) {
var element = _iterator__ex2g4s.s();
if (element.a1t_1 === 'q') {
tmp$ret$1 = element;
break $l$block;
}
}
tmp$ret$1 = null;
}
var tmp0_safe_receiver = tmp$ret$1;
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.b1t_1;
var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : toDoubleOrNull(tmp1_safe_receiver);
var tmp_0;
if (tmp2_safe_receiver == null) {
tmp_0 = null;
} else {
// Inline function 'kotlin.takeIf' call
var tmp_1;
if (0.0 <= tmp2_safe_receiver ? tmp2_safe_receiver <= 1.0 : false) {
tmp_1 = tmp2_safe_receiver;
} else {
tmp_1 = null;
}
tmp_0 = tmp_1;
}
var tmp3_elvis_lhs = tmp_0;
tmp.h1t_1 = tmp3_elvis_lhs == null ? 1.0 : tmp3_elvis_lhs;
}
protoOf(HeaderValue).toString = function () {
return 'HeaderValue(value=' + this.f1t_1 + ', params=' + toString(this.g1t_1) + ')';
};
protoOf(HeaderValue).hashCode = function () {
var result = getStringHashCode(this.f1t_1);
result = imul(result, 31) + hashCode(this.g1t_1) | 0;
return result;
};
protoOf(HeaderValue).equals = function (other) {
if (this === other)
return true;
if (!(other instanceof HeaderValue))
return false;
if (!(this.f1t_1 === other.f1t_1))
return false;
if (!equals_0(this.g1t_1, other.g1t_1))
return false;
return true;
};
f