@doordeck/doordeck-headless-sdk 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +2 -0
  2. package/kotlin/Kotlin-DateTime-library-kotlinx-datetime.js +5545 -0
  3. package/kotlin/Kotlin-DateTime-library-kotlinx-datetime.js.map +1 -0
  4. package/kotlin/KotlinMultiplatformLibsodium-multiplatform-crypto-libsodium-bindings.js +255 -0
  5. package/kotlin/KotlinMultiplatformLibsodium-multiplatform-crypto-libsodium-bindings.js.map +1 -0
  6. package/kotlin/MultiplatformSettings-multiplatform-settings.js +41 -0
  7. package/kotlin/MultiplatformSettings-multiplatform-settings.js.map +1 -0
  8. package/kotlin/Stately-stately-concurrency.js +32 -0
  9. package/kotlin/Stately-stately-concurrency.js.map +1 -0
  10. package/kotlin/Stately-stately-concurrent-collections.js +304 -0
  11. package/kotlin/Stately-stately-concurrent-collections.js.map +1 -0
  12. package/kotlin/Stately-stately-strict.js +12 -0
  13. package/kotlin/Stately-stately-strict.js.map +1 -0
  14. package/kotlin/doordeck-sdk.d.ts +1325 -0
  15. package/kotlin/doordeck-sdk.js +33503 -0
  16. package/kotlin/doordeck-sdk.js.map +1 -0
  17. package/kotlin/kotlin-kotlin-stdlib.js +14474 -0
  18. package/kotlin/kotlin-kotlin-stdlib.js.map +1 -0
  19. package/kotlin/kotlin-kotlinx-atomicfu-runtime.js +8 -0
  20. package/kotlin/kotlin-kotlinx-atomicfu-runtime.js.map +1 -0
  21. package/kotlin/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +8 -0
  22. package/kotlin/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -0
  23. package/kotlin/kotlinx-atomicfu.js +249 -0
  24. package/kotlin/kotlinx-atomicfu.js.map +1 -0
  25. package/kotlin/kotlinx-coroutines-core.js +8784 -0
  26. package/kotlin/kotlinx-coroutines-core.js.map +1 -0
  27. package/kotlin/kotlinx-io-kotlinx-io-bytestring.js +8 -0
  28. package/kotlin/kotlinx-io-kotlinx-io-bytestring.js.map +1 -0
  29. package/kotlin/kotlinx-io-kotlinx-io-core.js +1333 -0
  30. package/kotlin/kotlinx-io-kotlinx-io-core.js.map +1 -0
  31. package/kotlin/kotlinx-serialization-kotlinx-serialization-core.js +5908 -0
  32. package/kotlin/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -0
  33. package/kotlin/kotlinx-serialization-kotlinx-serialization-json.js +4740 -0
  34. package/kotlin/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -0
  35. package/kotlin/ktor-ktor-client-ktor-client-core.js +8407 -0
  36. package/kotlin/ktor-ktor-client-ktor-client-core.js.map +1 -0
  37. package/kotlin/ktor-ktor-client-ktor-client-js.js +8 -0
  38. package/kotlin/ktor-ktor-client-ktor-client-js.js.map +1 -0
  39. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-auth.js +1146 -0
  40. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-auth.js.map +1 -0
  41. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-content-negotiation.js +647 -0
  42. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-content-negotiation.js.map +1 -0
  43. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-encoding.js +8 -0
  44. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-encoding.js.map +1 -0
  45. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-logging.js +8 -0
  46. package/kotlin/ktor-ktor-client-ktor-client-plugins-ktor-client-logging.js.map +1 -0
  47. package/kotlin/ktor-ktor-http.js +3638 -0
  48. package/kotlin/ktor-ktor-http.js.map +1 -0
  49. package/kotlin/ktor-ktor-io.js +2249 -0
  50. package/kotlin/ktor-ktor-io.js.map +1 -0
  51. package/kotlin/ktor-ktor-shared-ktor-events.js +84 -0
  52. package/kotlin/ktor-ktor-shared-ktor-events.js.map +1 -0
  53. package/kotlin/ktor-ktor-shared-ktor-serialization-ktor-serialization-kotlinx-ktor-serialization-kotlinx-json.js +47 -0
  54. package/kotlin/ktor-ktor-shared-ktor-serialization-ktor-serialization-kotlinx-ktor-serialization-kotlinx-json.js.map +1 -0
  55. package/kotlin/ktor-ktor-shared-ktor-serialization-ktor-serialization-kotlinx.js +857 -0
  56. package/kotlin/ktor-ktor-shared-ktor-serialization-ktor-serialization-kotlinx.js.map +1 -0
  57. package/kotlin/ktor-ktor-shared-ktor-serialization.js +365 -0
  58. package/kotlin/ktor-ktor-shared-ktor-serialization.js.map +1 -0
  59. package/kotlin/ktor-ktor-shared-ktor-sse.js +8 -0
  60. package/kotlin/ktor-ktor-shared-ktor-sse.js.map +1 -0
  61. package/kotlin/ktor-ktor-shared-ktor-websocket-serialization.js +8 -0
  62. package/kotlin/ktor-ktor-shared-ktor-websocket-serialization.js.map +1 -0
  63. package/kotlin/ktor-ktor-shared-ktor-websockets.js +424 -0
  64. package/kotlin/ktor-ktor-shared-ktor-websockets.js.map +1 -0
  65. package/kotlin/ktor-ktor-utils.js +2393 -0
  66. package/kotlin/ktor-ktor-utils.js.map +1 -0
  67. package/kotlin/projects-core-koin-core.js +1134 -0
  68. package/kotlin/projects-core-koin-core.js.map +1 -0
  69. package/kotlin/uuid.js +152 -0
  70. package/kotlin/uuid.js.map +1 -0
  71. package/package.json +42 -0
@@ -0,0 +1,3638 @@
1
+ (function (_, kotlin_kotlin, kotlin_io_ktor_ktor_io, kotlin_io_ktor_ktor_utils) {
2
+ 'use strict';
3
+ //region block: imports
4
+ var imul = Math.imul;
5
+ var VOID = kotlin_kotlin.$_$.f;
6
+ var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.g1;
7
+ var Charsets_getInstance = kotlin_io_ktor_ktor_io.$_$.h;
8
+ var encode = kotlin_io_ktor_ktor_io.$_$.l;
9
+ var Unit_instance = kotlin_kotlin.$_$.k5;
10
+ var takeWhile = kotlin_io_ktor_ktor_io.$_$.z;
11
+ var charArray = kotlin_kotlin.$_$.ea;
12
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.r2;
13
+ var concatToString = kotlin_kotlin.$_$.kc;
14
+ var charSequenceGet = kotlin_kotlin.$_$.fa;
15
+ var toString = kotlin_kotlin.$_$.vb;
16
+ var Char = kotlin_kotlin.$_$.pe;
17
+ var isSurrogate = kotlin_kotlin.$_$.ad;
18
+ var Char__plus_impl_qi7pgj = kotlin_kotlin.$_$.v2;
19
+ var Char__minus_impl_a2frrh = kotlin_kotlin.$_$.u2;
20
+ var StringBuilder_init_$Create$_0 = kotlin_kotlin.$_$.f1;
21
+ var charSequenceLength = kotlin_kotlin.$_$.ga;
22
+ var charSequenceSubSequence = kotlin_kotlin.$_$.ha;
23
+ var toString_0 = kotlin_kotlin.$_$.y2;
24
+ var toByte = kotlin_kotlin.$_$.sb;
25
+ var String_0 = kotlin_io_ktor_ktor_io.$_$.q;
26
+ var Exception = kotlin_kotlin.$_$.we;
27
+ var Exception_init_$Init$ = kotlin_kotlin.$_$.n1;
28
+ var captureStack = kotlin_kotlin.$_$.ca;
29
+ var protoOf = kotlin_kotlin.$_$.rb;
30
+ var initMetadataForClass = kotlin_kotlin.$_$.ra;
31
+ var Char__minus_impl_a2frrh_0 = kotlin_kotlin.$_$.t2;
32
+ var numberToChar = kotlin_kotlin.$_$.nb;
33
+ var canRead = kotlin_io_ktor_ktor_io.$_$.s;
34
+ var Char__rangeTo_impl_tkncvp = kotlin_kotlin.$_$.w2;
35
+ var plus = kotlin_kotlin.$_$.d8;
36
+ var plus_0 = kotlin_kotlin.$_$.e8;
37
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.i6;
38
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.m;
39
+ var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.x2;
40
+ var toSet = kotlin_kotlin.$_$.y8;
41
+ var setOf = kotlin_kotlin.$_$.l8;
42
+ var plus_1 = kotlin_kotlin.$_$.c8;
43
+ var listOf = kotlin_kotlin.$_$.y7;
44
+ var emptyList = kotlin_kotlin.$_$.b7;
45
+ var objectCreate = kotlin_kotlin.$_$.qb;
46
+ var equals = kotlin_kotlin.$_$.tc;
47
+ var Collection = kotlin_kotlin.$_$.m5;
48
+ var isInterface = kotlin_kotlin.$_$.gb;
49
+ var isBlank = kotlin_kotlin.$_$.yc;
50
+ var last = kotlin_kotlin.$_$.w7;
51
+ var indexOf = kotlin_kotlin.$_$.xc;
52
+ var THROW_CCE = kotlin_kotlin.$_$.ef;
53
+ var isCharSequence = kotlin_kotlin.$_$.cb;
54
+ var trim = kotlin_kotlin.$_$.le;
55
+ var contains = kotlin_kotlin.$_$.nc;
56
+ var initMetadataForCompanion = kotlin_kotlin.$_$.sa;
57
+ var initMetadataForObject = kotlin_kotlin.$_$.xa;
58
+ var plus_2 = kotlin_kotlin.$_$.f8;
59
+ var equals_0 = kotlin_kotlin.$_$.ka;
60
+ var getStringHashCode = kotlin_kotlin.$_$.pa;
61
+ var hashCode = kotlin_kotlin.$_$.qa;
62
+ var forName = kotlin_io_ktor_ktor_io.$_$.m;
63
+ var IllegalArgumentException = kotlin_kotlin.$_$.xe;
64
+ var get_name = kotlin_io_ktor_ktor_io.$_$.o;
65
+ var get_lastIndex = kotlin_kotlin.$_$.t7;
66
+ var first = kotlin_kotlin.$_$.uc;
67
+ var last_0 = kotlin_kotlin.$_$.ed;
68
+ var get_lastIndex_0 = kotlin_kotlin.$_$.cd;
69
+ var StringValuesBuilderImpl = kotlin_io_ktor_ktor_utils.$_$.u;
70
+ var emptySet = kotlin_kotlin.$_$.d7;
71
+ var get = kotlin_io_ktor_ktor_utils.$_$.t;
72
+ var forEach = kotlin_io_ktor_ktor_utils.$_$.s;
73
+ var StringValues = kotlin_io_ktor_ktor_utils.$_$.w;
74
+ var StringValuesImpl = kotlin_io_ktor_ktor_utils.$_$.v;
75
+ var emptyMap = kotlin_kotlin.$_$.c7;
76
+ var toDoubleOrNull = kotlin_kotlin.$_$.xd;
77
+ var LazyThreadSafetyMode_NONE_getInstance = kotlin_kotlin.$_$.h;
78
+ var lazy = kotlin_kotlin.$_$.ag;
79
+ var to = kotlin_kotlin.$_$.gg;
80
+ var sortedWith = kotlin_kotlin.$_$.p8;
81
+ var FunctionAdapter = kotlin_kotlin.$_$.y9;
82
+ var Comparator = kotlin_kotlin.$_$.re;
83
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.n;
84
+ var compareValues = kotlin_kotlin.$_$.c9;
85
+ var asList = kotlin_kotlin.$_$.d6;
86
+ var Char__compareTo_impl_ypi4mb = kotlin_kotlin.$_$.s2;
87
+ var IllegalArgumentException_init_$Init$ = kotlin_kotlin.$_$.t1;
88
+ var toLong = kotlin_kotlin.$_$.ce;
89
+ var mapCapacity = kotlin_kotlin.$_$.z7;
90
+ var coerceAtLeast = kotlin_kotlin.$_$.yb;
91
+ var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.v;
92
+ var Comparable = kotlin_kotlin.$_$.qe;
93
+ var initMetadataForInterface = kotlin_kotlin.$_$.va;
94
+ var isWhitespace = kotlin_kotlin.$_$.bd;
95
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.u1;
96
+ var charArrayOf = kotlin_kotlin.$_$.da;
97
+ var split = kotlin_kotlin.$_$.ld;
98
+ var toMutableList = kotlin_kotlin.$_$.w8;
99
+ var first_0 = kotlin_kotlin.$_$.h7;
100
+ var joinToString = kotlin_kotlin.$_$.q7;
101
+ var startsWith = kotlin_kotlin.$_$.od;
102
+ var toCharArray = kotlin_io_ktor_ktor_utils.$_$.d1;
103
+ var indexOfAny = kotlin_kotlin.$_$.vc;
104
+ var dropLast = kotlin_kotlin.$_$.z6;
105
+ var IllegalStateException = kotlin_kotlin.$_$.ye;
106
+ var IllegalStateException_init_$Init$ = kotlin_kotlin.$_$.z1;
107
+ var indexOf_0 = kotlin_kotlin.$_$.wc;
108
+ var toInt = kotlin_kotlin.$_$.ae;
109
+ var listOf_0 = kotlin_kotlin.$_$.x7;
110
+ var toLowerCasePreservingASCIIRules = kotlin_io_ktor_ktor_utils.$_$.e1;
111
+ var isLowerCase = kotlin_io_ktor_ktor_utils.$_$.a1;
112
+ var appendAll = kotlin_io_ktor_ktor_utils.$_$.x;
113
+ var startsWith_0 = kotlin_kotlin.$_$.nd;
114
+ var addAll = kotlin_kotlin.$_$.a6;
115
+ var joinTo = kotlin_kotlin.$_$.r7;
116
+ var toString_1 = kotlin_kotlin.$_$.fg;
117
+ var lazy_0 = kotlin_kotlin.$_$.bg;
118
+ var getKClassFromExpression = kotlin_kotlin.$_$.d;
119
+ var KProperty1 = kotlin_kotlin.$_$.ic;
120
+ var getPropertyCallableRef = kotlin_kotlin.$_$.oa;
121
+ var Enum = kotlin_kotlin.$_$.ue;
122
+ var noWhenBranchMatchedException = kotlin_kotlin.$_$.cg;
123
+ var Hash_instance = kotlin_io_ktor_ktor_utils.$_$.b;
124
+ var until = kotlin_kotlin.$_$.dc;
125
+ var substring = kotlin_kotlin.$_$.sd;
126
+ var LinkedHashMap_init_$Create$_0 = kotlin_kotlin.$_$.w;
127
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.y1;
128
+ var takeLast = kotlin_kotlin.$_$.td;
129
+ var Regex_init_$Create$ = kotlin_kotlin.$_$.e1;
130
+ var toLong_0 = kotlin_kotlin.$_$.tb;
131
+ var toByteArray = kotlin_io_ktor_ktor_io.$_$.a1;
132
+ var take = kotlin_kotlin.$_$.ud;
133
+ var IllegalArgumentException_init_$Init$_0 = kotlin_kotlin.$_$.v1;
134
+ var defineProp = kotlin_kotlin.$_$.ja;
135
+ var PlatformUtils_getInstance = kotlin_io_ktor_ktor_utils.$_$.c;
136
+ var get_platform = kotlin_io_ktor_ktor_utils.$_$.b1;
137
+ //endregion
138
+ //region block: pre-declaration
139
+ initMetadataForClass(URLDecodeException, 'URLDecodeException', VOID, Exception);
140
+ initMetadataForCompanion(Companion);
141
+ initMetadataForObject(Application, 'Application');
142
+ initMetadataForObject(Text, 'Text');
143
+ initMetadataForClass(HeaderValueWithParameters, 'HeaderValueWithParameters');
144
+ initMetadataForClass(ContentType, 'ContentType', VOID, HeaderValueWithParameters);
145
+ initMetadataForClass(BadContentTypeFormatException, 'BadContentTypeFormatException', VOID, Exception);
146
+ initMetadataForCompanion(Companion_0);
147
+ initMetadataForCompanion(Companion_1);
148
+ initMetadataForClass(HeadersBuilder, 'HeadersBuilder', HeadersBuilder, StringValuesBuilderImpl);
149
+ initMetadataForObject(EmptyHeaders, 'EmptyHeaders', VOID, VOID, [StringValues]);
150
+ initMetadataForClass(HeadersImpl, 'HeadersImpl', HeadersImpl, StringValuesImpl, [StringValues, StringValuesImpl]);
151
+ initMetadataForClass(HeaderValueParam, 'HeaderValueParam');
152
+ initMetadataForClass(HeaderValue, 'HeaderValue');
153
+ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
154
+ initMetadataForObject(HttpHeaders, 'HttpHeaders');
155
+ initMetadataForClass(IllegalHeaderNameException, 'IllegalHeaderNameException', VOID, IllegalArgumentException);
156
+ initMetadataForClass(IllegalHeaderValueException, 'IllegalHeaderValueException', VOID, IllegalArgumentException);
157
+ initMetadataForClass(UnsafeHeaderException, 'UnsafeHeaderException', VOID, IllegalArgumentException);
158
+ initMetadataForCompanion(Companion_2);
159
+ initMetadataForClass(HttpMethod, 'HttpMethod');
160
+ initMetadataForCompanion(Companion_3);
161
+ initMetadataForClass(HttpProtocolVersion, 'HttpProtocolVersion');
162
+ initMetadataForCompanion(Companion_4);
163
+ initMetadataForClass(HttpStatusCode, 'HttpStatusCode', VOID, VOID, [Comparable]);
164
+ initMetadataForCompanion(Companion_5);
165
+ initMetadataForInterface(Parameters, 'Parameters', VOID, VOID, [StringValues]);
166
+ initMetadataForObject(EmptyParameters, 'EmptyParameters', VOID, VOID, [Parameters]);
167
+ initMetadataForClass(ParametersBuilderImpl, 'ParametersBuilderImpl', ParametersBuilderImpl, StringValuesBuilderImpl);
168
+ initMetadataForClass(ParametersImpl, 'ParametersImpl', ParametersImpl, StringValuesImpl, [Parameters, StringValuesImpl]);
169
+ initMetadataForCompanion(Companion_6);
170
+ initMetadataForClass(URLBuilder, 'URLBuilder', URLBuilder);
171
+ initMetadataForClass(URLParserException, 'URLParserException', VOID, IllegalStateException);
172
+ initMetadataForCompanion(Companion_7);
173
+ initMetadataForClass(URLProtocol, 'URLProtocol');
174
+ initMetadataForCompanion(Companion_8);
175
+ initMetadataForClass(Url_0, 'Url');
176
+ initMetadataForClass(UrlDecodedParametersBuilder, 'UrlDecodedParametersBuilder');
177
+ initMetadataForClass(HeaderValueEncoding, 'HeaderValueEncoding', VOID, Enum);
178
+ initMetadataForClass(HttpAuthHeader, 'HttpAuthHeader');
179
+ initMetadataForClass(Single, 'Single', VOID, HttpAuthHeader);
180
+ initMetadataForClass(Parameterized, 'Parameterized', VOID, HttpAuthHeader);
181
+ initMetadataForCompanion(Companion_9);
182
+ initMetadataForClass(OutgoingContent, 'OutgoingContent');
183
+ initMetadataForClass(ByteArrayContent_0, 'ByteArrayContent', VOID, OutgoingContent);
184
+ initMetadataForClass(ByteArrayContent, 'ByteArrayContent', VOID, ByteArrayContent_0);
185
+ initMetadataForClass(NoContent, 'NoContent', VOID, OutgoingContent);
186
+ initMetadataForClass(ReadChannelContent, 'ReadChannelContent', VOID, OutgoingContent);
187
+ initMetadataForClass(WriteChannelContent, 'WriteChannelContent', VOID, OutgoingContent, VOID, [1]);
188
+ initMetadataForClass(ProtocolUpgrade, 'ProtocolUpgrade', VOID, OutgoingContent, VOID, [4]);
189
+ initMetadataForClass(ContentWrapper, 'ContentWrapper', VOID, OutgoingContent);
190
+ initMetadataForObject(NullBody, 'NullBody');
191
+ initMetadataForClass(TextContent, 'TextContent', VOID, ByteArrayContent_0);
192
+ initMetadataForClass(ParseException, 'ParseException', VOID, IllegalArgumentException);
193
+ //endregion
194
+ function get_URL_ALPHABET() {
195
+ _init_properties_Codecs_kt__fudxxf();
196
+ return URL_ALPHABET;
197
+ }
198
+ var URL_ALPHABET;
199
+ function get_URL_ALPHABET_CHARS() {
200
+ _init_properties_Codecs_kt__fudxxf();
201
+ return URL_ALPHABET_CHARS;
202
+ }
203
+ var URL_ALPHABET_CHARS;
204
+ function get_HEX_ALPHABET() {
205
+ _init_properties_Codecs_kt__fudxxf();
206
+ return HEX_ALPHABET;
207
+ }
208
+ var HEX_ALPHABET;
209
+ function get_URL_PROTOCOL_PART() {
210
+ _init_properties_Codecs_kt__fudxxf();
211
+ return URL_PROTOCOL_PART;
212
+ }
213
+ var URL_PROTOCOL_PART;
214
+ function get_VALID_PATH_PART() {
215
+ _init_properties_Codecs_kt__fudxxf();
216
+ return VALID_PATH_PART;
217
+ }
218
+ var VALID_PATH_PART;
219
+ var ATTRIBUTE_CHARACTERS;
220
+ function get_SPECIAL_SYMBOLS() {
221
+ _init_properties_Codecs_kt__fudxxf();
222
+ return SPECIAL_SYMBOLS;
223
+ }
224
+ var SPECIAL_SYMBOLS;
225
+ function encodeURLParameter(_this__u8e3s4, spaceToPlus) {
226
+ spaceToPlus = spaceToPlus === VOID ? false : spaceToPlus;
227
+ _init_properties_Codecs_kt__fudxxf();
228
+ // Inline function 'kotlin.text.buildString' call
229
+ // Inline function 'kotlin.contracts.contract' call
230
+ // Inline function 'kotlin.apply' call
231
+ var this_0 = StringBuilder_init_$Create$();
232
+ // Inline function 'kotlin.contracts.contract' call
233
+ // Inline function 'io.ktor.http.encodeURLParameter.<anonymous>' call
234
+ var content = encode(Charsets_getInstance().a1i_1.e1i(), _this__u8e3s4);
235
+ forEach_0(content, encodeURLParameter$lambda(this_0, spaceToPlus));
236
+ return this_0.toString();
237
+ }
238
+ function decodeURLPart(_this__u8e3s4, start, end, charset) {
239
+ start = start === VOID ? 0 : start;
240
+ end = end === VOID ? _this__u8e3s4.length : end;
241
+ charset = charset === VOID ? Charsets_getInstance().a1i_1 : charset;
242
+ _init_properties_Codecs_kt__fudxxf();
243
+ return decodeScan(_this__u8e3s4, start, end, false, charset);
244
+ }
245
+ function encodeURLQueryComponent(_this__u8e3s4, encodeFull, spaceToPlus, charset) {
246
+ encodeFull = encodeFull === VOID ? false : encodeFull;
247
+ spaceToPlus = spaceToPlus === VOID ? false : spaceToPlus;
248
+ charset = charset === VOID ? Charsets_getInstance().a1i_1 : charset;
249
+ _init_properties_Codecs_kt__fudxxf();
250
+ // Inline function 'kotlin.text.buildString' call
251
+ // Inline function 'kotlin.contracts.contract' call
252
+ // Inline function 'kotlin.apply' call
253
+ var this_0 = StringBuilder_init_$Create$();
254
+ // Inline function 'kotlin.contracts.contract' call
255
+ // Inline function 'io.ktor.http.encodeURLQueryComponent.<anonymous>' call
256
+ var content = encode(charset.e1i(), _this__u8e3s4);
257
+ forEach_0(content, encodeURLQueryComponent$lambda(spaceToPlus, this_0, encodeFull));
258
+ return this_0.toString();
259
+ }
260
+ function decodeURLQueryComponent(_this__u8e3s4, start, end, plusIsSpace, charset) {
261
+ start = start === VOID ? 0 : start;
262
+ end = end === VOID ? _this__u8e3s4.length : end;
263
+ plusIsSpace = plusIsSpace === VOID ? false : plusIsSpace;
264
+ charset = charset === VOID ? Charsets_getInstance().a1i_1 : charset;
265
+ _init_properties_Codecs_kt__fudxxf();
266
+ return decodeScan(_this__u8e3s4, start, end, plusIsSpace, charset);
267
+ }
268
+ function encodeURLPathPart(_this__u8e3s4) {
269
+ _init_properties_Codecs_kt__fudxxf();
270
+ return encodeURLPath(_this__u8e3s4, true);
271
+ }
272
+ function forEach_0(_this__u8e3s4, block) {
273
+ _init_properties_Codecs_kt__fudxxf();
274
+ takeWhile(_this__u8e3s4, forEach$lambda(block));
275
+ }
276
+ function percentEncode(_this__u8e3s4) {
277
+ _init_properties_Codecs_kt__fudxxf();
278
+ var code = _this__u8e3s4 & 255;
279
+ var array = charArray(3);
280
+ array[0] = _Char___init__impl__6a9atx(37);
281
+ array[1] = hexDigitToChar(code >> 4);
282
+ array[2] = hexDigitToChar(code & 15);
283
+ return concatToString(array);
284
+ }
285
+ function decodeScan(_this__u8e3s4, start, end, plusIsSpace, charset) {
286
+ _init_properties_Codecs_kt__fudxxf();
287
+ var inductionVariable = start;
288
+ if (inductionVariable < end)
289
+ do {
290
+ var index = inductionVariable;
291
+ inductionVariable = inductionVariable + 1 | 0;
292
+ var ch = charSequenceGet(_this__u8e3s4, index);
293
+ if (ch === _Char___init__impl__6a9atx(37) || (plusIsSpace && ch === _Char___init__impl__6a9atx(43))) {
294
+ return decodeImpl(_this__u8e3s4, start, end, index, plusIsSpace, charset);
295
+ }
296
+ }
297
+ while (inductionVariable < end);
298
+ var tmp;
299
+ if (start === 0 && end === _this__u8e3s4.length) {
300
+ tmp = toString(_this__u8e3s4);
301
+ } else {
302
+ // Inline function 'kotlin.text.substring' call
303
+ // Inline function 'kotlin.js.asDynamic' call
304
+ tmp = _this__u8e3s4.substring(start, end);
305
+ }
306
+ return tmp;
307
+ }
308
+ function encodeURLPath(_this__u8e3s4, encodeSlash, encodeEncoded) {
309
+ encodeSlash = encodeSlash === VOID ? false : encodeSlash;
310
+ encodeEncoded = encodeEncoded === VOID ? true : encodeEncoded;
311
+ _init_properties_Codecs_kt__fudxxf();
312
+ // Inline function 'kotlin.text.buildString' call
313
+ // Inline function 'kotlin.contracts.contract' call
314
+ // Inline function 'kotlin.apply' call
315
+ var this_0 = StringBuilder_init_$Create$();
316
+ // Inline function 'kotlin.contracts.contract' call
317
+ // Inline function 'io.ktor.http.encodeURLPath.<anonymous>' call
318
+ var charset = Charsets_getInstance().a1i_1;
319
+ var index = 0;
320
+ $l$loop_0: while (index < _this__u8e3s4.length) {
321
+ var current = charSequenceGet(_this__u8e3s4, index);
322
+ if (!encodeSlash && current === _Char___init__impl__6a9atx(47) || get_URL_ALPHABET_CHARS().s1(new Char(current)) || get_VALID_PATH_PART().s1(new Char(current))) {
323
+ this_0.k8(current);
324
+ index = index + 1 | 0;
325
+ continue $l$loop_0;
326
+ }
327
+ if (!encodeEncoded && current === _Char___init__impl__6a9atx(37) && (index + 2 | 0) < _this__u8e3s4.length && get_HEX_ALPHABET().s1(new Char(charSequenceGet(_this__u8e3s4, index + 1 | 0))) && get_HEX_ALPHABET().s1(new Char(charSequenceGet(_this__u8e3s4, index + 2 | 0)))) {
328
+ this_0.k8(current);
329
+ this_0.k8(charSequenceGet(_this__u8e3s4, index + 1 | 0));
330
+ this_0.k8(charSequenceGet(_this__u8e3s4, index + 2 | 0));
331
+ index = index + 3 | 0;
332
+ continue $l$loop_0;
333
+ }
334
+ var symbolSize = isSurrogate(current) ? 2 : 1;
335
+ var tmp = encode(charset.e1i(), _this__u8e3s4, index, index + symbolSize | 0);
336
+ forEach_0(tmp, encodeURLPath$lambda(this_0));
337
+ index = index + symbolSize | 0;
338
+ }
339
+ return this_0.toString();
340
+ }
341
+ function hexDigitToChar(digit) {
342
+ _init_properties_Codecs_kt__fudxxf();
343
+ 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);
344
+ }
345
+ function decodeImpl(_this__u8e3s4, start, end, prefixEnd, plusIsSpace, charset) {
346
+ _init_properties_Codecs_kt__fudxxf();
347
+ var length = end - start | 0;
348
+ var sbSize = length > 255 ? length / 3 | 0 : length;
349
+ var sb = StringBuilder_init_$Create$_0(sbSize);
350
+ if (prefixEnd > start) {
351
+ sb.dc(_this__u8e3s4, start, prefixEnd);
352
+ }
353
+ var index = prefixEnd;
354
+ var bytes = null;
355
+ while (index < end) {
356
+ var c = charSequenceGet(_this__u8e3s4, index);
357
+ if (plusIsSpace && c === _Char___init__impl__6a9atx(43)) {
358
+ sb.k8(_Char___init__impl__6a9atx(32));
359
+ index = index + 1 | 0;
360
+ } else if (c === _Char___init__impl__6a9atx(37)) {
361
+ if (bytes == null) {
362
+ bytes = new Int8Array((end - index | 0) / 3 | 0);
363
+ }
364
+ var count = 0;
365
+ while (index < end && charSequenceGet(_this__u8e3s4, index) === _Char___init__impl__6a9atx(37)) {
366
+ if ((index + 2 | 0) >= end) {
367
+ // Inline function 'kotlin.text.substring' call
368
+ var startIndex = index;
369
+ var endIndex = charSequenceLength(_this__u8e3s4);
370
+ var tmp$ret$0 = toString(charSequenceSubSequence(_this__u8e3s4, startIndex, endIndex));
371
+ throw new URLDecodeException('Incomplete trailing HEX escape: ' + tmp$ret$0 + ', in ' + toString(_this__u8e3s4) + ' at ' + index);
372
+ }
373
+ var digit1 = charToHexDigit(charSequenceGet(_this__u8e3s4, index + 1 | 0));
374
+ var digit2 = charToHexDigit(charSequenceGet(_this__u8e3s4, index + 2 | 0));
375
+ if (digit1 === -1 || digit2 === -1) {
376
+ 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);
377
+ }
378
+ var tmp = bytes;
379
+ var _unary__edvuaz = count;
380
+ count = _unary__edvuaz + 1 | 0;
381
+ tmp[_unary__edvuaz] = toByte(imul(digit1, 16) + digit2 | 0);
382
+ index = index + 3 | 0;
383
+ }
384
+ sb.j8(String_0(bytes, 0, count, charset));
385
+ } else {
386
+ sb.k8(c);
387
+ index = index + 1 | 0;
388
+ }
389
+ }
390
+ return sb.toString();
391
+ }
392
+ function URLDecodeException(message) {
393
+ Exception_init_$Init$(message, this);
394
+ captureStack(this, URLDecodeException);
395
+ }
396
+ function charToHexDigit(c2) {
397
+ _init_properties_Codecs_kt__fudxxf();
398
+ 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;
399
+ }
400
+ function encodeURLParameterValue(_this__u8e3s4) {
401
+ _init_properties_Codecs_kt__fudxxf();
402
+ return encodeURLParameter(_this__u8e3s4, true);
403
+ }
404
+ function encodeURLParameter$lambda($$this$buildString, $spaceToPlus) {
405
+ return function (it) {
406
+ if (get_URL_ALPHABET().s1(it) || get_SPECIAL_SYMBOLS().s1(it))
407
+ $$this$buildString.k8(numberToChar(it));
408
+ else if ($spaceToPlus && it === 32)
409
+ $$this$buildString.k8(_Char___init__impl__6a9atx(43));
410
+ else
411
+ $$this$buildString.j8(percentEncode(it));
412
+ return Unit_instance;
413
+ };
414
+ }
415
+ function encodeURLQueryComponent$lambda($spaceToPlus, $$this$buildString, $encodeFull) {
416
+ return function (it) {
417
+ if (it === 32)
418
+ if ($spaceToPlus)
419
+ $$this$buildString.k8(_Char___init__impl__6a9atx(43));
420
+ else
421
+ $$this$buildString.j8('%20');
422
+ else if (get_URL_ALPHABET().s1(it) || (!$encodeFull && get_URL_PROTOCOL_PART().s1(it)))
423
+ $$this$buildString.k8(numberToChar(it));
424
+ else
425
+ $$this$buildString.j8(percentEncode(it));
426
+ return Unit_instance;
427
+ };
428
+ }
429
+ function forEach$lambda($block) {
430
+ return function (buffer) {
431
+ while (canRead(buffer)) {
432
+ $block(buffer.r19());
433
+ }
434
+ return true;
435
+ };
436
+ }
437
+ function encodeURLPath$lambda($$this$buildString) {
438
+ return function (it) {
439
+ $$this$buildString.j8(percentEncode(it));
440
+ return Unit_instance;
441
+ };
442
+ }
443
+ var properties_initialized_Codecs_kt_hkj9s1;
444
+ function _init_properties_Codecs_kt__fudxxf() {
445
+ if (!properties_initialized_Codecs_kt_hkj9s1) {
446
+ properties_initialized_Codecs_kt_hkj9s1 = true;
447
+ // Inline function 'kotlin.collections.map' call
448
+ 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)));
449
+ // Inline function 'kotlin.collections.mapTo' call
450
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
451
+ var tmp0_iterator = this_0.j();
452
+ while (tmp0_iterator.k()) {
453
+ var item = tmp0_iterator.l();
454
+ // Inline function 'io.ktor.http.URL_ALPHABET.<anonymous>' call
455
+ // Inline function 'kotlin.code' call
456
+ var this_1 = item.g1_1;
457
+ var tmp$ret$0 = Char__toInt_impl_vasixd(this_1);
458
+ var tmp$ret$1 = toByte(tmp$ret$0);
459
+ destination.e(tmp$ret$1);
460
+ }
461
+ URL_ALPHABET = toSet(destination);
462
+ 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))));
463
+ 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))));
464
+ // Inline function 'kotlin.collections.map' call
465
+ 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))]);
466
+ // Inline function 'kotlin.collections.mapTo' call
467
+ var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_2, 10));
468
+ var tmp0_iterator_0 = this_2.j();
469
+ while (tmp0_iterator_0.k()) {
470
+ var item_0 = tmp0_iterator_0.l();
471
+ // Inline function 'io.ktor.http.URL_PROTOCOL_PART.<anonymous>' call
472
+ // Inline function 'kotlin.code' call
473
+ var this_3 = item_0.g1_1;
474
+ var tmp$ret$0_0 = Char__toInt_impl_vasixd(this_3);
475
+ var tmp$ret$1_0 = toByte(tmp$ret$0_0);
476
+ destination_0.e(tmp$ret$1_0);
477
+ }
478
+ URL_PROTOCOL_PART = destination_0;
479
+ 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))]);
480
+ 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))]));
481
+ // Inline function 'kotlin.collections.map' call
482
+ 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))]);
483
+ // Inline function 'kotlin.collections.mapTo' call
484
+ var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(this_4, 10));
485
+ var tmp0_iterator_1 = this_4.j();
486
+ while (tmp0_iterator_1.k()) {
487
+ var item_1 = tmp0_iterator_1.l();
488
+ // Inline function 'io.ktor.http.SPECIAL_SYMBOLS.<anonymous>' call
489
+ // Inline function 'kotlin.code' call
490
+ var this_5 = item_1.g1_1;
491
+ var tmp$ret$0_1 = Char__toInt_impl_vasixd(this_5);
492
+ var tmp$ret$1_1 = toByte(tmp$ret$0_1);
493
+ destination_1.e(tmp$ret$1_1);
494
+ }
495
+ SPECIAL_SYMBOLS = destination_1;
496
+ }
497
+ }
498
+ function ContentType_init_$Init$(contentType, contentSubtype, parameters, $this) {
499
+ parameters = parameters === VOID ? emptyList() : parameters;
500
+ ContentType.call($this, contentType, contentSubtype, contentType + '/' + contentSubtype, parameters);
501
+ return $this;
502
+ }
503
+ function ContentType_init_$Create$(contentType, contentSubtype, parameters) {
504
+ return ContentType_init_$Init$(contentType, contentSubtype, parameters, objectCreate(protoOf(ContentType)));
505
+ }
506
+ function hasParameter($this, name, value) {
507
+ var tmp;
508
+ switch ($this.p1p_1.m()) {
509
+ case 0:
510
+ tmp = false;
511
+ break;
512
+ case 1:
513
+ // Inline function 'kotlin.let' call
514
+
515
+ // Inline function 'kotlin.contracts.contract' call
516
+
517
+ // Inline function 'io.ktor.http.ContentType.hasParameter.<anonymous>' call
518
+
519
+ var it = $this.p1p_1.o(0);
520
+ tmp = (equals(it.q1p_1, name, true) && equals(it.r1p_1, value, true));
521
+ break;
522
+ default:
523
+ var tmp$ret$2;
524
+ $l$block_0: {
525
+ // Inline function 'kotlin.collections.any' call
526
+ var this_0 = $this.p1p_1;
527
+ var tmp_0;
528
+ if (isInterface(this_0, Collection)) {
529
+ tmp_0 = this_0.p();
530
+ } else {
531
+ tmp_0 = false;
532
+ }
533
+ if (tmp_0) {
534
+ tmp$ret$2 = false;
535
+ break $l$block_0;
536
+ }
537
+ var tmp0_iterator = this_0.j();
538
+ while (tmp0_iterator.k()) {
539
+ var element = tmp0_iterator.l();
540
+ // Inline function 'io.ktor.http.ContentType.hasParameter.<anonymous>' call
541
+ if (equals(element.q1p_1, name, true) && equals(element.r1p_1, value, true)) {
542
+ tmp$ret$2 = true;
543
+ break $l$block_0;
544
+ }
545
+ }
546
+ tmp$ret$2 = false;
547
+ }
548
+
549
+ tmp = tmp$ret$2;
550
+ break;
551
+ }
552
+ return tmp;
553
+ }
554
+ function Companion() {
555
+ Companion_instance = this;
556
+ this.t1p_1 = ContentType_init_$Create$('*', '*');
557
+ }
558
+ protoOf(Companion).u1p = function (value) {
559
+ if (isBlank(value))
560
+ return this.t1p_1;
561
+ // Inline function 'io.ktor.http.Companion.parse' call
562
+ var headerValue = last(parseHeaderValue(value));
563
+ // Inline function 'io.ktor.http.Companion.parse.<anonymous>' call
564
+ var parts = headerValue.v1p_1;
565
+ var parameters = headerValue.w1p_1;
566
+ var slash = indexOf(parts, _Char___init__impl__6a9atx(47));
567
+ if (slash === -1) {
568
+ // Inline function 'kotlin.text.trim' call
569
+ if (toString(trim(isCharSequence(parts) ? parts : THROW_CCE())) === '*')
570
+ return Companion_getInstance().t1p_1;
571
+ throw new BadContentTypeFormatException(value);
572
+ }
573
+ // Inline function 'kotlin.text.trim' call
574
+ // Inline function 'kotlin.text.substring' call
575
+ // Inline function 'kotlin.js.asDynamic' call
576
+ var this_0 = parts.substring(0, slash);
577
+ var type = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
578
+ // Inline function 'kotlin.text.isEmpty' call
579
+ if (charSequenceLength(type) === 0) {
580
+ throw new BadContentTypeFormatException(value);
581
+ }
582
+ // Inline function 'kotlin.text.trim' call
583
+ // Inline function 'kotlin.text.substring' call
584
+ var startIndex = slash + 1 | 0;
585
+ // Inline function 'kotlin.js.asDynamic' call
586
+ var this_1 = parts.substring(startIndex);
587
+ var subtype = toString(trim(isCharSequence(this_1) ? this_1 : THROW_CCE()));
588
+ if (contains(type, _Char___init__impl__6a9atx(32)) || contains(subtype, _Char___init__impl__6a9atx(32))) {
589
+ throw new BadContentTypeFormatException(value);
590
+ }
591
+ var tmp;
592
+ // Inline function 'kotlin.text.isEmpty' call
593
+ if (charSequenceLength(subtype) === 0) {
594
+ tmp = true;
595
+ } else {
596
+ tmp = contains(subtype, _Char___init__impl__6a9atx(47));
597
+ }
598
+ if (tmp) {
599
+ throw new BadContentTypeFormatException(value);
600
+ }
601
+ return ContentType_init_$Create$(type, subtype, parameters);
602
+ };
603
+ var Companion_instance;
604
+ function Companion_getInstance() {
605
+ if (Companion_instance == null)
606
+ new Companion();
607
+ return Companion_instance;
608
+ }
609
+ function Application() {
610
+ Application_instance = this;
611
+ this.y1p_1 = ContentType_init_$Create$('application', '*');
612
+ this.z1p_1 = ContentType_init_$Create$('application', 'atom+xml');
613
+ this.a1q_1 = ContentType_init_$Create$('application', 'cbor');
614
+ this.b1q_1 = ContentType_init_$Create$('application', 'json');
615
+ this.c1q_1 = ContentType_init_$Create$('application', 'hal+json');
616
+ this.d1q_1 = ContentType_init_$Create$('application', 'javascript');
617
+ this.e1q_1 = ContentType_init_$Create$('application', 'octet-stream');
618
+ this.f1q_1 = ContentType_init_$Create$('application', 'rss+xml');
619
+ this.g1q_1 = ContentType_init_$Create$('application', 'soap+xml');
620
+ this.h1q_1 = ContentType_init_$Create$('application', 'xml');
621
+ this.i1q_1 = ContentType_init_$Create$('application', 'xml-dtd');
622
+ this.j1q_1 = ContentType_init_$Create$('application', 'zip');
623
+ this.k1q_1 = ContentType_init_$Create$('application', 'gzip');
624
+ this.l1q_1 = ContentType_init_$Create$('application', 'x-www-form-urlencoded');
625
+ this.m1q_1 = ContentType_init_$Create$('application', 'pdf');
626
+ this.n1q_1 = ContentType_init_$Create$('application', 'vnd.openxmlformats-officedocument.spreadsheetml.sheet');
627
+ this.o1q_1 = ContentType_init_$Create$('application', 'vnd.openxmlformats-officedocument.wordprocessingml.document');
628
+ this.p1q_1 = ContentType_init_$Create$('application', 'vnd.openxmlformats-officedocument.presentationml.presentation');
629
+ this.q1q_1 = ContentType_init_$Create$('application', 'protobuf');
630
+ this.r1q_1 = ContentType_init_$Create$('application', 'wasm');
631
+ this.s1q_1 = ContentType_init_$Create$('application', 'problem+json');
632
+ this.t1q_1 = ContentType_init_$Create$('application', 'problem+xml');
633
+ }
634
+ var Application_instance;
635
+ function Application_getInstance() {
636
+ if (Application_instance == null)
637
+ new Application();
638
+ return Application_instance;
639
+ }
640
+ function Text() {
641
+ Text_instance = this;
642
+ this.u1q_1 = ContentType_init_$Create$('text', '*');
643
+ this.v1q_1 = ContentType_init_$Create$('text', 'plain');
644
+ this.w1q_1 = ContentType_init_$Create$('text', 'css');
645
+ this.x1q_1 = ContentType_init_$Create$('text', 'csv');
646
+ this.y1q_1 = ContentType_init_$Create$('text', 'html');
647
+ this.z1q_1 = ContentType_init_$Create$('text', 'javascript');
648
+ this.a1r_1 = ContentType_init_$Create$('text', 'vcard');
649
+ this.b1r_1 = ContentType_init_$Create$('text', 'xml');
650
+ this.c1r_1 = ContentType_init_$Create$('text', 'event-stream');
651
+ }
652
+ var Text_instance;
653
+ function Text_getInstance() {
654
+ if (Text_instance == null)
655
+ new Text();
656
+ return Text_instance;
657
+ }
658
+ function ContentType(contentType, contentSubtype, existingContent, parameters) {
659
+ Companion_getInstance();
660
+ parameters = parameters === VOID ? emptyList() : parameters;
661
+ HeaderValueWithParameters.call(this, existingContent, parameters);
662
+ this.f1r_1 = contentType;
663
+ this.g1r_1 = contentSubtype;
664
+ }
665
+ protoOf(ContentType).h1r = function (name, value) {
666
+ if (hasParameter(this, name, value))
667
+ return this;
668
+ return new ContentType(this.f1r_1, this.g1r_1, this.o1p_1, plus_2(this.p1p_1, HeaderValueParam_init_$Create$(name, value)));
669
+ };
670
+ protoOf(ContentType).i1r = function () {
671
+ return this.p1p_1.p() ? this : ContentType_init_$Create$(this.f1r_1, this.g1r_1);
672
+ };
673
+ protoOf(ContentType).j1r = function (pattern) {
674
+ if (!(pattern.f1r_1 === '*') && !equals(pattern.f1r_1, this.f1r_1, true)) {
675
+ return false;
676
+ }
677
+ if (!(pattern.g1r_1 === '*') && !equals(pattern.g1r_1, this.g1r_1, true)) {
678
+ return false;
679
+ }
680
+ var _iterator__ex2g4s = pattern.p1p_1.j();
681
+ while (_iterator__ex2g4s.k()) {
682
+ var _destruct__k2r9zo = _iterator__ex2g4s.l();
683
+ var patternName = _destruct__k2r9zo.eg();
684
+ var patternValue = _destruct__k2r9zo.fg();
685
+ var tmp;
686
+ if (patternName === '*') {
687
+ var tmp_0;
688
+ if (patternValue === '*') {
689
+ tmp_0 = true;
690
+ } else {
691
+ var tmp$ret$0;
692
+ $l$block_0: {
693
+ // Inline function 'kotlin.collections.any' call
694
+ var this_0 = this.p1p_1;
695
+ var tmp_1;
696
+ if (isInterface(this_0, Collection)) {
697
+ tmp_1 = this_0.p();
698
+ } else {
699
+ tmp_1 = false;
700
+ }
701
+ if (tmp_1) {
702
+ tmp$ret$0 = false;
703
+ break $l$block_0;
704
+ }
705
+ var tmp0_iterator = this_0.j();
706
+ while (tmp0_iterator.k()) {
707
+ var element = tmp0_iterator.l();
708
+ // Inline function 'io.ktor.http.ContentType.match.<anonymous>' call
709
+ if (equals(element.r1p_1, patternValue, true)) {
710
+ tmp$ret$0 = true;
711
+ break $l$block_0;
712
+ }
713
+ }
714
+ tmp$ret$0 = false;
715
+ }
716
+ tmp_0 = tmp$ret$0;
717
+ }
718
+ tmp = tmp_0;
719
+ } else {
720
+ var value = this.k1r(patternName);
721
+ tmp = patternValue === '*' ? !(value == null) : equals(value, patternValue, true);
722
+ }
723
+ var matches = tmp;
724
+ if (!matches) {
725
+ return false;
726
+ }
727
+ }
728
+ return true;
729
+ };
730
+ protoOf(ContentType).equals = function (other) {
731
+ var tmp;
732
+ var tmp_0;
733
+ var tmp_1;
734
+ if (other instanceof ContentType) {
735
+ tmp_1 = equals(this.f1r_1, other.f1r_1, true);
736
+ } else {
737
+ tmp_1 = false;
738
+ }
739
+ if (tmp_1) {
740
+ tmp_0 = equals(this.g1r_1, other.g1r_1, true);
741
+ } else {
742
+ tmp_0 = false;
743
+ }
744
+ if (tmp_0) {
745
+ tmp = equals_0(this.p1p_1, other.p1p_1);
746
+ } else {
747
+ tmp = false;
748
+ }
749
+ return tmp;
750
+ };
751
+ protoOf(ContentType).hashCode = function () {
752
+ // Inline function 'kotlin.text.lowercase' call
753
+ // Inline function 'kotlin.js.asDynamic' call
754
+ var tmp$ret$1 = this.f1r_1.toLowerCase();
755
+ var result = getStringHashCode(tmp$ret$1);
756
+ var tmp = result;
757
+ var tmp_0 = imul(31, result);
758
+ // Inline function 'kotlin.text.lowercase' call
759
+ // Inline function 'kotlin.js.asDynamic' call
760
+ var tmp$ret$3 = this.g1r_1.toLowerCase();
761
+ result = tmp + (tmp_0 + getStringHashCode(tmp$ret$3) | 0) | 0;
762
+ result = result + imul(31, hashCode(this.p1p_1)) | 0;
763
+ return result;
764
+ };
765
+ function BadContentTypeFormatException(value) {
766
+ Exception_init_$Init$('Bad Content-Type format: ' + value, this);
767
+ captureStack(this, BadContentTypeFormatException);
768
+ }
769
+ function charset(_this__u8e3s4) {
770
+ var tmp6_safe_receiver = _this__u8e3s4.k1r('charset');
771
+ var tmp;
772
+ if (tmp6_safe_receiver == null) {
773
+ tmp = null;
774
+ } else {
775
+ // Inline function 'kotlin.let' call
776
+ // Inline function 'kotlin.contracts.contract' call
777
+ // Inline function 'io.ktor.http.charset.<anonymous>' call
778
+ var tmp_0;
779
+ try {
780
+ tmp_0 = forName(Charsets_getInstance(), tmp6_safe_receiver);
781
+ } catch ($p) {
782
+ var tmp_1;
783
+ if ($p instanceof IllegalArgumentException) {
784
+ var exception = $p;
785
+ tmp_1 = null;
786
+ } else {
787
+ throw $p;
788
+ }
789
+ tmp_0 = tmp_1;
790
+ }
791
+ tmp = tmp_0;
792
+ }
793
+ return tmp;
794
+ }
795
+ function withCharset(_this__u8e3s4, charset) {
796
+ return _this__u8e3s4.h1r('charset', get_name(charset));
797
+ }
798
+ function withCharsetIfNeeded(_this__u8e3s4, charset) {
799
+ var tmp;
800
+ // Inline function 'kotlin.text.lowercase' call
801
+ // Inline function 'kotlin.js.asDynamic' call
802
+ if (!(_this__u8e3s4.f1r_1.toLowerCase() === 'text')) {
803
+ tmp = _this__u8e3s4;
804
+ } else {
805
+ tmp = _this__u8e3s4.h1r('charset', get_name(charset));
806
+ }
807
+ return tmp;
808
+ }
809
+ function isDigit(_this__u8e3s4) {
810
+ return _Char___init__impl__6a9atx(48) <= _this__u8e3s4 ? _this__u8e3s4 <= _Char___init__impl__6a9atx(57) : false;
811
+ }
812
+ function get_HeaderFieldValueSeparators() {
813
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
814
+ return HeaderFieldValueSeparators;
815
+ }
816
+ var HeaderFieldValueSeparators;
817
+ function Companion_0() {
818
+ }
819
+ var Companion_instance_0;
820
+ function Companion_getInstance_0() {
821
+ return Companion_instance_0;
822
+ }
823
+ function HeaderValueWithParameters(content, parameters) {
824
+ parameters = parameters === VOID ? emptyList() : parameters;
825
+ this.o1p_1 = content;
826
+ this.p1p_1 = parameters;
827
+ }
828
+ protoOf(HeaderValueWithParameters).k1r = function (name) {
829
+ var inductionVariable = 0;
830
+ var last = get_lastIndex(this.p1p_1);
831
+ if (inductionVariable <= last)
832
+ do {
833
+ var index = inductionVariable;
834
+ inductionVariable = inductionVariable + 1 | 0;
835
+ var parameter = this.p1p_1.o(index);
836
+ if (equals(parameter.q1p_1, name, true)) {
837
+ return parameter.r1p_1;
838
+ }
839
+ }
840
+ while (!(index === last));
841
+ return null;
842
+ };
843
+ protoOf(HeaderValueWithParameters).toString = function () {
844
+ var tmp;
845
+ if (this.p1p_1.p()) {
846
+ tmp = this.o1p_1;
847
+ } else {
848
+ var tmp_0 = this.o1p_1.length;
849
+ // Inline function 'kotlin.collections.sumOf' call
850
+ var sum = 0;
851
+ var tmp0_iterator = this.p1p_1.j();
852
+ while (tmp0_iterator.k()) {
853
+ var element = tmp0_iterator.l();
854
+ var tmp_1 = sum;
855
+ // Inline function 'io.ktor.http.HeaderValueWithParameters.toString.<anonymous>' call
856
+ sum = tmp_1 + ((element.q1p_1.length + element.r1p_1.length | 0) + 3 | 0) | 0;
857
+ }
858
+ var size = tmp_0 + sum | 0;
859
+ // Inline function 'kotlin.apply' call
860
+ var this_0 = StringBuilder_init_$Create$_0(size);
861
+ // Inline function 'kotlin.contracts.contract' call
862
+ // Inline function 'io.ktor.http.HeaderValueWithParameters.toString.<anonymous>' call
863
+ this_0.j8(this.o1p_1);
864
+ var inductionVariable = 0;
865
+ var last = get_lastIndex(this.p1p_1);
866
+ if (inductionVariable <= last)
867
+ do {
868
+ var index = inductionVariable;
869
+ inductionVariable = inductionVariable + 1 | 0;
870
+ var element_0 = this.p1p_1.o(index);
871
+ this_0.j8('; ');
872
+ this_0.j8(element_0.q1p_1);
873
+ this_0.j8('=');
874
+ // Inline function 'io.ktor.http.escapeIfNeededTo' call
875
+ var this_1 = element_0.r1p_1;
876
+ if (needQuotes$accessor$vynnj(this_1))
877
+ this_0.j8(quote(this_1));
878
+ else
879
+ this_0.j8(this_1);
880
+ }
881
+ while (!(index === last));
882
+ tmp = this_0.toString();
883
+ }
884
+ return tmp;
885
+ };
886
+ function needQuotes(_this__u8e3s4) {
887
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
888
+ // Inline function 'kotlin.text.isEmpty' call
889
+ if (charSequenceLength(_this__u8e3s4) === 0)
890
+ return true;
891
+ if (isQuoted(_this__u8e3s4))
892
+ return false;
893
+ var inductionVariable = 0;
894
+ var last = _this__u8e3s4.length;
895
+ if (inductionVariable < last)
896
+ do {
897
+ var index = inductionVariable;
898
+ inductionVariable = inductionVariable + 1 | 0;
899
+ if (get_HeaderFieldValueSeparators().s1(new Char(charSequenceGet(_this__u8e3s4, index))))
900
+ return true;
901
+ }
902
+ while (inductionVariable < last);
903
+ return false;
904
+ }
905
+ function quote(_this__u8e3s4) {
906
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
907
+ // Inline function 'kotlin.text.buildString' call
908
+ // Inline function 'kotlin.contracts.contract' call
909
+ // Inline function 'kotlin.apply' call
910
+ var this_0 = StringBuilder_init_$Create$();
911
+ // Inline function 'kotlin.contracts.contract' call
912
+ // Inline function 'io.ktor.http.quote.<anonymous>' call
913
+ quoteTo(_this__u8e3s4, this_0);
914
+ return this_0.toString();
915
+ }
916
+ function isQuoted(_this__u8e3s4) {
917
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
918
+ if (_this__u8e3s4.length < 2) {
919
+ return false;
920
+ }
921
+ if (!(first(_this__u8e3s4) === _Char___init__impl__6a9atx(34)) || !(last_0(_this__u8e3s4) === _Char___init__impl__6a9atx(34))) {
922
+ return false;
923
+ }
924
+ var startIndex = 1;
925
+ $l$loop: do {
926
+ var index = indexOf(_this__u8e3s4, _Char___init__impl__6a9atx(34), startIndex);
927
+ if (index === get_lastIndex_0(_this__u8e3s4)) {
928
+ break $l$loop;
929
+ }
930
+ var slashesCount = 0;
931
+ var slashIndex = index - 1 | 0;
932
+ while (charSequenceGet(_this__u8e3s4, slashIndex) === _Char___init__impl__6a9atx(92)) {
933
+ slashesCount = slashesCount + 1 | 0;
934
+ slashIndex = slashIndex - 1 | 0;
935
+ }
936
+ if ((slashesCount % 2 | 0) === 0) {
937
+ return false;
938
+ }
939
+ startIndex = index + 1 | 0;
940
+ }
941
+ while (startIndex < _this__u8e3s4.length);
942
+ return true;
943
+ }
944
+ function quoteTo(_this__u8e3s4, out) {
945
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
946
+ out.j8('"');
947
+ var inductionVariable = 0;
948
+ var last = _this__u8e3s4.length;
949
+ if (inductionVariable < last)
950
+ do {
951
+ var i = inductionVariable;
952
+ inductionVariable = inductionVariable + 1 | 0;
953
+ var ch = charSequenceGet(_this__u8e3s4, i);
954
+ if (ch === _Char___init__impl__6a9atx(92))
955
+ out.j8('\\\\');
956
+ else if (ch === _Char___init__impl__6a9atx(10))
957
+ out.j8('\\n');
958
+ else if (ch === _Char___init__impl__6a9atx(13))
959
+ out.j8('\\r');
960
+ else if (ch === _Char___init__impl__6a9atx(9))
961
+ out.j8('\\t');
962
+ else if (ch === _Char___init__impl__6a9atx(34))
963
+ out.j8('\\"');
964
+ else
965
+ out.k8(ch);
966
+ }
967
+ while (inductionVariable < last);
968
+ out.j8('"');
969
+ }
970
+ function append(_this__u8e3s4, name, value) {
971
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
972
+ _this__u8e3s4.p1l(name, value.toString());
973
+ }
974
+ function escapeIfNeeded(_this__u8e3s4) {
975
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
976
+ return needQuotes$accessor$vynnj(_this__u8e3s4) ? quote(_this__u8e3s4) : _this__u8e3s4;
977
+ }
978
+ function needQuotes$accessor$vynnj(_this__u8e3s4) {
979
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
980
+ return needQuotes(_this__u8e3s4);
981
+ }
982
+ var properties_initialized_HeaderValueWithParameters_kt_yu5xg;
983
+ function _init_properties_HeaderValueWithParameters_kt__z6luvy() {
984
+ if (!properties_initialized_HeaderValueWithParameters_kt_yu5xg) {
985
+ properties_initialized_HeaderValueWithParameters_kt_yu5xg = true;
986
+ 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))]);
987
+ }
988
+ }
989
+ function Companion_1() {
990
+ Companion_instance_1 = this;
991
+ this.l1r_1 = EmptyHeaders_instance;
992
+ }
993
+ var Companion_instance_1;
994
+ function Companion_getInstance_1() {
995
+ if (Companion_instance_1 == null)
996
+ new Companion_1();
997
+ return Companion_instance_1;
998
+ }
999
+ function HeadersBuilder(size) {
1000
+ size = size === VOID ? 8 : size;
1001
+ StringValuesBuilderImpl.call(this, true, size);
1002
+ }
1003
+ protoOf(HeadersBuilder).o1r = function () {
1004
+ return new HeadersImpl(this.i1l_1);
1005
+ };
1006
+ protoOf(HeadersBuilder).j1l = function (name) {
1007
+ protoOf(StringValuesBuilderImpl).j1l.call(this, name);
1008
+ HttpHeaders_getInstance().l1v(name);
1009
+ };
1010
+ protoOf(HeadersBuilder).o1l = function (value) {
1011
+ protoOf(StringValuesBuilderImpl).o1l.call(this, value);
1012
+ HttpHeaders_getInstance().m1v(value);
1013
+ };
1014
+ function EmptyHeaders() {
1015
+ }
1016
+ protoOf(EmptyHeaders).c1l = function () {
1017
+ return true;
1018
+ };
1019
+ protoOf(EmptyHeaders).d1l = function (name) {
1020
+ return null;
1021
+ };
1022
+ protoOf(EmptyHeaders).e1l = function () {
1023
+ return emptySet();
1024
+ };
1025
+ protoOf(EmptyHeaders).f1l = function () {
1026
+ return emptySet();
1027
+ };
1028
+ protoOf(EmptyHeaders).toString = function () {
1029
+ return 'Headers ' + toString(this.f1l());
1030
+ };
1031
+ var EmptyHeaders_instance;
1032
+ function EmptyHeaders_getInstance() {
1033
+ return EmptyHeaders_instance;
1034
+ }
1035
+ function HeadersImpl(values) {
1036
+ values = values === VOID ? emptyMap() : values;
1037
+ StringValuesImpl.call(this, true, values);
1038
+ }
1039
+ protoOf(HeadersImpl).toString = function () {
1040
+ return 'Headers ' + toString(this.f1l());
1041
+ };
1042
+ function HeaderValueParam_init_$Init$(name, value, $this) {
1043
+ HeaderValueParam.call($this, name, value, false);
1044
+ return $this;
1045
+ }
1046
+ function HeaderValueParam_init_$Create$(name, value) {
1047
+ return HeaderValueParam_init_$Init$(name, value, objectCreate(protoOf(HeaderValueParam)));
1048
+ }
1049
+ function HeaderValueParam(name, value, escapeValue) {
1050
+ this.q1p_1 = name;
1051
+ this.r1p_1 = value;
1052
+ this.s1p_1 = escapeValue;
1053
+ }
1054
+ protoOf(HeaderValueParam).equals = function (other) {
1055
+ var tmp;
1056
+ var tmp_0;
1057
+ if (other instanceof HeaderValueParam) {
1058
+ tmp_0 = equals(other.q1p_1, this.q1p_1, true);
1059
+ } else {
1060
+ tmp_0 = false;
1061
+ }
1062
+ if (tmp_0) {
1063
+ tmp = equals(other.r1p_1, this.r1p_1, true);
1064
+ } else {
1065
+ tmp = false;
1066
+ }
1067
+ return tmp;
1068
+ };
1069
+ protoOf(HeaderValueParam).hashCode = function () {
1070
+ // Inline function 'kotlin.text.lowercase' call
1071
+ // Inline function 'kotlin.js.asDynamic' call
1072
+ var tmp$ret$1 = this.q1p_1.toLowerCase();
1073
+ var result = getStringHashCode(tmp$ret$1);
1074
+ var tmp = result;
1075
+ var tmp_0 = imul(31, result);
1076
+ // Inline function 'kotlin.text.lowercase' call
1077
+ // Inline function 'kotlin.js.asDynamic' call
1078
+ var tmp$ret$3 = this.r1p_1.toLowerCase();
1079
+ result = tmp + (tmp_0 + getStringHashCode(tmp$ret$3) | 0) | 0;
1080
+ return result;
1081
+ };
1082
+ protoOf(HeaderValueParam).eg = function () {
1083
+ return this.q1p_1;
1084
+ };
1085
+ protoOf(HeaderValueParam).fg = function () {
1086
+ return this.r1p_1;
1087
+ };
1088
+ protoOf(HeaderValueParam).toString = function () {
1089
+ return 'HeaderValueParam(name=' + this.q1p_1 + ', value=' + this.r1p_1 + ', escapeValue=' + this.s1p_1 + ')';
1090
+ };
1091
+ function HeaderValue(value, params) {
1092
+ params = params === VOID ? emptyList() : params;
1093
+ this.v1p_1 = value;
1094
+ this.w1p_1 = params;
1095
+ var tmp = this;
1096
+ var tmp$ret$1;
1097
+ $l$block: {
1098
+ // Inline function 'kotlin.collections.firstOrNull' call
1099
+ var tmp0_iterator = this.w1p_1.j();
1100
+ while (tmp0_iterator.k()) {
1101
+ var element = tmp0_iterator.l();
1102
+ // Inline function 'io.ktor.http.HeaderValue.quality.<anonymous>' call
1103
+ if (element.q1p_1 === 'q') {
1104
+ tmp$ret$1 = element;
1105
+ break $l$block;
1106
+ }
1107
+ }
1108
+ tmp$ret$1 = null;
1109
+ }
1110
+ var tmp16_safe_receiver = tmp$ret$1;
1111
+ var tmp17_safe_receiver = tmp16_safe_receiver == null ? null : tmp16_safe_receiver.r1p_1;
1112
+ var tmp18_safe_receiver = tmp17_safe_receiver == null ? null : toDoubleOrNull(tmp17_safe_receiver);
1113
+ var tmp_0;
1114
+ if (tmp18_safe_receiver == null) {
1115
+ tmp_0 = null;
1116
+ } else {
1117
+ // Inline function 'kotlin.takeIf' call
1118
+ // Inline function 'kotlin.contracts.contract' call
1119
+ var tmp_1;
1120
+ // Inline function 'io.ktor.http.HeaderValue.quality.<anonymous>' call
1121
+ if (0.0 <= tmp18_safe_receiver ? tmp18_safe_receiver <= 1.0 : false) {
1122
+ tmp_1 = tmp18_safe_receiver;
1123
+ } else {
1124
+ tmp_1 = null;
1125
+ }
1126
+ tmp_0 = tmp_1;
1127
+ }
1128
+ var tmp0_elvis_lhs = tmp_0;
1129
+ tmp.x1p_1 = tmp0_elvis_lhs == null ? 1.0 : tmp0_elvis_lhs;
1130
+ }
1131
+ protoOf(HeaderValue).eg = function () {
1132
+ return this.v1p_1;
1133
+ };
1134
+ protoOf(HeaderValue).toString = function () {
1135
+ return 'HeaderValue(value=' + this.v1p_1 + ', params=' + toString(this.w1p_1) + ')';
1136
+ };
1137
+ protoOf(HeaderValue).hashCode = function () {
1138
+ var result = getStringHashCode(this.v1p_1);
1139
+ result = imul(result, 31) + hashCode(this.w1p_1) | 0;
1140
+ return result;
1141
+ };
1142
+ protoOf(HeaderValue).equals = function (other) {
1143
+ if (this === other)
1144
+ return true;
1145
+ if (!(other instanceof HeaderValue))
1146
+ return false;
1147
+ var tmp0_other_with_cast = other instanceof HeaderValue ? other : THROW_CCE();
1148
+ if (!(this.v1p_1 === tmp0_other_with_cast.v1p_1))
1149
+ return false;
1150
+ if (!equals_0(this.w1p_1, tmp0_other_with_cast.w1p_1))
1151
+ return false;
1152
+ return true;
1153
+ };
1154
+ function parseHeaderValue(text) {
1155
+ return parseHeaderValue_0(text, false);
1156
+ }
1157
+ function parseHeaderValue_0(text, parametersOnly) {
1158
+ if (text == null) {
1159
+ return emptyList();
1160
+ }
1161
+ var position = 0;
1162
+ var tmp = LazyThreadSafetyMode_NONE_getInstance();
1163
+ var items = lazy(tmp, parseHeaderValue$lambda);
1164
+ while (position <= get_lastIndex_0(text)) {
1165
+ position = parseHeaderValueItem(text, position, items, parametersOnly);
1166
+ }
1167
+ return valueOrEmpty(items);
1168
+ }
1169
+ function parseHeaderValueItem(text, start, items, parametersOnly) {
1170
+ var position = start;
1171
+ var tmp = LazyThreadSafetyMode_NONE_getInstance();
1172
+ var parameters = lazy(tmp, parseHeaderValueItem$lambda);
1173
+ var valueEnd = parametersOnly ? position : null;
1174
+ while (position <= get_lastIndex_0(text)) {
1175
+ var tmp19_subject = charSequenceGet(text, position);
1176
+ if (tmp19_subject === _Char___init__impl__6a9atx(44)) {
1177
+ var tmp_0 = items.u();
1178
+ var tmp0_elvis_lhs = valueEnd;
1179
+ tmp_0.e(new HeaderValue(subtrim(text, start, tmp0_elvis_lhs == null ? position : tmp0_elvis_lhs), valueOrEmpty(parameters)));
1180
+ return position + 1 | 0;
1181
+ } else if (tmp19_subject === _Char___init__impl__6a9atx(59)) {
1182
+ if (valueEnd == null)
1183
+ valueEnd = position;
1184
+ position = parseHeaderValueParameter(text, position + 1 | 0, parameters);
1185
+ } else {
1186
+ var tmp_1;
1187
+ if (parametersOnly) {
1188
+ tmp_1 = parseHeaderValueParameter(text, position, parameters);
1189
+ } else {
1190
+ tmp_1 = position + 1 | 0;
1191
+ }
1192
+ position = tmp_1;
1193
+ }
1194
+ }
1195
+ var tmp_2 = items.u();
1196
+ var tmp1_elvis_lhs = valueEnd;
1197
+ tmp_2.e(new HeaderValue(subtrim(text, start, tmp1_elvis_lhs == null ? position : tmp1_elvis_lhs), valueOrEmpty(parameters)));
1198
+ return position;
1199
+ }
1200
+ function valueOrEmpty(_this__u8e3s4) {
1201
+ return _this__u8e3s4.mj() ? _this__u8e3s4.u() : emptyList();
1202
+ }
1203
+ function subtrim(_this__u8e3s4, start, end) {
1204
+ // Inline function 'kotlin.text.trim' call
1205
+ // Inline function 'kotlin.text.substring' call
1206
+ // Inline function 'kotlin.js.asDynamic' call
1207
+ var this_0 = _this__u8e3s4.substring(start, end);
1208
+ return toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
1209
+ }
1210
+ function parseHeaderValueParameter(text, start, parameters) {
1211
+ var position = start;
1212
+ while (position <= get_lastIndex_0(text)) {
1213
+ var tmp20_subject = charSequenceGet(text, position);
1214
+ if (tmp20_subject === _Char___init__impl__6a9atx(61)) {
1215
+ var _destruct__k2r9zo = parseHeaderValueParameterValue(text, position + 1 | 0);
1216
+ var paramEnd = _destruct__k2r9zo.eg();
1217
+ var paramValue = _destruct__k2r9zo.fg();
1218
+ parseHeaderValueParameter$addParam(parameters, text, start, position, paramValue);
1219
+ return paramEnd;
1220
+ } else if (tmp20_subject === _Char___init__impl__6a9atx(59) || tmp20_subject === _Char___init__impl__6a9atx(44)) {
1221
+ parseHeaderValueParameter$addParam(parameters, text, start, position, '');
1222
+ return position;
1223
+ } else {
1224
+ position = position + 1 | 0;
1225
+ }
1226
+ }
1227
+ parseHeaderValueParameter$addParam(parameters, text, start, position, '');
1228
+ return position;
1229
+ }
1230
+ function parseHeaderValueParameterValue(value, start) {
1231
+ if (value.length === start) {
1232
+ return to(start, '');
1233
+ }
1234
+ var position = start;
1235
+ if (charSequenceGet(value, start) === _Char___init__impl__6a9atx(34)) {
1236
+ return parseHeaderValueParameterValueQuoted(value, position + 1 | 0);
1237
+ }
1238
+ while (position <= get_lastIndex_0(value)) {
1239
+ var tmp21_subject = charSequenceGet(value, position);
1240
+ if (tmp21_subject === _Char___init__impl__6a9atx(59) || tmp21_subject === _Char___init__impl__6a9atx(44))
1241
+ return to(position, subtrim(value, start, position));
1242
+ else {
1243
+ position = position + 1 | 0;
1244
+ }
1245
+ }
1246
+ return to(position, subtrim(value, start, position));
1247
+ }
1248
+ function parseHeaderValueParameterValueQuoted(value, start) {
1249
+ var position = start;
1250
+ var builder = StringBuilder_init_$Create$();
1251
+ loop: while (position <= get_lastIndex_0(value)) {
1252
+ var currentChar = charSequenceGet(value, position);
1253
+ if (currentChar === _Char___init__impl__6a9atx(34) && nextIsSemicolonOrEnd(value, position)) {
1254
+ return to(position + 1 | 0, builder.toString());
1255
+ } else if (currentChar === _Char___init__impl__6a9atx(92) && position < (get_lastIndex_0(value) - 2 | 0)) {
1256
+ builder.k8(charSequenceGet(value, position + 1 | 0));
1257
+ position = position + 2 | 0;
1258
+ continue loop;
1259
+ }
1260
+ builder.k8(currentChar);
1261
+ position = position + 1 | 0;
1262
+ }
1263
+ var tmp = position;
1264
+ // Inline function 'kotlin.text.plus' call
1265
+ var this_0 = _Char___init__impl__6a9atx(34);
1266
+ var other = builder.toString();
1267
+ var tmp$ret$0 = toString_0(this_0) + other;
1268
+ return to(tmp, tmp$ret$0);
1269
+ }
1270
+ function nextIsSemicolonOrEnd(_this__u8e3s4, start) {
1271
+ var position = start + 1 | 0;
1272
+ loop: while (position < _this__u8e3s4.length && charSequenceGet(_this__u8e3s4, position) === _Char___init__impl__6a9atx(32)) {
1273
+ position = position + 1 | 0;
1274
+ }
1275
+ return position === _this__u8e3s4.length || charSequenceGet(_this__u8e3s4, position) === _Char___init__impl__6a9atx(59);
1276
+ }
1277
+ function parseAndSortHeader(header) {
1278
+ // Inline function 'kotlin.collections.sortedByDescending' call
1279
+ var this_0 = parseHeaderValue(header);
1280
+ // Inline function 'kotlin.comparisons.compareByDescending' call
1281
+ var tmp = parseAndSortHeader$lambda;
1282
+ var tmp$ret$0 = new sam$kotlin_Comparator$0(tmp);
1283
+ return sortedWith(this_0, tmp$ret$0);
1284
+ }
1285
+ function sam$kotlin_Comparator$0(function_0) {
1286
+ this.n1v_1 = function_0;
1287
+ }
1288
+ protoOf(sam$kotlin_Comparator$0).td = function (a, b) {
1289
+ return this.n1v_1(a, b);
1290
+ };
1291
+ protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
1292
+ return this.td(a, b);
1293
+ };
1294
+ protoOf(sam$kotlin_Comparator$0).m3 = function () {
1295
+ return this.n1v_1;
1296
+ };
1297
+ protoOf(sam$kotlin_Comparator$0).equals = function (other) {
1298
+ var tmp;
1299
+ if (!(other == null) ? isInterface(other, Comparator) : false) {
1300
+ var tmp_0;
1301
+ if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
1302
+ tmp_0 = equals_0(this.m3(), other.m3());
1303
+ } else {
1304
+ tmp_0 = false;
1305
+ }
1306
+ tmp = tmp_0;
1307
+ } else {
1308
+ tmp = false;
1309
+ }
1310
+ return tmp;
1311
+ };
1312
+ protoOf(sam$kotlin_Comparator$0).hashCode = function () {
1313
+ return hashCode(this.m3());
1314
+ };
1315
+ function parseHeaderValueParameter$addParam($parameters, text, start, end, value) {
1316
+ var name = subtrim(text, start, end);
1317
+ // Inline function 'kotlin.text.isEmpty' call
1318
+ if (charSequenceLength(name) === 0) {
1319
+ return Unit_instance;
1320
+ }
1321
+ $parameters.u().e(HeaderValueParam_init_$Create$(name, value));
1322
+ }
1323
+ function parseHeaderValue$lambda() {
1324
+ // Inline function 'kotlin.collections.arrayListOf' call
1325
+ return ArrayList_init_$Create$_0();
1326
+ }
1327
+ function parseHeaderValueItem$lambda() {
1328
+ // Inline function 'kotlin.collections.arrayListOf' call
1329
+ return ArrayList_init_$Create$_0();
1330
+ }
1331
+ function parseAndSortHeader$lambda(a, b) {
1332
+ // Inline function 'kotlin.comparisons.compareValuesBy' call
1333
+ // Inline function 'io.ktor.http.parseAndSortHeader.<anonymous>' call
1334
+ var tmp = b.x1p_1;
1335
+ // Inline function 'io.ktor.http.parseAndSortHeader.<anonymous>' call
1336
+ var tmp$ret$1 = a.x1p_1;
1337
+ return compareValues(tmp, tmp$ret$1);
1338
+ }
1339
+ function HttpHeaders() {
1340
+ HttpHeaders_instance = this;
1341
+ this.p1r_1 = 'Accept';
1342
+ this.q1r_1 = 'Accept-Charset';
1343
+ this.r1r_1 = 'Accept-Encoding';
1344
+ this.s1r_1 = 'Accept-Language';
1345
+ this.t1r_1 = 'Accept-Ranges';
1346
+ this.u1r_1 = 'Age';
1347
+ this.v1r_1 = 'Allow';
1348
+ this.w1r_1 = 'ALPN';
1349
+ this.x1r_1 = 'Authentication-Info';
1350
+ this.y1r_1 = 'Authorization';
1351
+ this.z1r_1 = 'Cache-Control';
1352
+ this.a1s_1 = 'Connection';
1353
+ this.b1s_1 = 'Content-Disposition';
1354
+ this.c1s_1 = 'Content-Encoding';
1355
+ this.d1s_1 = 'Content-Language';
1356
+ this.e1s_1 = 'Content-Length';
1357
+ this.f1s_1 = 'Content-Location';
1358
+ this.g1s_1 = 'Content-Range';
1359
+ this.h1s_1 = 'Content-Type';
1360
+ this.i1s_1 = 'Cookie';
1361
+ this.j1s_1 = 'DASL';
1362
+ this.k1s_1 = 'Date';
1363
+ this.l1s_1 = 'DAV';
1364
+ this.m1s_1 = 'Depth';
1365
+ this.n1s_1 = 'Destination';
1366
+ this.o1s_1 = 'ETag';
1367
+ this.p1s_1 = 'Expect';
1368
+ this.q1s_1 = 'Expires';
1369
+ this.r1s_1 = 'From';
1370
+ this.s1s_1 = 'Forwarded';
1371
+ this.t1s_1 = 'Host';
1372
+ this.u1s_1 = 'HTTP2-Settings';
1373
+ this.v1s_1 = 'If';
1374
+ this.w1s_1 = 'If-Match';
1375
+ this.x1s_1 = 'If-Modified-Since';
1376
+ this.y1s_1 = 'If-None-Match';
1377
+ this.z1s_1 = 'If-Range';
1378
+ this.a1t_1 = 'If-Schedule-Tag-Match';
1379
+ this.b1t_1 = 'If-Unmodified-Since';
1380
+ this.c1t_1 = 'Last-Modified';
1381
+ this.d1t_1 = 'Location';
1382
+ this.e1t_1 = 'Lock-Token';
1383
+ this.f1t_1 = 'Link';
1384
+ this.g1t_1 = 'Max-Forwards';
1385
+ this.h1t_1 = 'MIME-Version';
1386
+ this.i1t_1 = 'Ordering-Type';
1387
+ this.j1t_1 = 'Origin';
1388
+ this.k1t_1 = 'Overwrite';
1389
+ this.l1t_1 = 'Position';
1390
+ this.m1t_1 = 'Pragma';
1391
+ this.n1t_1 = 'Prefer';
1392
+ this.o1t_1 = 'Preference-Applied';
1393
+ this.p1t_1 = 'Proxy-Authenticate';
1394
+ this.q1t_1 = 'Proxy-Authentication-Info';
1395
+ this.r1t_1 = 'Proxy-Authorization';
1396
+ this.s1t_1 = 'Public-Key-Pins';
1397
+ this.t1t_1 = 'Public-Key-Pins-Report-Only';
1398
+ this.u1t_1 = 'Range';
1399
+ this.v1t_1 = 'Referer';
1400
+ this.w1t_1 = 'Retry-After';
1401
+ this.x1t_1 = 'Schedule-Reply';
1402
+ this.y1t_1 = 'Schedule-Tag';
1403
+ this.z1t_1 = 'Sec-WebSocket-Accept';
1404
+ this.a1u_1 = 'Sec-WebSocket-Extensions';
1405
+ this.b1u_1 = 'Sec-WebSocket-Key';
1406
+ this.c1u_1 = 'Sec-WebSocket-Protocol';
1407
+ this.d1u_1 = 'Sec-WebSocket-Version';
1408
+ this.e1u_1 = 'Server';
1409
+ this.f1u_1 = 'Set-Cookie';
1410
+ this.g1u_1 = 'SLUG';
1411
+ this.h1u_1 = 'Strict-Transport-Security';
1412
+ this.i1u_1 = 'TE';
1413
+ this.j1u_1 = 'Timeout';
1414
+ this.k1u_1 = 'Trailer';
1415
+ this.l1u_1 = 'Transfer-Encoding';
1416
+ this.m1u_1 = 'Upgrade';
1417
+ this.n1u_1 = 'User-Agent';
1418
+ this.o1u_1 = 'Vary';
1419
+ this.p1u_1 = 'Via';
1420
+ this.q1u_1 = 'Warning';
1421
+ this.r1u_1 = 'WWW-Authenticate';
1422
+ this.s1u_1 = 'Access-Control-Allow-Origin';
1423
+ this.t1u_1 = 'Access-Control-Allow-Methods';
1424
+ this.u1u_1 = 'Access-Control-Allow-Credentials';
1425
+ this.v1u_1 = 'Access-Control-Allow-Headers';
1426
+ this.w1u_1 = 'Access-Control-Request-Method';
1427
+ this.x1u_1 = 'Access-Control-Request-Headers';
1428
+ this.y1u_1 = 'Access-Control-Expose-Headers';
1429
+ this.z1u_1 = 'Access-Control-Max-Age';
1430
+ this.a1v_1 = 'X-Http-Method-Override';
1431
+ this.b1v_1 = 'X-Forwarded-Host';
1432
+ this.c1v_1 = 'X-Forwarded-Server';
1433
+ this.d1v_1 = 'X-Forwarded-Proto';
1434
+ this.e1v_1 = 'X-Forwarded-For';
1435
+ this.f1v_1 = 'X-Forwarded-Port';
1436
+ this.g1v_1 = 'X-Request-ID';
1437
+ this.h1v_1 = 'X-Correlation-ID';
1438
+ this.i1v_1 = 'X-Total-Count';
1439
+ var tmp = this;
1440
+ // Inline function 'kotlin.arrayOf' call
1441
+ // Inline function 'kotlin.js.unsafeCast' call
1442
+ // Inline function 'kotlin.js.asDynamic' call
1443
+ tmp.j1v_1 = [this.l1u_1, this.m1u_1];
1444
+ this.k1v_1 = asList(this.j1v_1);
1445
+ }
1446
+ protoOf(HttpHeaders).l1v = function (name) {
1447
+ // Inline function 'kotlin.text.forEachIndexed' call
1448
+ var index = 0;
1449
+ var inductionVariable = 0;
1450
+ while (inductionVariable < charSequenceLength(name)) {
1451
+ var item = charSequenceGet(name, inductionVariable);
1452
+ inductionVariable = inductionVariable + 1 | 0;
1453
+ // Inline function 'io.ktor.http.HttpHeaders.checkHeaderName.<anonymous>' call
1454
+ var tmp1 = index;
1455
+ index = tmp1 + 1 | 0;
1456
+ if (Char__compareTo_impl_ypi4mb(item, _Char___init__impl__6a9atx(32)) <= 0 || isDelimiter(item)) {
1457
+ throw new IllegalHeaderNameException(name, tmp1);
1458
+ }
1459
+ }
1460
+ };
1461
+ protoOf(HttpHeaders).m1v = function (value) {
1462
+ // Inline function 'kotlin.text.forEachIndexed' call
1463
+ var index = 0;
1464
+ var inductionVariable = 0;
1465
+ while (inductionVariable < charSequenceLength(value)) {
1466
+ var item = charSequenceGet(value, inductionVariable);
1467
+ inductionVariable = inductionVariable + 1 | 0;
1468
+ // Inline function 'io.ktor.http.HttpHeaders.checkHeaderValue.<anonymous>' call
1469
+ var tmp1 = index;
1470
+ index = tmp1 + 1 | 0;
1471
+ if (Char__compareTo_impl_ypi4mb(item, _Char___init__impl__6a9atx(32)) < 0 && !(item === _Char___init__impl__6a9atx(9))) {
1472
+ throw new IllegalHeaderValueException(value, tmp1);
1473
+ }
1474
+ }
1475
+ };
1476
+ var HttpHeaders_instance;
1477
+ function HttpHeaders_getInstance() {
1478
+ if (HttpHeaders_instance == null)
1479
+ new HttpHeaders();
1480
+ return HttpHeaders_instance;
1481
+ }
1482
+ function isDelimiter(ch) {
1483
+ return contains('"(),/:;<=>?@[\\]{}', ch);
1484
+ }
1485
+ function IllegalHeaderNameException(headerName, position) {
1486
+ var tmp = "Header name '" + headerName + "' contains illegal character '" + toString_0(charSequenceGet(headerName, position)) + "'";
1487
+ // Inline function 'kotlin.code' call
1488
+ var this_0 = charSequenceGet(headerName, position);
1489
+ var tmp$ret$0 = Char__toInt_impl_vasixd(this_0);
1490
+ IllegalArgumentException_init_$Init$(tmp + (' (code ' + (tmp$ret$0 & 255) + ')'), this);
1491
+ captureStack(this, IllegalHeaderNameException);
1492
+ this.o1v_1 = headerName;
1493
+ this.p1v_1 = position;
1494
+ }
1495
+ function IllegalHeaderValueException(headerValue, position) {
1496
+ var tmp = "Header value '" + headerValue + "' contains illegal character '" + toString_0(charSequenceGet(headerValue, position)) + "'";
1497
+ // Inline function 'kotlin.code' call
1498
+ var this_0 = charSequenceGet(headerValue, position);
1499
+ var tmp$ret$0 = Char__toInt_impl_vasixd(this_0);
1500
+ IllegalArgumentException_init_$Init$(tmp + (' (code ' + (tmp$ret$0 & 255) + ')'), this);
1501
+ captureStack(this, IllegalHeaderValueException);
1502
+ this.q1v_1 = headerValue;
1503
+ this.r1v_1 = position;
1504
+ }
1505
+ function UnsafeHeaderException(header) {
1506
+ IllegalArgumentException_init_$Init$('Header(s) ' + header + ' are controlled by the engine and ' + 'cannot be set explicitly', this);
1507
+ captureStack(this, UnsafeHeaderException);
1508
+ }
1509
+ function contentLength(_this__u8e3s4) {
1510
+ var tmp29_safe_receiver = _this__u8e3s4.s1v().c1k(HttpHeaders_getInstance().e1s_1);
1511
+ return tmp29_safe_receiver == null ? null : toLong(tmp29_safe_receiver);
1512
+ }
1513
+ function charset_0(_this__u8e3s4) {
1514
+ var tmp27_safe_receiver = contentType_0(_this__u8e3s4);
1515
+ return tmp27_safe_receiver == null ? null : charset(tmp27_safe_receiver);
1516
+ }
1517
+ function contentType(_this__u8e3s4) {
1518
+ var tmp22_safe_receiver = _this__u8e3s4.s1v().c1k(HttpHeaders_getInstance().h1s_1);
1519
+ var tmp;
1520
+ if (tmp22_safe_receiver == null) {
1521
+ tmp = null;
1522
+ } else {
1523
+ // Inline function 'kotlin.let' call
1524
+ // Inline function 'kotlin.contracts.contract' call
1525
+ // Inline function 'io.ktor.http.contentType.<anonymous>' call
1526
+ tmp = Companion_getInstance().u1p(tmp22_safe_receiver);
1527
+ }
1528
+ return tmp;
1529
+ }
1530
+ function contentType_0(_this__u8e3s4) {
1531
+ var tmp26_safe_receiver = _this__u8e3s4.s1v().c1k(HttpHeaders_getInstance().h1s_1);
1532
+ var tmp;
1533
+ if (tmp26_safe_receiver == null) {
1534
+ tmp = null;
1535
+ } else {
1536
+ // Inline function 'kotlin.let' call
1537
+ // Inline function 'kotlin.contracts.contract' call
1538
+ // Inline function 'io.ktor.http.contentType.<anonymous>' call
1539
+ tmp = Companion_getInstance().u1p(tmp26_safe_receiver);
1540
+ }
1541
+ return tmp;
1542
+ }
1543
+ function Companion_2() {
1544
+ Companion_instance_2 = this;
1545
+ this.t1v_1 = new HttpMethod('GET');
1546
+ this.u1v_1 = new HttpMethod('POST');
1547
+ this.v1v_1 = new HttpMethod('PUT');
1548
+ this.w1v_1 = new HttpMethod('PATCH');
1549
+ this.x1v_1 = new HttpMethod('DELETE');
1550
+ this.y1v_1 = new HttpMethod('HEAD');
1551
+ this.z1v_1 = new HttpMethod('OPTIONS');
1552
+ this.a1w_1 = listOf([this.t1v_1, this.u1v_1, this.v1v_1, this.w1v_1, this.x1v_1, this.y1v_1, this.z1v_1]);
1553
+ }
1554
+ var Companion_instance_2;
1555
+ function Companion_getInstance_2() {
1556
+ if (Companion_instance_2 == null)
1557
+ new Companion_2();
1558
+ return Companion_instance_2;
1559
+ }
1560
+ function HttpMethod(value) {
1561
+ Companion_getInstance_2();
1562
+ this.b1w_1 = value;
1563
+ }
1564
+ protoOf(HttpMethod).toString = function () {
1565
+ return 'HttpMethod(value=' + this.b1w_1 + ')';
1566
+ };
1567
+ protoOf(HttpMethod).hashCode = function () {
1568
+ return getStringHashCode(this.b1w_1);
1569
+ };
1570
+ protoOf(HttpMethod).equals = function (other) {
1571
+ if (this === other)
1572
+ return true;
1573
+ if (!(other instanceof HttpMethod))
1574
+ return false;
1575
+ var tmp0_other_with_cast = other instanceof HttpMethod ? other : THROW_CCE();
1576
+ if (!(this.b1w_1 === tmp0_other_with_cast.b1w_1))
1577
+ return false;
1578
+ return true;
1579
+ };
1580
+ function Companion_3() {
1581
+ Companion_instance_3 = this;
1582
+ this.c1w_1 = new HttpProtocolVersion('HTTP', 2, 0);
1583
+ this.d1w_1 = new HttpProtocolVersion('HTTP', 1, 1);
1584
+ this.e1w_1 = new HttpProtocolVersion('HTTP', 1, 0);
1585
+ this.f1w_1 = new HttpProtocolVersion('SPDY', 3, 0);
1586
+ this.g1w_1 = new HttpProtocolVersion('QUIC', 1, 0);
1587
+ }
1588
+ var Companion_instance_3;
1589
+ function Companion_getInstance_3() {
1590
+ if (Companion_instance_3 == null)
1591
+ new Companion_3();
1592
+ return Companion_instance_3;
1593
+ }
1594
+ function HttpProtocolVersion(name, major, minor) {
1595
+ Companion_getInstance_3();
1596
+ this.h1w_1 = name;
1597
+ this.i1w_1 = major;
1598
+ this.j1w_1 = minor;
1599
+ }
1600
+ protoOf(HttpProtocolVersion).toString = function () {
1601
+ return this.h1w_1 + '/' + this.i1w_1 + '.' + this.j1w_1;
1602
+ };
1603
+ protoOf(HttpProtocolVersion).hashCode = function () {
1604
+ var result = getStringHashCode(this.h1w_1);
1605
+ result = imul(result, 31) + this.i1w_1 | 0;
1606
+ result = imul(result, 31) + this.j1w_1 | 0;
1607
+ return result;
1608
+ };
1609
+ protoOf(HttpProtocolVersion).equals = function (other) {
1610
+ if (this === other)
1611
+ return true;
1612
+ if (!(other instanceof HttpProtocolVersion))
1613
+ return false;
1614
+ var tmp0_other_with_cast = other instanceof HttpProtocolVersion ? other : THROW_CCE();
1615
+ if (!(this.h1w_1 === tmp0_other_with_cast.h1w_1))
1616
+ return false;
1617
+ if (!(this.i1w_1 === tmp0_other_with_cast.i1w_1))
1618
+ return false;
1619
+ if (!(this.j1w_1 === tmp0_other_with_cast.j1w_1))
1620
+ return false;
1621
+ return true;
1622
+ };
1623
+ function Companion_4() {
1624
+ Companion_instance_4 = this;
1625
+ this.k1w_1 = new HttpStatusCode(100, 'Continue');
1626
+ this.l1w_1 = new HttpStatusCode(101, 'Switching Protocols');
1627
+ this.m1w_1 = new HttpStatusCode(102, 'Processing');
1628
+ this.n1w_1 = new HttpStatusCode(200, 'OK');
1629
+ this.o1w_1 = new HttpStatusCode(201, 'Created');
1630
+ this.p1w_1 = new HttpStatusCode(202, 'Accepted');
1631
+ this.q1w_1 = new HttpStatusCode(203, 'Non-Authoritative Information');
1632
+ this.r1w_1 = new HttpStatusCode(204, 'No Content');
1633
+ this.s1w_1 = new HttpStatusCode(205, 'Reset Content');
1634
+ this.t1w_1 = new HttpStatusCode(206, 'Partial Content');
1635
+ this.u1w_1 = new HttpStatusCode(207, 'Multi-Status');
1636
+ this.v1w_1 = new HttpStatusCode(300, 'Multiple Choices');
1637
+ this.w1w_1 = new HttpStatusCode(301, 'Moved Permanently');
1638
+ this.x1w_1 = new HttpStatusCode(302, 'Found');
1639
+ this.y1w_1 = new HttpStatusCode(303, 'See Other');
1640
+ this.z1w_1 = new HttpStatusCode(304, 'Not Modified');
1641
+ this.a1x_1 = new HttpStatusCode(305, 'Use Proxy');
1642
+ this.b1x_1 = new HttpStatusCode(306, 'Switch Proxy');
1643
+ this.c1x_1 = new HttpStatusCode(307, 'Temporary Redirect');
1644
+ this.d1x_1 = new HttpStatusCode(308, 'Permanent Redirect');
1645
+ this.e1x_1 = new HttpStatusCode(400, 'Bad Request');
1646
+ this.f1x_1 = new HttpStatusCode(401, 'Unauthorized');
1647
+ this.g1x_1 = new HttpStatusCode(402, 'Payment Required');
1648
+ this.h1x_1 = new HttpStatusCode(403, 'Forbidden');
1649
+ this.i1x_1 = new HttpStatusCode(404, 'Not Found');
1650
+ this.j1x_1 = new HttpStatusCode(405, 'Method Not Allowed');
1651
+ this.k1x_1 = new HttpStatusCode(406, 'Not Acceptable');
1652
+ this.l1x_1 = new HttpStatusCode(407, 'Proxy Authentication Required');
1653
+ this.m1x_1 = new HttpStatusCode(408, 'Request Timeout');
1654
+ this.n1x_1 = new HttpStatusCode(409, 'Conflict');
1655
+ this.o1x_1 = new HttpStatusCode(410, 'Gone');
1656
+ this.p1x_1 = new HttpStatusCode(411, 'Length Required');
1657
+ this.q1x_1 = new HttpStatusCode(412, 'Precondition Failed');
1658
+ this.r1x_1 = new HttpStatusCode(413, 'Payload Too Large');
1659
+ this.s1x_1 = new HttpStatusCode(414, 'Request-URI Too Long');
1660
+ this.t1x_1 = new HttpStatusCode(415, 'Unsupported Media Type');
1661
+ this.u1x_1 = new HttpStatusCode(416, 'Requested Range Not Satisfiable');
1662
+ this.v1x_1 = new HttpStatusCode(417, 'Expectation Failed');
1663
+ this.w1x_1 = new HttpStatusCode(422, 'Unprocessable Entity');
1664
+ this.x1x_1 = new HttpStatusCode(423, 'Locked');
1665
+ this.y1x_1 = new HttpStatusCode(424, 'Failed Dependency');
1666
+ this.z1x_1 = new HttpStatusCode(425, 'Too Early');
1667
+ this.a1y_1 = new HttpStatusCode(426, 'Upgrade Required');
1668
+ this.b1y_1 = new HttpStatusCode(429, 'Too Many Requests');
1669
+ this.c1y_1 = new HttpStatusCode(431, 'Request Header Fields Too Large');
1670
+ this.d1y_1 = new HttpStatusCode(500, 'Internal Server Error');
1671
+ this.e1y_1 = new HttpStatusCode(501, 'Not Implemented');
1672
+ this.f1y_1 = new HttpStatusCode(502, 'Bad Gateway');
1673
+ this.g1y_1 = new HttpStatusCode(503, 'Service Unavailable');
1674
+ this.h1y_1 = new HttpStatusCode(504, 'Gateway Timeout');
1675
+ this.i1y_1 = new HttpStatusCode(505, 'HTTP Version Not Supported');
1676
+ this.j1y_1 = new HttpStatusCode(506, 'Variant Also Negotiates');
1677
+ this.k1y_1 = new HttpStatusCode(507, 'Insufficient Storage');
1678
+ this.l1y_1 = allStatusCodes();
1679
+ var tmp = this;
1680
+ // Inline function 'kotlin.collections.associateBy' call
1681
+ var this_0 = this.l1y_1;
1682
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1683
+ // Inline function 'kotlin.collections.associateByTo' call
1684
+ var destination = LinkedHashMap_init_$Create$(capacity);
1685
+ var tmp0_iterator = this_0.j();
1686
+ while (tmp0_iterator.k()) {
1687
+ var element = tmp0_iterator.l();
1688
+ // Inline function 'io.ktor.http.Companion.statusCodesMap.<anonymous>' call
1689
+ var tmp$ret$0 = element.n1y_1;
1690
+ destination.i2(tmp$ret$0, element);
1691
+ }
1692
+ tmp.m1y_1 = destination;
1693
+ }
1694
+ var Companion_instance_4;
1695
+ function Companion_getInstance_4() {
1696
+ if (Companion_instance_4 == null)
1697
+ new Companion_4();
1698
+ return Companion_instance_4;
1699
+ }
1700
+ function HttpStatusCode(value, description) {
1701
+ Companion_getInstance_4();
1702
+ this.n1y_1 = value;
1703
+ this.o1y_1 = description;
1704
+ }
1705
+ protoOf(HttpStatusCode).toString = function () {
1706
+ return '' + this.n1y_1 + ' ' + this.o1y_1;
1707
+ };
1708
+ protoOf(HttpStatusCode).equals = function (other) {
1709
+ var tmp;
1710
+ if (other instanceof HttpStatusCode) {
1711
+ tmp = other.n1y_1 === this.n1y_1;
1712
+ } else {
1713
+ tmp = false;
1714
+ }
1715
+ return tmp;
1716
+ };
1717
+ protoOf(HttpStatusCode).hashCode = function () {
1718
+ return this.n1y_1;
1719
+ };
1720
+ protoOf(HttpStatusCode).p1y = function (other) {
1721
+ return this.n1y_1 - other.n1y_1 | 0;
1722
+ };
1723
+ protoOf(HttpStatusCode).d = function (other) {
1724
+ return this.p1y(other instanceof HttpStatusCode ? other : THROW_CCE());
1725
+ };
1726
+ function allStatusCodes() {
1727
+ return listOf([Companion_getInstance_4().k1w_1, Companion_getInstance_4().l1w_1, Companion_getInstance_4().m1w_1, Companion_getInstance_4().n1w_1, Companion_getInstance_4().o1w_1, Companion_getInstance_4().p1w_1, Companion_getInstance_4().q1w_1, Companion_getInstance_4().r1w_1, Companion_getInstance_4().s1w_1, Companion_getInstance_4().t1w_1, Companion_getInstance_4().u1w_1, Companion_getInstance_4().v1w_1, Companion_getInstance_4().w1w_1, Companion_getInstance_4().x1w_1, Companion_getInstance_4().y1w_1, Companion_getInstance_4().z1w_1, Companion_getInstance_4().a1x_1, Companion_getInstance_4().b1x_1, Companion_getInstance_4().c1x_1, Companion_getInstance_4().d1x_1, Companion_getInstance_4().e1x_1, Companion_getInstance_4().f1x_1, Companion_getInstance_4().g1x_1, Companion_getInstance_4().h1x_1, Companion_getInstance_4().i1x_1, Companion_getInstance_4().j1x_1, Companion_getInstance_4().k1x_1, Companion_getInstance_4().l1x_1, Companion_getInstance_4().m1x_1, Companion_getInstance_4().n1x_1, Companion_getInstance_4().o1x_1, Companion_getInstance_4().p1x_1, Companion_getInstance_4().q1x_1, Companion_getInstance_4().r1x_1, Companion_getInstance_4().s1x_1, Companion_getInstance_4().t1x_1, Companion_getInstance_4().u1x_1, Companion_getInstance_4().v1x_1, Companion_getInstance_4().w1x_1, Companion_getInstance_4().x1x_1, Companion_getInstance_4().y1x_1, Companion_getInstance_4().z1x_1, Companion_getInstance_4().a1y_1, Companion_getInstance_4().b1y_1, Companion_getInstance_4().c1y_1, Companion_getInstance_4().d1y_1, Companion_getInstance_4().e1y_1, Companion_getInstance_4().f1y_1, Companion_getInstance_4().g1y_1, Companion_getInstance_4().h1y_1, Companion_getInstance_4().i1y_1, Companion_getInstance_4().j1y_1, Companion_getInstance_4().k1y_1]);
1728
+ }
1729
+ function isSuccess(_this__u8e3s4) {
1730
+ var containsArg = _this__u8e3s4.n1y_1;
1731
+ return 200 <= containsArg ? containsArg < 300 : false;
1732
+ }
1733
+ function Companion_5() {
1734
+ Companion_instance_5 = this;
1735
+ this.q1y_1 = EmptyParameters_instance;
1736
+ }
1737
+ var Companion_instance_5;
1738
+ function Companion_getInstance_5() {
1739
+ if (Companion_instance_5 == null)
1740
+ new Companion_5();
1741
+ return Companion_instance_5;
1742
+ }
1743
+ function Parameters() {
1744
+ }
1745
+ function EmptyParameters() {
1746
+ }
1747
+ protoOf(EmptyParameters).c1l = function () {
1748
+ return true;
1749
+ };
1750
+ protoOf(EmptyParameters).d1l = function (name) {
1751
+ return null;
1752
+ };
1753
+ protoOf(EmptyParameters).e1l = function () {
1754
+ return emptySet();
1755
+ };
1756
+ protoOf(EmptyParameters).f1l = function () {
1757
+ return emptySet();
1758
+ };
1759
+ protoOf(EmptyParameters).p = function () {
1760
+ return true;
1761
+ };
1762
+ protoOf(EmptyParameters).toString = function () {
1763
+ return 'Parameters ' + toString(this.f1l());
1764
+ };
1765
+ protoOf(EmptyParameters).equals = function (other) {
1766
+ var tmp;
1767
+ if (!(other == null) ? isInterface(other, Parameters) : false) {
1768
+ tmp = other.p();
1769
+ } else {
1770
+ tmp = false;
1771
+ }
1772
+ return tmp;
1773
+ };
1774
+ var EmptyParameters_instance;
1775
+ function EmptyParameters_getInstance() {
1776
+ return EmptyParameters_instance;
1777
+ }
1778
+ function ParametersBuilder(size) {
1779
+ size = size === VOID ? 8 : size;
1780
+ return new ParametersBuilderImpl(size);
1781
+ }
1782
+ function ParametersBuilderImpl(size) {
1783
+ size = size === VOID ? 8 : size;
1784
+ StringValuesBuilderImpl.call(this, true, size);
1785
+ }
1786
+ protoOf(ParametersBuilderImpl).o1r = function () {
1787
+ return new ParametersImpl(this.i1l_1);
1788
+ };
1789
+ function ParametersImpl(values) {
1790
+ values = values === VOID ? emptyMap() : values;
1791
+ StringValuesImpl.call(this, true, values);
1792
+ }
1793
+ protoOf(ParametersImpl).toString = function () {
1794
+ return 'Parameters ' + toString(this.f1l());
1795
+ };
1796
+ function parseQueryString(query, startIndex, limit, decode) {
1797
+ startIndex = startIndex === VOID ? 0 : startIndex;
1798
+ limit = limit === VOID ? 1000 : limit;
1799
+ decode = decode === VOID ? true : decode;
1800
+ var tmp;
1801
+ if (startIndex > get_lastIndex_0(query)) {
1802
+ tmp = Companion_getInstance_5().q1y_1;
1803
+ } else {
1804
+ // Inline function 'io.ktor.http.Companion.build' call
1805
+ Companion_getInstance_5();
1806
+ // Inline function 'kotlin.apply' call
1807
+ var this_0 = ParametersBuilder();
1808
+ // Inline function 'kotlin.contracts.contract' call
1809
+ // Inline function 'io.ktor.http.parseQueryString.<anonymous>' call
1810
+ parse(this_0, query, startIndex, limit, decode);
1811
+ tmp = this_0.o1r();
1812
+ }
1813
+ return tmp;
1814
+ }
1815
+ function parse(_this__u8e3s4, query, startIndex, limit, decode) {
1816
+ var count = 0;
1817
+ var nameIndex = startIndex;
1818
+ var equalIndex = -1;
1819
+ var inductionVariable = startIndex;
1820
+ var last = get_lastIndex_0(query);
1821
+ if (inductionVariable <= last)
1822
+ do {
1823
+ var index = inductionVariable;
1824
+ inductionVariable = inductionVariable + 1 | 0;
1825
+ if (count === limit) {
1826
+ return Unit_instance;
1827
+ }
1828
+ var tmp36_subject = charSequenceGet(query, index);
1829
+ if (tmp36_subject === _Char___init__impl__6a9atx(38)) {
1830
+ appendParam(_this__u8e3s4, query, nameIndex, equalIndex, index, decode);
1831
+ nameIndex = index + 1 | 0;
1832
+ equalIndex = -1;
1833
+ count = count + 1 | 0;
1834
+ } else if (tmp36_subject === _Char___init__impl__6a9atx(61)) {
1835
+ if (equalIndex === -1) {
1836
+ equalIndex = index;
1837
+ }
1838
+ }
1839
+ }
1840
+ while (!(index === last));
1841
+ if (count === limit) {
1842
+ return Unit_instance;
1843
+ }
1844
+ appendParam(_this__u8e3s4, query, nameIndex, equalIndex, query.length, decode);
1845
+ }
1846
+ function appendParam(_this__u8e3s4, query, nameIndex, equalIndex, endIndex, decode) {
1847
+ if (equalIndex === -1) {
1848
+ var spaceNameIndex = trimStart(nameIndex, endIndex, query);
1849
+ var spaceEndIndex = trimEnd(spaceNameIndex, endIndex, query);
1850
+ if (spaceEndIndex > spaceNameIndex) {
1851
+ var tmp;
1852
+ if (decode) {
1853
+ tmp = decodeURLQueryComponent(query, spaceNameIndex, spaceEndIndex);
1854
+ } else {
1855
+ // Inline function 'kotlin.text.substring' call
1856
+ // Inline function 'kotlin.js.asDynamic' call
1857
+ tmp = query.substring(spaceNameIndex, spaceEndIndex);
1858
+ }
1859
+ var name = tmp;
1860
+ _this__u8e3s4.k1l(name, emptyList());
1861
+ }
1862
+ return Unit_instance;
1863
+ }
1864
+ var spaceNameIndex_0 = trimStart(nameIndex, equalIndex, query);
1865
+ var spaceEqualIndex = trimEnd(spaceNameIndex_0, equalIndex, query);
1866
+ if (spaceEqualIndex > spaceNameIndex_0) {
1867
+ var tmp_0;
1868
+ if (decode) {
1869
+ tmp_0 = decodeURLQueryComponent(query, spaceNameIndex_0, spaceEqualIndex);
1870
+ } else {
1871
+ // Inline function 'kotlin.text.substring' call
1872
+ // Inline function 'kotlin.js.asDynamic' call
1873
+ tmp_0 = query.substring(spaceNameIndex_0, spaceEqualIndex);
1874
+ }
1875
+ var name_0 = tmp_0;
1876
+ var spaceValueIndex = trimStart(equalIndex + 1 | 0, endIndex, query);
1877
+ var spaceEndIndex_0 = trimEnd(spaceValueIndex, endIndex, query);
1878
+ var tmp_1;
1879
+ if (decode) {
1880
+ tmp_1 = decodeURLQueryComponent(query, spaceValueIndex, spaceEndIndex_0, true);
1881
+ } else {
1882
+ // Inline function 'kotlin.text.substring' call
1883
+ // Inline function 'kotlin.js.asDynamic' call
1884
+ tmp_1 = query.substring(spaceValueIndex, spaceEndIndex_0);
1885
+ }
1886
+ var value = tmp_1;
1887
+ _this__u8e3s4.p1l(name_0, value);
1888
+ }
1889
+ }
1890
+ function trimStart(start, end, query) {
1891
+ var spaceIndex = start;
1892
+ while (spaceIndex < end && isWhitespace(charSequenceGet(query, spaceIndex))) {
1893
+ spaceIndex = spaceIndex + 1 | 0;
1894
+ }
1895
+ return spaceIndex;
1896
+ }
1897
+ function trimEnd(start, end, text) {
1898
+ var spaceIndex = end;
1899
+ while (spaceIndex > start && isWhitespace(charSequenceGet(text, spaceIndex - 1 | 0))) {
1900
+ spaceIndex = spaceIndex - 1 | 0;
1901
+ }
1902
+ return spaceIndex;
1903
+ }
1904
+ function applyOrigin($this) {
1905
+ var tmp;
1906
+ // Inline function 'kotlin.text.isNotEmpty' call
1907
+ var this_0 = $this.t1y_1;
1908
+ if (charSequenceLength(this_0) > 0) {
1909
+ tmp = true;
1910
+ } else {
1911
+ tmp = $this.f1z().d1z_1 === 'file';
1912
+ }
1913
+ if (tmp)
1914
+ return Unit_instance;
1915
+ $this.t1y_1 = Companion_getInstance_6().x1z_1.g1z_1;
1916
+ if ($this.w1y_1 == null)
1917
+ $this.w1y_1 = Companion_getInstance_6().x1z_1.p1z_1;
1918
+ if ($this.v1y_1 === 0) {
1919
+ $this.y1z(Companion_getInstance_6().x1z_1.h1z_1);
1920
+ }
1921
+ }
1922
+ function Companion_6() {
1923
+ Companion_instance_6 = this;
1924
+ this.x1z_1 = Url(get_origin(this));
1925
+ }
1926
+ var Companion_instance_6;
1927
+ function Companion_getInstance_6() {
1928
+ if (Companion_instance_6 == null)
1929
+ new Companion_6();
1930
+ return Companion_instance_6;
1931
+ }
1932
+ function URLBuilder(protocol, host, port, user, password, pathSegments, parameters, fragment, trailingQuery) {
1933
+ Companion_getInstance_6();
1934
+ protocol = protocol === VOID ? null : protocol;
1935
+ host = host === VOID ? '' : host;
1936
+ port = port === VOID ? 0 : port;
1937
+ user = user === VOID ? null : user;
1938
+ password = password === VOID ? null : password;
1939
+ pathSegments = pathSegments === VOID ? emptyList() : pathSegments;
1940
+ parameters = parameters === VOID ? Companion_getInstance_5().q1y_1 : parameters;
1941
+ fragment = fragment === VOID ? '' : fragment;
1942
+ trailingQuery = trailingQuery === VOID ? false : trailingQuery;
1943
+ this.t1y_1 = host;
1944
+ this.u1y_1 = trailingQuery;
1945
+ this.v1y_1 = port;
1946
+ this.w1y_1 = protocol;
1947
+ var tmp = this;
1948
+ tmp.x1y_1 = user == null ? null : encodeURLParameter(user);
1949
+ var tmp_0 = this;
1950
+ tmp_0.y1y_1 = password == null ? null : encodeURLParameter(password);
1951
+ this.z1y_1 = encodeURLQueryComponent(fragment);
1952
+ var tmp_1 = this;
1953
+ // Inline function 'kotlin.collections.map' call
1954
+ // Inline function 'kotlin.collections.mapTo' call
1955
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(pathSegments, 10));
1956
+ var tmp0_iterator = pathSegments.j();
1957
+ while (tmp0_iterator.k()) {
1958
+ var item = tmp0_iterator.l();
1959
+ // Inline function 'io.ktor.http.URLBuilder.encodedPathSegments.<anonymous>' call
1960
+ var tmp$ret$0 = encodeURLPathPart(item);
1961
+ destination.e(tmp$ret$0);
1962
+ }
1963
+ tmp_1.a1z_1 = destination;
1964
+ this.b1z_1 = encodeParameters(parameters);
1965
+ this.c1z_1 = new UrlDecodedParametersBuilder(this.b1z_1);
1966
+ }
1967
+ protoOf(URLBuilder).y1z = function (value) {
1968
+ // Inline function 'kotlin.require' call
1969
+ // Inline function 'kotlin.contracts.contract' call
1970
+ if (!(0 <= value ? value <= 65535 : false)) {
1971
+ // Inline function 'io.ktor.http.URLBuilder.<set-port>.<anonymous>' call
1972
+ var message = 'Port must be between 0 and 65535, or 0 if not set. Provided: ' + value;
1973
+ throw IllegalArgumentException_init_$Create$(toString(message));
1974
+ }
1975
+ this.v1y_1 = value;
1976
+ };
1977
+ protoOf(URLBuilder).z1z = function (value) {
1978
+ this.w1y_1 = value;
1979
+ };
1980
+ protoOf(URLBuilder).f1z = function () {
1981
+ var tmp0_elvis_lhs = this.w1y_1;
1982
+ return tmp0_elvis_lhs == null ? Companion_getInstance_7().a20_1 : tmp0_elvis_lhs;
1983
+ };
1984
+ protoOf(URLBuilder).g20 = function (value) {
1985
+ var tmp = this;
1986
+ tmp.x1y_1 = value == null ? null : encodeURLParameter(value);
1987
+ };
1988
+ protoOf(URLBuilder).h20 = function () {
1989
+ var tmp40_safe_receiver = this.x1y_1;
1990
+ return tmp40_safe_receiver == null ? null : decodeURLPart(tmp40_safe_receiver);
1991
+ };
1992
+ protoOf(URLBuilder).i20 = function () {
1993
+ var tmp43_safe_receiver = this.y1y_1;
1994
+ return tmp43_safe_receiver == null ? null : decodeURLPart(tmp43_safe_receiver);
1995
+ };
1996
+ protoOf(URLBuilder).j20 = function () {
1997
+ return decodeURLQueryComponent(this.z1y_1);
1998
+ };
1999
+ protoOf(URLBuilder).k20 = function () {
2000
+ // Inline function 'kotlin.collections.map' call
2001
+ var this_0 = this.a1z_1;
2002
+ // Inline function 'kotlin.collections.mapTo' call
2003
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
2004
+ var tmp0_iterator = this_0.j();
2005
+ while (tmp0_iterator.k()) {
2006
+ var item = tmp0_iterator.l();
2007
+ // Inline function 'io.ktor.http.URLBuilder.<get-pathSegments>.<anonymous>' call
2008
+ var tmp$ret$0 = decodeURLPart(item);
2009
+ destination.e(tmp$ret$0);
2010
+ }
2011
+ return destination;
2012
+ };
2013
+ protoOf(URLBuilder).l20 = function (value) {
2014
+ this.b1z_1 = value;
2015
+ this.c1z_1 = new UrlDecodedParametersBuilder(value);
2016
+ };
2017
+ protoOf(URLBuilder).m20 = function () {
2018
+ applyOrigin(this);
2019
+ return appendTo(this, StringBuilder_init_$Create$_0(256)).toString();
2020
+ };
2021
+ protoOf(URLBuilder).toString = function () {
2022
+ return appendTo(this, StringBuilder_init_$Create$_0(256)).toString();
2023
+ };
2024
+ protoOf(URLBuilder).o1r = function () {
2025
+ applyOrigin(this);
2026
+ return new Url_0(this.w1y_1, this.t1y_1, this.v1y_1, this.k20(), this.c1z_1.o1r(), this.j20(), this.h20(), this.i20(), this.u1y_1, this.m20());
2027
+ };
2028
+ function get_authority(_this__u8e3s4) {
2029
+ // Inline function 'kotlin.text.buildString' call
2030
+ // Inline function 'kotlin.contracts.contract' call
2031
+ // Inline function 'kotlin.apply' call
2032
+ var this_0 = StringBuilder_init_$Create$();
2033
+ // Inline function 'kotlin.contracts.contract' call
2034
+ // Inline function 'io.ktor.http.<get-authority>.<anonymous>' call
2035
+ this_0.j8(get_encodedUserAndPassword(_this__u8e3s4));
2036
+ this_0.j8(_this__u8e3s4.t1y_1);
2037
+ if (!(_this__u8e3s4.v1y_1 === 0) && !(_this__u8e3s4.v1y_1 === _this__u8e3s4.f1z().e1z_1)) {
2038
+ this_0.j8(':');
2039
+ this_0.j8(_this__u8e3s4.v1y_1.toString());
2040
+ }
2041
+ return this_0.toString();
2042
+ }
2043
+ function set_encodedPath(_this__u8e3s4, value) {
2044
+ _this__u8e3s4.a1z_1 = isBlank(value) ? emptyList() : value === '/' ? get_ROOT_PATH() : toMutableList(split(value, charArrayOf([_Char___init__impl__6a9atx(47)])));
2045
+ }
2046
+ function get_encodedPath(_this__u8e3s4) {
2047
+ return joinPath(_this__u8e3s4.a1z_1);
2048
+ }
2049
+ function appendTo(_this__u8e3s4, out) {
2050
+ out.f(_this__u8e3s4.f1z().d1z_1);
2051
+ var tmp45_subject = _this__u8e3s4.f1z().d1z_1;
2052
+ if (tmp45_subject === 'file') {
2053
+ appendFile(out, _this__u8e3s4.t1y_1, get_encodedPath(_this__u8e3s4));
2054
+ return out;
2055
+ } else if (tmp45_subject === 'mailto') {
2056
+ appendMailto(out, get_encodedUserAndPassword(_this__u8e3s4), _this__u8e3s4.t1y_1);
2057
+ return out;
2058
+ }
2059
+ out.f('://');
2060
+ out.f(get_authority(_this__u8e3s4));
2061
+ appendUrlFullPath(out, get_encodedPath(_this__u8e3s4), _this__u8e3s4.b1z_1, _this__u8e3s4.u1y_1);
2062
+ // Inline function 'kotlin.text.isNotEmpty' call
2063
+ var this_0 = _this__u8e3s4.z1y_1;
2064
+ if (charSequenceLength(this_0) > 0) {
2065
+ out.k8(_Char___init__impl__6a9atx(35));
2066
+ out.f(_this__u8e3s4.z1y_1);
2067
+ }
2068
+ return out;
2069
+ }
2070
+ function get_encodedUserAndPassword(_this__u8e3s4) {
2071
+ // Inline function 'kotlin.text.buildString' call
2072
+ // Inline function 'kotlin.contracts.contract' call
2073
+ // Inline function 'kotlin.apply' call
2074
+ var this_0 = StringBuilder_init_$Create$();
2075
+ // Inline function 'kotlin.contracts.contract' call
2076
+ // Inline function 'io.ktor.http.<get-encodedUserAndPassword>.<anonymous>' call
2077
+ appendUserAndPassword(this_0, _this__u8e3s4.x1y_1, _this__u8e3s4.y1y_1);
2078
+ return this_0.toString();
2079
+ }
2080
+ function joinPath(_this__u8e3s4) {
2081
+ if (_this__u8e3s4.p())
2082
+ return '';
2083
+ if (_this__u8e3s4.m() === 1) {
2084
+ // Inline function 'kotlin.text.isEmpty' call
2085
+ var this_0 = first_0(_this__u8e3s4);
2086
+ if (charSequenceLength(this_0) === 0)
2087
+ return '/';
2088
+ return first_0(_this__u8e3s4);
2089
+ }
2090
+ return joinToString(_this__u8e3s4, '/');
2091
+ }
2092
+ function appendFile(_this__u8e3s4, host, encodedPath) {
2093
+ _this__u8e3s4.f('://');
2094
+ _this__u8e3s4.f(host);
2095
+ if (!startsWith(encodedPath, _Char___init__impl__6a9atx(47))) {
2096
+ _this__u8e3s4.k8(_Char___init__impl__6a9atx(47));
2097
+ }
2098
+ _this__u8e3s4.f(encodedPath);
2099
+ }
2100
+ function appendMailto(_this__u8e3s4, encodedUser, host) {
2101
+ _this__u8e3s4.f(':');
2102
+ _this__u8e3s4.f(encodedUser);
2103
+ _this__u8e3s4.f(host);
2104
+ }
2105
+ function get_ROOT_PATH() {
2106
+ _init_properties_URLParser_kt__sf11to();
2107
+ return ROOT_PATH;
2108
+ }
2109
+ var ROOT_PATH;
2110
+ function takeFrom(_this__u8e3s4, urlString) {
2111
+ _init_properties_URLParser_kt__sf11to();
2112
+ if (isBlank(urlString))
2113
+ return _this__u8e3s4;
2114
+ var tmp;
2115
+ try {
2116
+ tmp = takeFromUnsafe(_this__u8e3s4, urlString);
2117
+ } catch ($p) {
2118
+ var tmp_0;
2119
+ if ($p instanceof Error) {
2120
+ var cause = $p;
2121
+ throw new URLParserException(urlString, cause);
2122
+ } else {
2123
+ throw $p;
2124
+ }
2125
+ }
2126
+ return tmp;
2127
+ }
2128
+ function takeFromUnsafe(_this__u8e3s4, urlString) {
2129
+ _init_properties_URLParser_kt__sf11to();
2130
+ var tmp$ret$1;
2131
+ $l$block: {
2132
+ // Inline function 'kotlin.text.indexOfFirst' call
2133
+ var inductionVariable = 0;
2134
+ var last = charSequenceLength(urlString) - 1 | 0;
2135
+ if (inductionVariable <= last)
2136
+ do {
2137
+ var index = inductionVariable;
2138
+ inductionVariable = inductionVariable + 1 | 0;
2139
+ // Inline function 'io.ktor.http.takeFromUnsafe.<anonymous>' call
2140
+ var it = charSequenceGet(urlString, index);
2141
+ if (!isWhitespace(it)) {
2142
+ tmp$ret$1 = index;
2143
+ break $l$block;
2144
+ }
2145
+ }
2146
+ while (inductionVariable <= last);
2147
+ tmp$ret$1 = -1;
2148
+ }
2149
+ var startIndex = tmp$ret$1;
2150
+ var tmp$ret$3;
2151
+ $l$block_0: {
2152
+ // Inline function 'kotlin.text.indexOfLast' call
2153
+ var inductionVariable_0 = charSequenceLength(urlString) - 1 | 0;
2154
+ if (0 <= inductionVariable_0)
2155
+ do {
2156
+ var index_0 = inductionVariable_0;
2157
+ inductionVariable_0 = inductionVariable_0 + -1 | 0;
2158
+ // Inline function 'io.ktor.http.takeFromUnsafe.<anonymous>' call
2159
+ var it_0 = charSequenceGet(urlString, index_0);
2160
+ if (!isWhitespace(it_0)) {
2161
+ tmp$ret$3 = index_0;
2162
+ break $l$block_0;
2163
+ }
2164
+ }
2165
+ while (0 <= inductionVariable_0);
2166
+ tmp$ret$3 = -1;
2167
+ }
2168
+ var endIndex = tmp$ret$3 + 1 | 0;
2169
+ var schemeLength = findScheme(urlString, startIndex, endIndex);
2170
+ if (schemeLength > 0) {
2171
+ // Inline function 'kotlin.text.substring' call
2172
+ var startIndex_0 = startIndex;
2173
+ var endIndex_0 = startIndex + schemeLength | 0;
2174
+ // Inline function 'kotlin.js.asDynamic' call
2175
+ var scheme = urlString.substring(startIndex_0, endIndex_0);
2176
+ _this__u8e3s4.z1z(Companion_getInstance_7().n20(scheme));
2177
+ startIndex = startIndex + (schemeLength + 1 | 0) | 0;
2178
+ }
2179
+ var slashCount = count(urlString, startIndex, endIndex, _Char___init__impl__6a9atx(47));
2180
+ startIndex = startIndex + slashCount | 0;
2181
+ if (_this__u8e3s4.f1z().d1z_1 === 'file') {
2182
+ parseFile(_this__u8e3s4, urlString, startIndex, endIndex, slashCount);
2183
+ return _this__u8e3s4;
2184
+ }
2185
+ if (_this__u8e3s4.f1z().d1z_1 === 'mailto') {
2186
+ // Inline function 'kotlin.require' call
2187
+ // Inline function 'kotlin.contracts.contract' call
2188
+ // Inline function 'kotlin.require' call
2189
+ // Inline function 'kotlin.contracts.contract' call
2190
+ if (!(slashCount === 0)) {
2191
+ // Inline function 'kotlin.require.<anonymous>' call
2192
+ var message = 'Failed requirement.';
2193
+ throw IllegalArgumentException_init_$Create$(toString(message));
2194
+ }
2195
+ parseMailto(_this__u8e3s4, urlString, startIndex, endIndex);
2196
+ return _this__u8e3s4;
2197
+ }
2198
+ if (slashCount >= 2) {
2199
+ loop: while (true) {
2200
+ // Inline function 'kotlin.takeIf' call
2201
+ var this_0 = indexOfAny(urlString, toCharArray('@/\\?#'), startIndex);
2202
+ // Inline function 'kotlin.contracts.contract' call
2203
+ var tmp;
2204
+ // Inline function 'io.ktor.http.takeFromUnsafe.<anonymous>' call
2205
+ if (this_0 > 0) {
2206
+ tmp = this_0;
2207
+ } else {
2208
+ tmp = null;
2209
+ }
2210
+ var tmp0_elvis_lhs = tmp;
2211
+ var delimiter = tmp0_elvis_lhs == null ? endIndex : tmp0_elvis_lhs;
2212
+ if (delimiter < endIndex && charSequenceGet(urlString, delimiter) === _Char___init__impl__6a9atx(64)) {
2213
+ var passwordIndex = indexOfColonInHostPort(urlString, startIndex, delimiter);
2214
+ if (!(passwordIndex === -1)) {
2215
+ var tmp_0 = _this__u8e3s4;
2216
+ // Inline function 'kotlin.text.substring' call
2217
+ var startIndex_1 = startIndex;
2218
+ // Inline function 'kotlin.js.asDynamic' call
2219
+ tmp_0.x1y_1 = urlString.substring(startIndex_1, passwordIndex);
2220
+ var tmp_1 = _this__u8e3s4;
2221
+ // Inline function 'kotlin.text.substring' call
2222
+ var startIndex_2 = passwordIndex + 1 | 0;
2223
+ // Inline function 'kotlin.js.asDynamic' call
2224
+ tmp_1.y1y_1 = urlString.substring(startIndex_2, delimiter);
2225
+ } else {
2226
+ var tmp_2 = _this__u8e3s4;
2227
+ // Inline function 'kotlin.text.substring' call
2228
+ var startIndex_3 = startIndex;
2229
+ // Inline function 'kotlin.js.asDynamic' call
2230
+ tmp_2.x1y_1 = urlString.substring(startIndex_3, delimiter);
2231
+ }
2232
+ startIndex = delimiter + 1 | 0;
2233
+ } else {
2234
+ fillHost(_this__u8e3s4, urlString, startIndex, delimiter);
2235
+ startIndex = delimiter;
2236
+ break loop;
2237
+ }
2238
+ }
2239
+ }
2240
+ if (startIndex >= endIndex) {
2241
+ _this__u8e3s4.a1z_1 = charSequenceGet(urlString, endIndex - 1 | 0) === _Char___init__impl__6a9atx(47) ? get_ROOT_PATH() : emptyList();
2242
+ return _this__u8e3s4;
2243
+ }
2244
+ var tmp_3 = _this__u8e3s4;
2245
+ var tmp_4;
2246
+ if (slashCount === 0) {
2247
+ tmp_4 = dropLast(_this__u8e3s4.a1z_1, 1);
2248
+ } else {
2249
+ tmp_4 = emptyList();
2250
+ }
2251
+ tmp_3.a1z_1 = tmp_4;
2252
+ // Inline function 'kotlin.takeIf' call
2253
+ var this_1 = indexOfAny(urlString, toCharArray('?#'), startIndex);
2254
+ // Inline function 'kotlin.contracts.contract' call
2255
+ var tmp_5;
2256
+ // Inline function 'io.ktor.http.takeFromUnsafe.<anonymous>' call
2257
+ if (this_1 > 0) {
2258
+ tmp_5 = this_1;
2259
+ } else {
2260
+ tmp_5 = null;
2261
+ }
2262
+ var tmp1_elvis_lhs = tmp_5;
2263
+ var pathEnd = tmp1_elvis_lhs == null ? endIndex : tmp1_elvis_lhs;
2264
+ if (pathEnd > startIndex) {
2265
+ // Inline function 'kotlin.text.substring' call
2266
+ var startIndex_4 = startIndex;
2267
+ // Inline function 'kotlin.js.asDynamic' call
2268
+ var rawPath = urlString.substring(startIndex_4, pathEnd);
2269
+ var tmp_6;
2270
+ var tmp_7;
2271
+ if (_this__u8e3s4.a1z_1.m() === 1) {
2272
+ // Inline function 'kotlin.text.isEmpty' call
2273
+ var this_2 = first_0(_this__u8e3s4.a1z_1);
2274
+ tmp_7 = charSequenceLength(this_2) === 0;
2275
+ } else {
2276
+ tmp_7 = false;
2277
+ }
2278
+ if (tmp_7) {
2279
+ tmp_6 = emptyList();
2280
+ } else {
2281
+ tmp_6 = _this__u8e3s4.a1z_1;
2282
+ }
2283
+ var basePath = tmp_6;
2284
+ var rawChunks = rawPath === '/' ? get_ROOT_PATH() : split(rawPath, charArrayOf([_Char___init__impl__6a9atx(47)]));
2285
+ var relativePath = plus_0(slashCount === 1 ? get_ROOT_PATH() : emptyList(), rawChunks);
2286
+ _this__u8e3s4.a1z_1 = plus_0(basePath, relativePath);
2287
+ startIndex = pathEnd;
2288
+ }
2289
+ if (startIndex < endIndex && charSequenceGet(urlString, startIndex) === _Char___init__impl__6a9atx(63)) {
2290
+ startIndex = parseQuery(_this__u8e3s4, urlString, startIndex, endIndex);
2291
+ }
2292
+ parseFragment(_this__u8e3s4, urlString, startIndex, endIndex);
2293
+ return _this__u8e3s4;
2294
+ }
2295
+ function URLParserException(urlString, cause) {
2296
+ IllegalStateException_init_$Init$('Fail to parse url: ' + urlString, cause, this);
2297
+ captureStack(this, URLParserException);
2298
+ }
2299
+ function findScheme(urlString, startIndex, endIndex) {
2300
+ _init_properties_URLParser_kt__sf11to();
2301
+ var current = startIndex;
2302
+ var incorrectSchemePosition = -1;
2303
+ var firstChar = charSequenceGet(urlString, current);
2304
+ if (!(_Char___init__impl__6a9atx(97) <= firstChar ? firstChar <= _Char___init__impl__6a9atx(122) : false) && !(_Char___init__impl__6a9atx(65) <= firstChar ? firstChar <= _Char___init__impl__6a9atx(90) : false)) {
2305
+ incorrectSchemePosition = current;
2306
+ }
2307
+ while (current < endIndex) {
2308
+ var char = charSequenceGet(urlString, current);
2309
+ if (char === _Char___init__impl__6a9atx(58)) {
2310
+ if (!(incorrectSchemePosition === -1)) {
2311
+ throw IllegalArgumentException_init_$Create$('Illegal character in scheme at position ' + incorrectSchemePosition);
2312
+ }
2313
+ return current - startIndex | 0;
2314
+ }
2315
+ if (char === _Char___init__impl__6a9atx(47) || char === _Char___init__impl__6a9atx(63) || char === _Char___init__impl__6a9atx(35))
2316
+ return -1;
2317
+ if (incorrectSchemePosition === -1 && !(_Char___init__impl__6a9atx(97) <= char ? char <= _Char___init__impl__6a9atx(122) : false) && !(_Char___init__impl__6a9atx(65) <= char ? char <= _Char___init__impl__6a9atx(90) : false) && !(_Char___init__impl__6a9atx(48) <= char ? char <= _Char___init__impl__6a9atx(57) : false) && !(char === _Char___init__impl__6a9atx(46)) && !(char === _Char___init__impl__6a9atx(43)) && !(char === _Char___init__impl__6a9atx(45))) {
2318
+ incorrectSchemePosition = current;
2319
+ }
2320
+ current = current + 1 | 0;
2321
+ }
2322
+ return -1;
2323
+ }
2324
+ function count(urlString, startIndex, endIndex, char) {
2325
+ _init_properties_URLParser_kt__sf11to();
2326
+ var result = 0;
2327
+ $l$loop: while ((startIndex + result | 0) < endIndex && charSequenceGet(urlString, startIndex + result | 0) === char) {
2328
+ result = result + 1 | 0;
2329
+ }
2330
+ return result;
2331
+ }
2332
+ function parseFile(_this__u8e3s4, urlString, startIndex, endIndex, slashCount) {
2333
+ _init_properties_URLParser_kt__sf11to();
2334
+ switch (slashCount) {
2335
+ case 2:
2336
+ var nextSlash = indexOf(urlString, _Char___init__impl__6a9atx(47), startIndex);
2337
+ if (nextSlash === -1 || nextSlash === endIndex) {
2338
+ var tmp = _this__u8e3s4;
2339
+ // Inline function 'kotlin.text.substring' call
2340
+ // Inline function 'kotlin.js.asDynamic' call
2341
+ tmp.t1y_1 = urlString.substring(startIndex, endIndex);
2342
+ return Unit_instance;
2343
+ }
2344
+
2345
+ var tmp_0 = _this__u8e3s4;
2346
+ // Inline function 'kotlin.text.substring' call
2347
+
2348
+ // Inline function 'kotlin.js.asDynamic' call
2349
+
2350
+ tmp_0.t1y_1 = urlString.substring(startIndex, nextSlash);
2351
+ // Inline function 'kotlin.text.substring' call
2352
+
2353
+ // Inline function 'kotlin.js.asDynamic' call
2354
+
2355
+ var tmp$ret$5 = urlString.substring(nextSlash, endIndex);
2356
+ set_encodedPath(_this__u8e3s4, tmp$ret$5);
2357
+ break;
2358
+ case 3:
2359
+ _this__u8e3s4.t1y_1 = '';
2360
+ // Inline function 'kotlin.text.substring' call
2361
+
2362
+ // Inline function 'kotlin.js.asDynamic' call
2363
+
2364
+ var tmp$ret$7 = urlString.substring(startIndex, endIndex);
2365
+ set_encodedPath(_this__u8e3s4, '/' + tmp$ret$7);
2366
+ break;
2367
+ default:
2368
+ throw IllegalArgumentException_init_$Create$('Invalid file url: ' + urlString);
2369
+ }
2370
+ }
2371
+ function parseMailto(_this__u8e3s4, urlString, startIndex, endIndex) {
2372
+ _init_properties_URLParser_kt__sf11to();
2373
+ var delimiter = indexOf_0(urlString, '@', startIndex);
2374
+ if (delimiter === -1) {
2375
+ throw IllegalArgumentException_init_$Create$('Invalid mailto url: ' + urlString + ", it should contain '@'.");
2376
+ }
2377
+ // Inline function 'kotlin.text.substring' call
2378
+ // Inline function 'kotlin.js.asDynamic' call
2379
+ var tmp$ret$1 = urlString.substring(startIndex, delimiter);
2380
+ _this__u8e3s4.g20(decodeURLPart(tmp$ret$1));
2381
+ var tmp = _this__u8e3s4;
2382
+ // Inline function 'kotlin.text.substring' call
2383
+ var startIndex_0 = delimiter + 1 | 0;
2384
+ // Inline function 'kotlin.js.asDynamic' call
2385
+ tmp.t1y_1 = urlString.substring(startIndex_0, endIndex);
2386
+ }
2387
+ function indexOfColonInHostPort(_this__u8e3s4, startIndex, endIndex) {
2388
+ _init_properties_URLParser_kt__sf11to();
2389
+ var skip = false;
2390
+ var inductionVariable = startIndex;
2391
+ if (inductionVariable < endIndex)
2392
+ do {
2393
+ var index = inductionVariable;
2394
+ inductionVariable = inductionVariable + 1 | 0;
2395
+ var tmp48_subject = charSequenceGet(_this__u8e3s4, index);
2396
+ if (tmp48_subject === _Char___init__impl__6a9atx(91))
2397
+ skip = true;
2398
+ else if (tmp48_subject === _Char___init__impl__6a9atx(93))
2399
+ skip = false;
2400
+ else if (tmp48_subject === _Char___init__impl__6a9atx(58))
2401
+ if (!skip)
2402
+ return index;
2403
+ }
2404
+ while (inductionVariable < endIndex);
2405
+ return -1;
2406
+ }
2407
+ function fillHost(_this__u8e3s4, urlString, startIndex, endIndex) {
2408
+ _init_properties_URLParser_kt__sf11to();
2409
+ // Inline function 'kotlin.takeIf' call
2410
+ var this_0 = indexOfColonInHostPort(urlString, startIndex, endIndex);
2411
+ // Inline function 'kotlin.contracts.contract' call
2412
+ var tmp;
2413
+ // Inline function 'io.ktor.http.fillHost.<anonymous>' call
2414
+ if (this_0 > 0) {
2415
+ tmp = this_0;
2416
+ } else {
2417
+ tmp = null;
2418
+ }
2419
+ var tmp0_elvis_lhs = tmp;
2420
+ var colonIndex = tmp0_elvis_lhs == null ? endIndex : tmp0_elvis_lhs;
2421
+ var tmp_0 = _this__u8e3s4;
2422
+ // Inline function 'kotlin.text.substring' call
2423
+ // Inline function 'kotlin.js.asDynamic' call
2424
+ tmp_0.t1y_1 = urlString.substring(startIndex, colonIndex);
2425
+ if ((colonIndex + 1 | 0) < endIndex) {
2426
+ // Inline function 'kotlin.text.substring' call
2427
+ var startIndex_0 = colonIndex + 1 | 0;
2428
+ // Inline function 'kotlin.js.asDynamic' call
2429
+ var tmp$ret$5 = urlString.substring(startIndex_0, endIndex);
2430
+ _this__u8e3s4.y1z(toInt(tmp$ret$5));
2431
+ } else {
2432
+ _this__u8e3s4.y1z(0);
2433
+ }
2434
+ }
2435
+ function parseQuery(_this__u8e3s4, urlString, startIndex, endIndex) {
2436
+ _init_properties_URLParser_kt__sf11to();
2437
+ if ((startIndex + 1 | 0) === endIndex) {
2438
+ _this__u8e3s4.u1y_1 = true;
2439
+ return endIndex;
2440
+ }
2441
+ // Inline function 'kotlin.takeIf' call
2442
+ var this_0 = indexOf(urlString, _Char___init__impl__6a9atx(35), startIndex + 1 | 0);
2443
+ // Inline function 'kotlin.contracts.contract' call
2444
+ var tmp;
2445
+ // Inline function 'io.ktor.http.parseQuery.<anonymous>' call
2446
+ if (this_0 > 0) {
2447
+ tmp = this_0;
2448
+ } else {
2449
+ tmp = null;
2450
+ }
2451
+ var tmp0_elvis_lhs = tmp;
2452
+ var fragmentStart = tmp0_elvis_lhs == null ? endIndex : tmp0_elvis_lhs;
2453
+ // Inline function 'kotlin.text.substring' call
2454
+ var startIndex_0 = startIndex + 1 | 0;
2455
+ // Inline function 'kotlin.js.asDynamic' call
2456
+ var tmp$ret$3 = urlString.substring(startIndex_0, fragmentStart);
2457
+ var rawParameters = parseQueryString(tmp$ret$3, VOID, VOID, false);
2458
+ rawParameters.g1l(parseQuery$lambda(_this__u8e3s4));
2459
+ return fragmentStart;
2460
+ }
2461
+ function parseFragment(_this__u8e3s4, urlString, startIndex, endIndex) {
2462
+ _init_properties_URLParser_kt__sf11to();
2463
+ if (startIndex < endIndex && charSequenceGet(urlString, startIndex) === _Char___init__impl__6a9atx(35)) {
2464
+ var tmp = _this__u8e3s4;
2465
+ // Inline function 'kotlin.text.substring' call
2466
+ var startIndex_0 = startIndex + 1 | 0;
2467
+ // Inline function 'kotlin.js.asDynamic' call
2468
+ tmp.z1y_1 = urlString.substring(startIndex_0, endIndex);
2469
+ }
2470
+ }
2471
+ function parseQuery$lambda($this_parseQuery) {
2472
+ return function (key, values) {
2473
+ $this_parseQuery.b1z_1.k1l(key, values);
2474
+ return Unit_instance;
2475
+ };
2476
+ }
2477
+ var properties_initialized_URLParser_kt_hd1g6a;
2478
+ function _init_properties_URLParser_kt__sf11to() {
2479
+ if (!properties_initialized_URLParser_kt_hd1g6a) {
2480
+ properties_initialized_URLParser_kt_hd1g6a = true;
2481
+ ROOT_PATH = listOf_0('');
2482
+ }
2483
+ }
2484
+ function Companion_7() {
2485
+ Companion_instance_7 = this;
2486
+ this.a20_1 = new URLProtocol('http', 80);
2487
+ this.b20_1 = new URLProtocol('https', 443);
2488
+ this.c20_1 = new URLProtocol('ws', 80);
2489
+ this.d20_1 = new URLProtocol('wss', 443);
2490
+ this.e20_1 = new URLProtocol('socks', 1080);
2491
+ var tmp = this;
2492
+ // Inline function 'kotlin.collections.associateBy' call
2493
+ var this_0 = listOf([this.a20_1, this.b20_1, this.c20_1, this.d20_1, this.e20_1]);
2494
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
2495
+ // Inline function 'kotlin.collections.associateByTo' call
2496
+ var destination = LinkedHashMap_init_$Create$(capacity);
2497
+ var tmp0_iterator = this_0.j();
2498
+ while (tmp0_iterator.k()) {
2499
+ var element = tmp0_iterator.l();
2500
+ // Inline function 'io.ktor.http.Companion.byName.<anonymous>' call
2501
+ var tmp$ret$0 = element.d1z_1;
2502
+ destination.i2(tmp$ret$0, element);
2503
+ }
2504
+ tmp.f20_1 = destination;
2505
+ }
2506
+ protoOf(Companion_7).n20 = function (name) {
2507
+ // Inline function 'kotlin.let' call
2508
+ // Inline function 'kotlin.contracts.contract' call
2509
+ // Inline function 'io.ktor.http.Companion.createOrDefault.<anonymous>' call
2510
+ var it = toLowerCasePreservingASCIIRules(name);
2511
+ var tmp0_elvis_lhs = Companion_getInstance_7().f20_1.f2(it);
2512
+ return tmp0_elvis_lhs == null ? new URLProtocol(it, 0) : tmp0_elvis_lhs;
2513
+ };
2514
+ var Companion_instance_7;
2515
+ function Companion_getInstance_7() {
2516
+ if (Companion_instance_7 == null)
2517
+ new Companion_7();
2518
+ return Companion_instance_7;
2519
+ }
2520
+ function URLProtocol(name, defaultPort) {
2521
+ Companion_getInstance_7();
2522
+ this.d1z_1 = name;
2523
+ this.e1z_1 = defaultPort;
2524
+ // Inline function 'kotlin.require' call
2525
+ var tmp$ret$1;
2526
+ $l$block: {
2527
+ // Inline function 'kotlin.text.all' call
2528
+ var indexedObject = this.d1z_1;
2529
+ var inductionVariable = 0;
2530
+ while (inductionVariable < charSequenceLength(indexedObject)) {
2531
+ var element = charSequenceGet(indexedObject, inductionVariable);
2532
+ inductionVariable = inductionVariable + 1 | 0;
2533
+ // Inline function 'io.ktor.http.URLProtocol.<anonymous>' call
2534
+ if (!isLowerCase(element)) {
2535
+ tmp$ret$1 = false;
2536
+ break $l$block;
2537
+ }
2538
+ }
2539
+ tmp$ret$1 = true;
2540
+ }
2541
+ // Inline function 'kotlin.contracts.contract' call
2542
+ if (!tmp$ret$1) {
2543
+ // Inline function 'io.ktor.http.URLProtocol.<anonymous>' call
2544
+ var message = 'All characters should be lower case';
2545
+ throw IllegalArgumentException_init_$Create$(toString(message));
2546
+ }
2547
+ }
2548
+ protoOf(URLProtocol).toString = function () {
2549
+ return 'URLProtocol(name=' + this.d1z_1 + ', defaultPort=' + this.e1z_1 + ')';
2550
+ };
2551
+ protoOf(URLProtocol).hashCode = function () {
2552
+ var result = getStringHashCode(this.d1z_1);
2553
+ result = imul(result, 31) + this.e1z_1 | 0;
2554
+ return result;
2555
+ };
2556
+ protoOf(URLProtocol).equals = function (other) {
2557
+ if (this === other)
2558
+ return true;
2559
+ if (!(other instanceof URLProtocol))
2560
+ return false;
2561
+ var tmp0_other_with_cast = other instanceof URLProtocol ? other : THROW_CCE();
2562
+ if (!(this.d1z_1 === tmp0_other_with_cast.d1z_1))
2563
+ return false;
2564
+ if (!(this.e1z_1 === tmp0_other_with_cast.e1z_1))
2565
+ return false;
2566
+ return true;
2567
+ };
2568
+ function isSecure(_this__u8e3s4) {
2569
+ return _this__u8e3s4.d1z_1 === 'https' || _this__u8e3s4.d1z_1 === 'wss';
2570
+ }
2571
+ function isWebsocket(_this__u8e3s4) {
2572
+ return _this__u8e3s4.d1z_1 === 'ws' || _this__u8e3s4.d1z_1 === 'wss';
2573
+ }
2574
+ function takeFrom_0(_this__u8e3s4, url) {
2575
+ _this__u8e3s4.w1y_1 = url.w1y_1;
2576
+ _this__u8e3s4.t1y_1 = url.t1y_1;
2577
+ _this__u8e3s4.y1z(url.v1y_1);
2578
+ _this__u8e3s4.a1z_1 = url.a1z_1;
2579
+ _this__u8e3s4.x1y_1 = url.x1y_1;
2580
+ _this__u8e3s4.y1y_1 = url.y1y_1;
2581
+ // Inline function 'kotlin.apply' call
2582
+ var this_0 = ParametersBuilder();
2583
+ // Inline function 'kotlin.contracts.contract' call
2584
+ // Inline function 'io.ktor.http.takeFrom.<anonymous>' call
2585
+ appendAll(this_0, url.b1z_1);
2586
+ _this__u8e3s4.l20(this_0);
2587
+ _this__u8e3s4.z1y_1 = url.z1y_1;
2588
+ _this__u8e3s4.u1y_1 = url.u1y_1;
2589
+ return _this__u8e3s4;
2590
+ }
2591
+ function get_hostWithPortIfSpecified(_this__u8e3s4) {
2592
+ var tmp50_subject = _this__u8e3s4.h1z_1;
2593
+ return tmp50_subject === 0 || tmp50_subject === _this__u8e3s4.q1z_1.e1z_1 ? _this__u8e3s4.g1z_1 : get_hostWithPort(_this__u8e3s4);
2594
+ }
2595
+ function appendUserAndPassword(_this__u8e3s4, encodedUser, encodedPassword) {
2596
+ if (encodedUser == null) {
2597
+ return Unit_instance;
2598
+ }
2599
+ _this__u8e3s4.j8(encodedUser);
2600
+ if (!(encodedPassword == null)) {
2601
+ _this__u8e3s4.k8(_Char___init__impl__6a9atx(58));
2602
+ _this__u8e3s4.j8(encodedPassword);
2603
+ }
2604
+ _this__u8e3s4.j8('@');
2605
+ }
2606
+ function Url(urlString) {
2607
+ return URLBuilder_0(urlString).o1r();
2608
+ }
2609
+ function appendUrlFullPath(_this__u8e3s4, encodedPath, encodedQueryParameters, trailingQuery) {
2610
+ var tmp;
2611
+ // Inline function 'kotlin.text.isNotBlank' call
2612
+ if (!isBlank(encodedPath)) {
2613
+ tmp = !startsWith_0(encodedPath, '/');
2614
+ } else {
2615
+ tmp = false;
2616
+ }
2617
+ if (tmp) {
2618
+ _this__u8e3s4.k8(_Char___init__impl__6a9atx(47));
2619
+ }
2620
+ _this__u8e3s4.f(encodedPath);
2621
+ if (!encodedQueryParameters.p() || trailingQuery) {
2622
+ _this__u8e3s4.f('?');
2623
+ }
2624
+ // Inline function 'kotlin.collections.flatMap' call
2625
+ // Inline function 'kotlin.collections.flatMapTo' call
2626
+ var this_0 = encodedQueryParameters.f1l();
2627
+ var destination = ArrayList_init_$Create$_0();
2628
+ var tmp0_iterator = this_0.j();
2629
+ while (tmp0_iterator.k()) {
2630
+ var element = tmp0_iterator.l();
2631
+ // Inline function 'io.ktor.http.appendUrlFullPath.<anonymous>' call
2632
+ // Inline function 'kotlin.collections.component1' call
2633
+ var key = element.t();
2634
+ // Inline function 'kotlin.collections.component2' call
2635
+ var value = element.u();
2636
+ var tmp_0;
2637
+ if (value.p()) {
2638
+ tmp_0 = listOf_0(to(key, null));
2639
+ } else {
2640
+ // Inline function 'kotlin.collections.map' call
2641
+ // Inline function 'kotlin.collections.mapTo' call
2642
+ var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(value, 10));
2643
+ var tmp0_iterator_0 = value.j();
2644
+ while (tmp0_iterator_0.k()) {
2645
+ var item = tmp0_iterator_0.l();
2646
+ // Inline function 'io.ktor.http.appendUrlFullPath.<anonymous>.<anonymous>' call
2647
+ var tmp$ret$3 = to(key, item);
2648
+ destination_0.e(tmp$ret$3);
2649
+ }
2650
+ tmp_0 = destination_0;
2651
+ }
2652
+ var list = tmp_0;
2653
+ addAll(destination, list);
2654
+ }
2655
+ var tmp_1 = destination;
2656
+ joinTo(tmp_1, _this__u8e3s4, '&', VOID, VOID, VOID, VOID, appendUrlFullPath$lambda);
2657
+ }
2658
+ function get_hostWithPort(_this__u8e3s4) {
2659
+ return _this__u8e3s4.g1z_1 + ':' + _this__u8e3s4.o20();
2660
+ }
2661
+ function URLBuilder_0(urlString) {
2662
+ return takeFrom(new URLBuilder(), urlString);
2663
+ }
2664
+ function URLBuilder_1(url) {
2665
+ return takeFrom_1(new URLBuilder(), url);
2666
+ }
2667
+ function takeFrom_1(_this__u8e3s4, url) {
2668
+ _this__u8e3s4.w1y_1 = url.p1z_1;
2669
+ _this__u8e3s4.t1y_1 = url.g1z_1;
2670
+ _this__u8e3s4.y1z(url.o20());
2671
+ set_encodedPath(_this__u8e3s4, url.p20());
2672
+ _this__u8e3s4.x1y_1 = url.q20();
2673
+ _this__u8e3s4.y1y_1 = url.r20();
2674
+ // Inline function 'kotlin.apply' call
2675
+ var this_0 = ParametersBuilder();
2676
+ // Inline function 'kotlin.contracts.contract' call
2677
+ // Inline function 'io.ktor.http.takeFrom.<anonymous>' call
2678
+ this_0.q1l(parseQueryString(url.s20(), VOID, VOID, false));
2679
+ _this__u8e3s4.l20(this_0);
2680
+ _this__u8e3s4.z1y_1 = url.t20();
2681
+ _this__u8e3s4.u1y_1 = url.n1z_1;
2682
+ return _this__u8e3s4;
2683
+ }
2684
+ function appendUrlFullPath$lambda(it) {
2685
+ var key = it.cg_1;
2686
+ var tmp;
2687
+ if (it.dg_1 == null) {
2688
+ tmp = key;
2689
+ } else {
2690
+ var value = toString_1(it.dg_1);
2691
+ tmp = key + '=' + value;
2692
+ }
2693
+ return tmp;
2694
+ }
2695
+ function Companion_8() {
2696
+ }
2697
+ var Companion_instance_8;
2698
+ function Companion_getInstance_8() {
2699
+ return Companion_instance_8;
2700
+ }
2701
+ function Url$encodedPath$delegate$lambda(this$0) {
2702
+ return function () {
2703
+ var tmp;
2704
+ if (this$0.i1z_1.p()) {
2705
+ return '';
2706
+ }
2707
+ var pathStartIndex = indexOf(this$0.o1z_1, _Char___init__impl__6a9atx(47), this$0.q1z_1.d1z_1.length + 3 | 0);
2708
+ var tmp_0;
2709
+ if (pathStartIndex === -1) {
2710
+ return '';
2711
+ }
2712
+ // Inline function 'kotlin.charArrayOf' call
2713
+ var tmp$ret$0 = charArrayOf([_Char___init__impl__6a9atx(63), _Char___init__impl__6a9atx(35)]);
2714
+ var pathEndIndex = indexOfAny(this$0.o1z_1, tmp$ret$0, pathStartIndex);
2715
+ var tmp_1;
2716
+ if (pathEndIndex === -1) {
2717
+ // Inline function 'kotlin.text.substring' call
2718
+ // Inline function 'kotlin.js.asDynamic' call
2719
+ return this$0.o1z_1.substring(pathStartIndex);
2720
+ }
2721
+ // Inline function 'kotlin.text.substring' call
2722
+ // Inline function 'kotlin.js.asDynamic' call
2723
+ return this$0.o1z_1.substring(pathStartIndex, pathEndIndex);
2724
+ };
2725
+ }
2726
+ function Url$encodedQuery$delegate$lambda(this$0) {
2727
+ return function () {
2728
+ var queryStart = indexOf(this$0.o1z_1, _Char___init__impl__6a9atx(63)) + 1 | 0;
2729
+ var tmp;
2730
+ if (queryStart === 0) {
2731
+ return '';
2732
+ }
2733
+ var queryEnd = indexOf(this$0.o1z_1, _Char___init__impl__6a9atx(35), queryStart);
2734
+ var tmp_0;
2735
+ if (queryEnd === -1) {
2736
+ // Inline function 'kotlin.text.substring' call
2737
+ // Inline function 'kotlin.js.asDynamic' call
2738
+ return this$0.o1z_1.substring(queryStart);
2739
+ }
2740
+ // Inline function 'kotlin.text.substring' call
2741
+ // Inline function 'kotlin.js.asDynamic' call
2742
+ return this$0.o1z_1.substring(queryStart, queryEnd);
2743
+ };
2744
+ }
2745
+ function Url$encodedPathAndQuery$delegate$lambda(this$0) {
2746
+ return function () {
2747
+ var pathStart = indexOf(this$0.o1z_1, _Char___init__impl__6a9atx(47), this$0.q1z_1.d1z_1.length + 3 | 0);
2748
+ var tmp;
2749
+ if (pathStart === -1) {
2750
+ return '';
2751
+ }
2752
+ var queryEnd = indexOf(this$0.o1z_1, _Char___init__impl__6a9atx(35), pathStart);
2753
+ var tmp_0;
2754
+ if (queryEnd === -1) {
2755
+ // Inline function 'kotlin.text.substring' call
2756
+ // Inline function 'kotlin.js.asDynamic' call
2757
+ return this$0.o1z_1.substring(pathStart);
2758
+ }
2759
+ // Inline function 'kotlin.text.substring' call
2760
+ // Inline function 'kotlin.js.asDynamic' call
2761
+ return this$0.o1z_1.substring(pathStart, queryEnd);
2762
+ };
2763
+ }
2764
+ function Url$encodedUser$delegate$lambda(this$0) {
2765
+ return function () {
2766
+ var tmp;
2767
+ if (this$0.l1z_1 == null) {
2768
+ return null;
2769
+ }
2770
+ var tmp_0;
2771
+ // Inline function 'kotlin.text.isEmpty' call
2772
+ var this_0 = this$0.l1z_1;
2773
+ if (charSequenceLength(this_0) === 0) {
2774
+ return '';
2775
+ }
2776
+ var usernameStart = this$0.q1z_1.d1z_1.length + 3 | 0;
2777
+ // Inline function 'kotlin.charArrayOf' call
2778
+ var tmp$ret$1 = charArrayOf([_Char___init__impl__6a9atx(58), _Char___init__impl__6a9atx(64)]);
2779
+ var usernameEnd = indexOfAny(this$0.o1z_1, tmp$ret$1, usernameStart);
2780
+ // Inline function 'kotlin.text.substring' call
2781
+ // Inline function 'kotlin.js.asDynamic' call
2782
+ return this$0.o1z_1.substring(usernameStart, usernameEnd);
2783
+ };
2784
+ }
2785
+ function Url$encodedPassword$delegate$lambda(this$0) {
2786
+ return function () {
2787
+ var tmp;
2788
+ if (this$0.m1z_1 == null) {
2789
+ return null;
2790
+ }
2791
+ var tmp_0;
2792
+ // Inline function 'kotlin.text.isEmpty' call
2793
+ var this_0 = this$0.m1z_1;
2794
+ if (charSequenceLength(this_0) === 0) {
2795
+ return '';
2796
+ }
2797
+ var passwordStart = indexOf(this$0.o1z_1, _Char___init__impl__6a9atx(58), this$0.q1z_1.d1z_1.length + 3 | 0) + 1 | 0;
2798
+ var passwordEnd = indexOf(this$0.o1z_1, _Char___init__impl__6a9atx(64));
2799
+ // Inline function 'kotlin.text.substring' call
2800
+ // Inline function 'kotlin.js.asDynamic' call
2801
+ return this$0.o1z_1.substring(passwordStart, passwordEnd);
2802
+ };
2803
+ }
2804
+ function Url$encodedFragment$delegate$lambda(this$0) {
2805
+ return function () {
2806
+ var fragmentStart = indexOf(this$0.o1z_1, _Char___init__impl__6a9atx(35)) + 1 | 0;
2807
+ var tmp;
2808
+ if (fragmentStart === 0) {
2809
+ return '';
2810
+ }
2811
+ // Inline function 'kotlin.text.substring' call
2812
+ // Inline function 'kotlin.js.asDynamic' call
2813
+ return this$0.o1z_1.substring(fragmentStart);
2814
+ };
2815
+ }
2816
+ function Url_0(protocol, host, specifiedPort, pathSegments, parameters, fragment, user, password, trailingQuery, urlString) {
2817
+ this.g1z_1 = host;
2818
+ this.h1z_1 = specifiedPort;
2819
+ this.i1z_1 = pathSegments;
2820
+ this.j1z_1 = parameters;
2821
+ this.k1z_1 = fragment;
2822
+ this.l1z_1 = user;
2823
+ this.m1z_1 = password;
2824
+ this.n1z_1 = trailingQuery;
2825
+ this.o1z_1 = urlString;
2826
+ // Inline function 'kotlin.require' call
2827
+ var containsArg = this.h1z_1;
2828
+ // Inline function 'kotlin.contracts.contract' call
2829
+ if (!(0 <= containsArg ? containsArg <= 65535 : false)) {
2830
+ // Inline function 'io.ktor.http.Url.<anonymous>' call
2831
+ var message = 'Port must be between 0 and 65535, or 0 if not set. Provided: ' + this.h1z_1;
2832
+ throw IllegalArgumentException_init_$Create$(toString(message));
2833
+ }
2834
+ this.p1z_1 = protocol;
2835
+ var tmp = this;
2836
+ var tmp0_elvis_lhs = this.p1z_1;
2837
+ tmp.q1z_1 = tmp0_elvis_lhs == null ? Companion_getInstance_7().a20_1 : tmp0_elvis_lhs;
2838
+ var tmp_0 = this;
2839
+ tmp_0.r1z_1 = lazy_0(Url$encodedPath$delegate$lambda(this));
2840
+ var tmp_1 = this;
2841
+ tmp_1.s1z_1 = lazy_0(Url$encodedQuery$delegate$lambda(this));
2842
+ var tmp_2 = this;
2843
+ tmp_2.t1z_1 = lazy_0(Url$encodedPathAndQuery$delegate$lambda(this));
2844
+ var tmp_3 = this;
2845
+ tmp_3.u1z_1 = lazy_0(Url$encodedUser$delegate$lambda(this));
2846
+ var tmp_4 = this;
2847
+ tmp_4.v1z_1 = lazy_0(Url$encodedPassword$delegate$lambda(this));
2848
+ var tmp_5 = this;
2849
+ tmp_5.w1z_1 = lazy_0(Url$encodedFragment$delegate$lambda(this));
2850
+ }
2851
+ protoOf(Url_0).o20 = function () {
2852
+ // Inline function 'kotlin.takeUnless' call
2853
+ var this_0 = this.h1z_1;
2854
+ // Inline function 'kotlin.contracts.contract' call
2855
+ var tmp;
2856
+ // Inline function 'io.ktor.http.Url.<get-port>.<anonymous>' call
2857
+ if (!(this_0 === 0)) {
2858
+ tmp = this_0;
2859
+ } else {
2860
+ tmp = null;
2861
+ }
2862
+ var tmp0_elvis_lhs = tmp;
2863
+ return tmp0_elvis_lhs == null ? this.q1z_1.e1z_1 : tmp0_elvis_lhs;
2864
+ };
2865
+ protoOf(Url_0).p20 = function () {
2866
+ // Inline function 'kotlin.getValue' call
2867
+ var this_0 = this.r1z_1;
2868
+ encodedPath$factory();
2869
+ return this_0.u();
2870
+ };
2871
+ protoOf(Url_0).s20 = function () {
2872
+ // Inline function 'kotlin.getValue' call
2873
+ var this_0 = this.s1z_1;
2874
+ encodedQuery$factory();
2875
+ return this_0.u();
2876
+ };
2877
+ protoOf(Url_0).q20 = function () {
2878
+ // Inline function 'kotlin.getValue' call
2879
+ var this_0 = this.u1z_1;
2880
+ encodedUser$factory();
2881
+ return this_0.u();
2882
+ };
2883
+ protoOf(Url_0).r20 = function () {
2884
+ // Inline function 'kotlin.getValue' call
2885
+ var this_0 = this.v1z_1;
2886
+ encodedPassword$factory();
2887
+ return this_0.u();
2888
+ };
2889
+ protoOf(Url_0).t20 = function () {
2890
+ // Inline function 'kotlin.getValue' call
2891
+ var this_0 = this.w1z_1;
2892
+ encodedFragment$factory();
2893
+ return this_0.u();
2894
+ };
2895
+ protoOf(Url_0).toString = function () {
2896
+ return this.o1z_1;
2897
+ };
2898
+ protoOf(Url_0).equals = function (other) {
2899
+ if (this === other)
2900
+ return true;
2901
+ if (other == null || !getKClassFromExpression(this).equals(getKClassFromExpression(other)))
2902
+ return false;
2903
+ if (!(other instanceof Url_0))
2904
+ THROW_CCE();
2905
+ if (!(this.o1z_1 === other.o1z_1))
2906
+ return false;
2907
+ return true;
2908
+ };
2909
+ protoOf(Url_0).hashCode = function () {
2910
+ return getStringHashCode(this.o1z_1);
2911
+ };
2912
+ function get_authority_0(_this__u8e3s4) {
2913
+ // Inline function 'kotlin.text.buildString' call
2914
+ // Inline function 'kotlin.contracts.contract' call
2915
+ // Inline function 'kotlin.apply' call
2916
+ var this_0 = StringBuilder_init_$Create$();
2917
+ // Inline function 'kotlin.contracts.contract' call
2918
+ // Inline function 'io.ktor.http.<get-authority>.<anonymous>' call
2919
+ this_0.j8(get_encodedUserAndPassword_0(_this__u8e3s4));
2920
+ this_0.j8(get_hostWithPortIfSpecified(_this__u8e3s4));
2921
+ return this_0.toString();
2922
+ }
2923
+ function get_encodedUserAndPassword_0(_this__u8e3s4) {
2924
+ // Inline function 'kotlin.text.buildString' call
2925
+ // Inline function 'kotlin.contracts.contract' call
2926
+ // Inline function 'kotlin.apply' call
2927
+ var this_0 = StringBuilder_init_$Create$();
2928
+ // Inline function 'kotlin.contracts.contract' call
2929
+ // Inline function 'io.ktor.http.<get-encodedUserAndPassword>.<anonymous>' call
2930
+ appendUserAndPassword(this_0, _this__u8e3s4.q20(), _this__u8e3s4.r20());
2931
+ return this_0.toString();
2932
+ }
2933
+ function encodedPath$factory() {
2934
+ return getPropertyCallableRef('encodedPath', 1, KProperty1, function (receiver) {
2935
+ return receiver.p20();
2936
+ }, null);
2937
+ }
2938
+ function encodedQuery$factory() {
2939
+ return getPropertyCallableRef('encodedQuery', 1, KProperty1, function (receiver) {
2940
+ return receiver.s20();
2941
+ }, null);
2942
+ }
2943
+ function encodedUser$factory() {
2944
+ return getPropertyCallableRef('encodedUser', 1, KProperty1, function (receiver) {
2945
+ return receiver.q20();
2946
+ }, null);
2947
+ }
2948
+ function encodedPassword$factory() {
2949
+ return getPropertyCallableRef('encodedPassword', 1, KProperty1, function (receiver) {
2950
+ return receiver.r20();
2951
+ }, null);
2952
+ }
2953
+ function encodedFragment$factory() {
2954
+ return getPropertyCallableRef('encodedFragment', 1, KProperty1, function (receiver) {
2955
+ return receiver.t20();
2956
+ }, null);
2957
+ }
2958
+ function UrlDecodedParametersBuilder(encodedParametersBuilder) {
2959
+ this.u20_1 = encodedParametersBuilder;
2960
+ this.v20_1 = this.u20_1.c1l();
2961
+ }
2962
+ protoOf(UrlDecodedParametersBuilder).o1r = function () {
2963
+ return decodeParameters(this.u20_1);
2964
+ };
2965
+ protoOf(UrlDecodedParametersBuilder).c1l = function () {
2966
+ return this.v20_1;
2967
+ };
2968
+ protoOf(UrlDecodedParametersBuilder).d1l = function (name) {
2969
+ var tmp51_safe_receiver = this.u20_1.d1l(encodeURLParameter(name));
2970
+ var tmp;
2971
+ if (tmp51_safe_receiver == null) {
2972
+ tmp = null;
2973
+ } else {
2974
+ // Inline function 'kotlin.collections.map' call
2975
+ // Inline function 'kotlin.collections.mapTo' call
2976
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(tmp51_safe_receiver, 10));
2977
+ var tmp0_iterator = tmp51_safe_receiver.j();
2978
+ while (tmp0_iterator.k()) {
2979
+ var item = tmp0_iterator.l();
2980
+ // Inline function 'io.ktor.http.UrlDecodedParametersBuilder.getAll.<anonymous>' call
2981
+ var tmp$ret$0 = decodeURLQueryComponent(item, VOID, VOID, true);
2982
+ destination.e(tmp$ret$0);
2983
+ }
2984
+ tmp = destination;
2985
+ }
2986
+ return tmp;
2987
+ };
2988
+ protoOf(UrlDecodedParametersBuilder).l1l = function (name) {
2989
+ return this.u20_1.l1l(encodeURLParameter(name));
2990
+ };
2991
+ protoOf(UrlDecodedParametersBuilder).e1l = function () {
2992
+ // Inline function 'kotlin.collections.map' call
2993
+ var this_0 = this.u20_1.e1l();
2994
+ // Inline function 'kotlin.collections.mapTo' call
2995
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
2996
+ var tmp0_iterator = this_0.j();
2997
+ while (tmp0_iterator.k()) {
2998
+ var item = tmp0_iterator.l();
2999
+ // Inline function 'io.ktor.http.UrlDecodedParametersBuilder.names.<anonymous>' call
3000
+ var tmp$ret$0 = decodeURLQueryComponent(item);
3001
+ destination.e(tmp$ret$0);
3002
+ }
3003
+ return toSet(destination);
3004
+ };
3005
+ protoOf(UrlDecodedParametersBuilder).p = function () {
3006
+ return this.u20_1.p();
3007
+ };
3008
+ protoOf(UrlDecodedParametersBuilder).f1l = function () {
3009
+ return decodeParameters(this.u20_1).f1l();
3010
+ };
3011
+ protoOf(UrlDecodedParametersBuilder).p1l = function (name, value) {
3012
+ return this.u20_1.p1l(encodeURLParameter(name), encodeURLParameterValue(value));
3013
+ };
3014
+ protoOf(UrlDecodedParametersBuilder).q1l = function (stringValues) {
3015
+ return appendAllEncoded(this.u20_1, stringValues);
3016
+ };
3017
+ protoOf(UrlDecodedParametersBuilder).k1l = function (name, values) {
3018
+ var tmp = encodeURLParameter(name);
3019
+ // Inline function 'kotlin.collections.map' call
3020
+ // Inline function 'kotlin.collections.mapTo' call
3021
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(values, 10));
3022
+ var tmp0_iterator = values.j();
3023
+ while (tmp0_iterator.k()) {
3024
+ var item = tmp0_iterator.l();
3025
+ // Inline function 'io.ktor.http.UrlDecodedParametersBuilder.appendAll.<anonymous>' call
3026
+ var tmp$ret$0 = encodeURLParameterValue(item);
3027
+ destination.e(tmp$ret$0);
3028
+ }
3029
+ return this.u20_1.k1l(tmp, destination);
3030
+ };
3031
+ protoOf(UrlDecodedParametersBuilder).z1 = function () {
3032
+ return this.u20_1.z1();
3033
+ };
3034
+ function encodeParameters(parameters) {
3035
+ // Inline function 'kotlin.apply' call
3036
+ var this_0 = ParametersBuilder();
3037
+ // Inline function 'kotlin.contracts.contract' call
3038
+ // Inline function 'io.ktor.http.encodeParameters.<anonymous>' call
3039
+ appendAllEncoded(this_0, parameters);
3040
+ return this_0;
3041
+ }
3042
+ function decodeParameters(parameters) {
3043
+ // Inline function 'kotlin.apply' call
3044
+ var this_0 = ParametersBuilder();
3045
+ // Inline function 'kotlin.contracts.contract' call
3046
+ // Inline function 'io.ktor.http.decodeParameters.<anonymous>' call
3047
+ appendAllDecoded(this_0, parameters);
3048
+ return this_0.o1r();
3049
+ }
3050
+ function appendAllEncoded(_this__u8e3s4, parameters) {
3051
+ // Inline function 'kotlin.collections.forEach' call
3052
+ var tmp0_iterator = parameters.e1l().j();
3053
+ while (tmp0_iterator.k()) {
3054
+ var element = tmp0_iterator.l();
3055
+ // Inline function 'io.ktor.http.appendAllEncoded.<anonymous>' call
3056
+ var tmp0_elvis_lhs = parameters.d1l(element);
3057
+ var values = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs;
3058
+ var tmp = encodeURLParameter(element);
3059
+ // Inline function 'kotlin.collections.map' call
3060
+ // Inline function 'kotlin.collections.mapTo' call
3061
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(values, 10));
3062
+ var tmp0_iterator_0 = values.j();
3063
+ while (tmp0_iterator_0.k()) {
3064
+ var item = tmp0_iterator_0.l();
3065
+ // Inline function 'io.ktor.http.appendAllEncoded.<anonymous>.<anonymous>' call
3066
+ var tmp$ret$0 = encodeURLParameterValue(item);
3067
+ destination.e(tmp$ret$0);
3068
+ }
3069
+ _this__u8e3s4.k1l(tmp, destination);
3070
+ }
3071
+ }
3072
+ function appendAllDecoded(_this__u8e3s4, parameters) {
3073
+ // Inline function 'kotlin.collections.forEach' call
3074
+ var tmp0_iterator = parameters.e1l().j();
3075
+ while (tmp0_iterator.k()) {
3076
+ var element = tmp0_iterator.l();
3077
+ // Inline function 'io.ktor.http.appendAllDecoded.<anonymous>' call
3078
+ var tmp0_elvis_lhs = parameters.d1l(element);
3079
+ var values = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs;
3080
+ var tmp = decodeURLQueryComponent(element);
3081
+ // Inline function 'kotlin.collections.map' call
3082
+ // Inline function 'kotlin.collections.mapTo' call
3083
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(values, 10));
3084
+ var tmp0_iterator_0 = values.j();
3085
+ while (tmp0_iterator_0.k()) {
3086
+ var item = tmp0_iterator_0.l();
3087
+ // Inline function 'io.ktor.http.appendAllDecoded.<anonymous>.<anonymous>' call
3088
+ var tmp$ret$0 = decodeURLQueryComponent(item, VOID, VOID, true);
3089
+ destination.e(tmp$ret$0);
3090
+ }
3091
+ _this__u8e3s4.k1l(tmp, destination);
3092
+ }
3093
+ }
3094
+ var HeaderValueEncoding_QUOTED_WHEN_REQUIRED_instance;
3095
+ var HeaderValueEncoding_QUOTED_ALWAYS_instance;
3096
+ var HeaderValueEncoding_URI_ENCODE_instance;
3097
+ var HeaderValueEncoding_entriesInitialized;
3098
+ function HeaderValueEncoding_initEntries() {
3099
+ if (HeaderValueEncoding_entriesInitialized)
3100
+ return Unit_instance;
3101
+ HeaderValueEncoding_entriesInitialized = true;
3102
+ HeaderValueEncoding_QUOTED_WHEN_REQUIRED_instance = new HeaderValueEncoding('QUOTED_WHEN_REQUIRED', 0);
3103
+ HeaderValueEncoding_QUOTED_ALWAYS_instance = new HeaderValueEncoding('QUOTED_ALWAYS', 1);
3104
+ HeaderValueEncoding_URI_ENCODE_instance = new HeaderValueEncoding('URI_ENCODE', 2);
3105
+ }
3106
+ function HeaderValueEncoding(name, ordinal) {
3107
+ Enum.call(this, name, ordinal);
3108
+ }
3109
+ function HeaderValueEncoding_QUOTED_WHEN_REQUIRED_getInstance() {
3110
+ HeaderValueEncoding_initEntries();
3111
+ return HeaderValueEncoding_QUOTED_WHEN_REQUIRED_instance;
3112
+ }
3113
+ function get_TOKEN_EXTRA() {
3114
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3115
+ return TOKEN_EXTRA;
3116
+ }
3117
+ var TOKEN_EXTRA;
3118
+ function get_TOKEN68_EXTRA() {
3119
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3120
+ return TOKEN68_EXTRA;
3121
+ }
3122
+ var TOKEN68_EXTRA;
3123
+ function get_token68Pattern() {
3124
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3125
+ return token68Pattern;
3126
+ }
3127
+ var token68Pattern;
3128
+ function get_escapeRegex() {
3129
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3130
+ return escapeRegex;
3131
+ }
3132
+ var escapeRegex;
3133
+ function Parameterized_init_$Init$(authScheme, parameters, encoding, $this) {
3134
+ encoding = encoding === VOID ? HeaderValueEncoding_QUOTED_WHEN_REQUIRED_getInstance() : encoding;
3135
+ // Inline function 'kotlin.collections.map' call
3136
+ var this_0 = parameters.s();
3137
+ // Inline function 'kotlin.collections.mapTo' call
3138
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
3139
+ var tmp0_iterator = this_0.j();
3140
+ while (tmp0_iterator.k()) {
3141
+ var item = tmp0_iterator.l();
3142
+ // Inline function 'io.ktor.http.auth.Parameterized.<init>.<anonymous>' call
3143
+ var tmp$ret$0 = HeaderValueParam_init_$Create$(item.t(), item.u());
3144
+ destination.e(tmp$ret$0);
3145
+ }
3146
+ Parameterized.call($this, authScheme, destination, encoding);
3147
+ return $this;
3148
+ }
3149
+ function Parameterized_init_$Create$(authScheme, parameters, encoding) {
3150
+ return Parameterized_init_$Init$(authScheme, parameters, encoding, objectCreate(protoOf(Parameterized)));
3151
+ }
3152
+ function encode_0(_this__u8e3s4, $this, encoding) {
3153
+ var tmp;
3154
+ switch (encoding.m2_1) {
3155
+ case 0:
3156
+ tmp = escapeIfNeeded(_this__u8e3s4);
3157
+ break;
3158
+ case 1:
3159
+ tmp = quote(_this__u8e3s4);
3160
+ break;
3161
+ case 2:
3162
+ tmp = encodeURLParameter(_this__u8e3s4);
3163
+ break;
3164
+ default:
3165
+ noWhenBranchMatchedException();
3166
+ break;
3167
+ }
3168
+ return tmp;
3169
+ }
3170
+ function HttpAuthHeader$Parameterized$render$lambda(this$0, $encoding) {
3171
+ return function (it) {
3172
+ return it.q1p_1 + '=' + encode_0(it.r1p_1, this$0, $encoding);
3173
+ };
3174
+ }
3175
+ function Single(authScheme, blob) {
3176
+ HttpAuthHeader.call(this, authScheme);
3177
+ this.x20_1 = blob;
3178
+ // Inline function 'kotlin.text.matches' call
3179
+ var this_0 = this.x20_1;
3180
+ if (!get_token68Pattern().vc(this_0)) {
3181
+ throw new ParseException('Invalid blob value: it should be token68');
3182
+ }
3183
+ }
3184
+ protoOf(Single).y20 = function () {
3185
+ return this.z20_1 + ' ' + this.x20_1;
3186
+ };
3187
+ protoOf(Single).equals = function (other) {
3188
+ if (!(other instanceof Single))
3189
+ return false;
3190
+ return equals(other.z20_1, this.z20_1, true) && equals(other.x20_1, this.x20_1, true);
3191
+ };
3192
+ protoOf(Single).hashCode = function () {
3193
+ var tmp = Hash_instance;
3194
+ // Inline function 'kotlin.text.lowercase' call
3195
+ // Inline function 'kotlin.js.asDynamic' call
3196
+ var tmp_0 = this.z20_1.toLowerCase();
3197
+ // Inline function 'kotlin.text.lowercase' call
3198
+ // Inline function 'kotlin.js.asDynamic' call
3199
+ var tmp$ret$3 = this.x20_1.toLowerCase();
3200
+ return tmp.v1k([tmp_0, tmp$ret$3]);
3201
+ };
3202
+ function Parameterized(authScheme, parameters, encoding) {
3203
+ encoding = encoding === VOID ? HeaderValueEncoding_QUOTED_WHEN_REQUIRED_getInstance() : encoding;
3204
+ HttpAuthHeader.call(this, authScheme);
3205
+ this.b21_1 = parameters;
3206
+ this.c21_1 = encoding;
3207
+ // Inline function 'kotlin.collections.forEach' call
3208
+ var tmp0_iterator = this.b21_1.j();
3209
+ while (tmp0_iterator.k()) {
3210
+ var element = tmp0_iterator.l();
3211
+ // Inline function 'io.ktor.http.auth.Parameterized.<anonymous>' call
3212
+ // Inline function 'kotlin.text.matches' call
3213
+ var this_0 = element.q1p_1;
3214
+ if (!get_token68Pattern().vc(this_0)) {
3215
+ throw new ParseException('Parameter name should be a token');
3216
+ }
3217
+ }
3218
+ }
3219
+ protoOf(Parameterized).d21 = function (encoding) {
3220
+ var tmp;
3221
+ if (this.b21_1.p()) {
3222
+ tmp = this.z20_1;
3223
+ } else {
3224
+ var tmp_0 = this.z20_1 + ' ';
3225
+ tmp = joinToString(this.b21_1, ', ', tmp_0, VOID, VOID, VOID, HttpAuthHeader$Parameterized$render$lambda(this, encoding));
3226
+ }
3227
+ return tmp;
3228
+ };
3229
+ protoOf(Parameterized).k1r = function (name) {
3230
+ var tmp$ret$1;
3231
+ $l$block: {
3232
+ // Inline function 'kotlin.collections.firstOrNull' call
3233
+ var tmp0_iterator = this.b21_1.j();
3234
+ while (tmp0_iterator.k()) {
3235
+ var element = tmp0_iterator.l();
3236
+ // Inline function 'io.ktor.http.auth.Parameterized.parameter.<anonymous>' call
3237
+ if (element.q1p_1 === name) {
3238
+ tmp$ret$1 = element;
3239
+ break $l$block;
3240
+ }
3241
+ }
3242
+ tmp$ret$1 = null;
3243
+ }
3244
+ var tmp55_safe_receiver = tmp$ret$1;
3245
+ return tmp55_safe_receiver == null ? null : tmp55_safe_receiver.r1p_1;
3246
+ };
3247
+ protoOf(Parameterized).y20 = function () {
3248
+ return this.d21(this.c21_1);
3249
+ };
3250
+ protoOf(Parameterized).equals = function (other) {
3251
+ if (!(other instanceof Parameterized))
3252
+ return false;
3253
+ return equals(other.z20_1, this.z20_1, true) && equals_0(other.b21_1, this.b21_1);
3254
+ };
3255
+ protoOf(Parameterized).hashCode = function () {
3256
+ var tmp = Hash_instance;
3257
+ // Inline function 'kotlin.text.lowercase' call
3258
+ // Inline function 'kotlin.js.asDynamic' call
3259
+ var tmp$ret$1 = this.z20_1.toLowerCase();
3260
+ return tmp.v1k([tmp$ret$1, this.b21_1]);
3261
+ };
3262
+ function Companion_9() {
3263
+ }
3264
+ var Companion_instance_9;
3265
+ function Companion_getInstance_9() {
3266
+ return Companion_instance_9;
3267
+ }
3268
+ function HttpAuthHeader(authScheme) {
3269
+ this.z20_1 = authScheme;
3270
+ // Inline function 'kotlin.text.matches' call
3271
+ var this_0 = this.z20_1;
3272
+ if (!get_token68Pattern().vc(this_0)) {
3273
+ throw new ParseException('Invalid authScheme value: it should be token, but instead it is ' + this.z20_1);
3274
+ }
3275
+ }
3276
+ protoOf(HttpAuthHeader).toString = function () {
3277
+ return this.y20();
3278
+ };
3279
+ function parseAuthorizationHeaders(headerValue) {
3280
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3281
+ var index = 0;
3282
+ // Inline function 'kotlin.collections.mutableListOf' call
3283
+ var headers = ArrayList_init_$Create$_0();
3284
+ while (!(index === -1)) {
3285
+ index = parseAuthorizationHeader(headerValue, index, headers);
3286
+ }
3287
+ return headers;
3288
+ }
3289
+ function parseAuthorizationHeader(headerValue, startIndex, headers) {
3290
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3291
+ var index = skipSpaces(headerValue, startIndex);
3292
+ var schemeStartIndex = index;
3293
+ while (index < headerValue.length && isToken(charSequenceGet(headerValue, index))) {
3294
+ index = index + 1 | 0;
3295
+ }
3296
+ var authScheme = substring(headerValue, until(schemeStartIndex, index));
3297
+ if (isBlank(authScheme)) {
3298
+ throw new ParseException("Invalid authScheme value: it should be token, can't be blank");
3299
+ }
3300
+ index = skipSpaces(headerValue, index);
3301
+ var tmp53_safe_receiver = nextChallengeIndex(headers, new Parameterized(authScheme, emptyList()), index, headerValue);
3302
+ if (tmp53_safe_receiver == null)
3303
+ null;
3304
+ else {
3305
+ // Inline function 'kotlin.let' call
3306
+ // Inline function 'kotlin.contracts.contract' call
3307
+ return tmp53_safe_receiver;
3308
+ }
3309
+ var token68EndIndex = matchToken68(headerValue, index);
3310
+ // Inline function 'kotlin.text.trim' call
3311
+ var this_0 = substring(headerValue, until(index, token68EndIndex));
3312
+ var token68 = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
3313
+ // Inline function 'kotlin.text.isNotEmpty' call
3314
+ if (charSequenceLength(token68) > 0) {
3315
+ var tmp54_safe_receiver = nextChallengeIndex(headers, new Single(authScheme, token68), token68EndIndex, headerValue);
3316
+ if (tmp54_safe_receiver == null)
3317
+ null;
3318
+ else {
3319
+ // Inline function 'kotlin.let' call
3320
+ // Inline function 'kotlin.contracts.contract' call
3321
+ return tmp54_safe_receiver;
3322
+ }
3323
+ }
3324
+ // Inline function 'kotlin.collections.mutableMapOf' call
3325
+ var parameters = LinkedHashMap_init_$Create$_0();
3326
+ var nextIndexChallenge = matchParameters(headerValue, index, parameters);
3327
+ headers.e(Parameterized_init_$Create$(authScheme, parameters));
3328
+ return nextIndexChallenge;
3329
+ }
3330
+ function skipSpaces(_this__u8e3s4, startIndex) {
3331
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3332
+ var index = startIndex;
3333
+ while (index < _this__u8e3s4.length && charSequenceGet(_this__u8e3s4, index) === _Char___init__impl__6a9atx(32)) {
3334
+ index = index + 1 | 0;
3335
+ }
3336
+ return index;
3337
+ }
3338
+ function isToken(_this__u8e3s4) {
3339
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3340
+ return (_Char___init__impl__6a9atx(97) <= _this__u8e3s4 ? _this__u8e3s4 <= _Char___init__impl__6a9atx(122) : false) || (_Char___init__impl__6a9atx(65) <= _this__u8e3s4 ? _this__u8e3s4 <= _Char___init__impl__6a9atx(90) : false) || isDigit(_this__u8e3s4) || get_TOKEN_EXTRA().s1(new Char(_this__u8e3s4));
3341
+ }
3342
+ function nextChallengeIndex(headers, header, index, headerValue) {
3343
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3344
+ if (index === headerValue.length || charSequenceGet(headerValue, index) === _Char___init__impl__6a9atx(44)) {
3345
+ headers.e(header);
3346
+ var tmp;
3347
+ if (index === headerValue.length) {
3348
+ tmp = -1;
3349
+ } else if (charSequenceGet(headerValue, index) === _Char___init__impl__6a9atx(44)) {
3350
+ tmp = index + 1 | 0;
3351
+ } else {
3352
+ throw IllegalStateException_init_$Create$(toString(''));
3353
+ }
3354
+ return tmp;
3355
+ }
3356
+ return null;
3357
+ }
3358
+ function matchToken68(headerValue, startIndex) {
3359
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3360
+ var index = skipSpaces(headerValue, startIndex);
3361
+ while (index < headerValue.length && isToken68(charSequenceGet(headerValue, index))) {
3362
+ index = index + 1 | 0;
3363
+ }
3364
+ while (index < headerValue.length && charSequenceGet(headerValue, index) === _Char___init__impl__6a9atx(61)) {
3365
+ index = index + 1 | 0;
3366
+ }
3367
+ return skipSpaces(headerValue, index);
3368
+ }
3369
+ function matchParameters(headerValue, startIndex, parameters) {
3370
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3371
+ var index = startIndex;
3372
+ while (index > 0 && index < headerValue.length) {
3373
+ var nextIndex = matchParameter(headerValue, index, parameters);
3374
+ if (nextIndex === index) {
3375
+ return index;
3376
+ } else {
3377
+ index = skipDelimiter(headerValue, nextIndex, _Char___init__impl__6a9atx(44));
3378
+ }
3379
+ }
3380
+ return index;
3381
+ }
3382
+ function isToken68(_this__u8e3s4) {
3383
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3384
+ return (_Char___init__impl__6a9atx(97) <= _this__u8e3s4 ? _this__u8e3s4 <= _Char___init__impl__6a9atx(122) : false) || (_Char___init__impl__6a9atx(65) <= _this__u8e3s4 ? _this__u8e3s4 <= _Char___init__impl__6a9atx(90) : false) || isDigit(_this__u8e3s4) || get_TOKEN68_EXTRA().s1(new Char(_this__u8e3s4));
3385
+ }
3386
+ function matchParameter(headerValue, startIndex, parameters) {
3387
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3388
+ var keyStart = skipSpaces(headerValue, startIndex);
3389
+ var index = keyStart;
3390
+ while (index < headerValue.length && isToken(charSequenceGet(headerValue, index))) {
3391
+ index = index + 1 | 0;
3392
+ }
3393
+ var key = substring(headerValue, until(keyStart, index));
3394
+ index = skipSpaces(headerValue, index);
3395
+ if (index === headerValue.length || !(charSequenceGet(headerValue, index) === _Char___init__impl__6a9atx(61))) {
3396
+ return startIndex;
3397
+ }
3398
+ index = index + 1 | 0;
3399
+ index = skipSpaces(headerValue, index);
3400
+ var quoted = false;
3401
+ var valueStart = index;
3402
+ if (charSequenceGet(headerValue, index) === _Char___init__impl__6a9atx(34)) {
3403
+ quoted = true;
3404
+ index = index + 1 | 0;
3405
+ valueStart = index;
3406
+ var escaped = false;
3407
+ $l$loop: while (index < headerValue.length && (charSequenceGet(headerValue, index) !== _Char___init__impl__6a9atx(34) || escaped)) {
3408
+ escaped = (!escaped && charSequenceGet(headerValue, index) === _Char___init__impl__6a9atx(92));
3409
+ index = index + 1 | 0;
3410
+ }
3411
+ if (index === headerValue.length) {
3412
+ throw new ParseException("Expected closing quote'\"' in parameter");
3413
+ }
3414
+ } else {
3415
+ while (index < headerValue.length && !(charSequenceGet(headerValue, index) === _Char___init__impl__6a9atx(32)) && !(charSequenceGet(headerValue, index) === _Char___init__impl__6a9atx(44))) {
3416
+ index = index + 1 | 0;
3417
+ }
3418
+ }
3419
+ var value = substring(headerValue, until(valueStart, index));
3420
+ // Inline function 'kotlin.collections.set' call
3421
+ var value_0 = quoted ? unescaped(value) : value;
3422
+ parameters.i2(key, value_0);
3423
+ if (quoted) {
3424
+ index = index + 1 | 0;
3425
+ }
3426
+ return index;
3427
+ }
3428
+ function skipDelimiter(_this__u8e3s4, startIndex, delimiter) {
3429
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3430
+ var index = skipSpaces(_this__u8e3s4, startIndex);
3431
+ if (index === _this__u8e3s4.length)
3432
+ return -1;
3433
+ if (!(charSequenceGet(_this__u8e3s4, index) === delimiter)) {
3434
+ throw new ParseException('Expected delimiter ' + toString_0(delimiter) + ' at position ' + index);
3435
+ }
3436
+ index = index + 1 | 0;
3437
+ return skipSpaces(_this__u8e3s4, index);
3438
+ }
3439
+ function unescaped(_this__u8e3s4) {
3440
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3441
+ // Inline function 'kotlin.text.replace' call
3442
+ var regex = get_escapeRegex();
3443
+ var transform = unescaped$lambda;
3444
+ return regex.yc(_this__u8e3s4, transform);
3445
+ }
3446
+ function unescaped$lambda(it) {
3447
+ _init_properties_HttpAuthHeader_kt__axcd0d();
3448
+ return takeLast(it.u(), 1);
3449
+ }
3450
+ var properties_initialized_HttpAuthHeader_kt_y7nech;
3451
+ function _init_properties_HttpAuthHeader_kt__axcd0d() {
3452
+ if (!properties_initialized_HttpAuthHeader_kt_y7nech) {
3453
+ properties_initialized_HttpAuthHeader_kt_y7nech = true;
3454
+ TOKEN_EXTRA = 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(37)), new Char(_Char___init__impl__6a9atx(38)), new Char(_Char___init__impl__6a9atx(39)), new Char(_Char___init__impl__6a9atx(42)), 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))]);
3455
+ TOKEN68_EXTRA = setOf([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)), new Char(_Char___init__impl__6a9atx(47))]);
3456
+ // Inline function 'kotlin.text.toRegex' call
3457
+ var this_0 = '[a-zA-Z0-9\\-._~+/]+=*';
3458
+ token68Pattern = Regex_init_$Create$(this_0);
3459
+ // Inline function 'kotlin.text.toRegex' call
3460
+ escapeRegex = Regex_init_$Create$('\\\\.');
3461
+ }
3462
+ }
3463
+ function ByteArrayContent(bytes, contentType, status) {
3464
+ contentType = contentType === VOID ? null : contentType;
3465
+ status = status === VOID ? null : status;
3466
+ ByteArrayContent_0.call(this);
3467
+ this.f21_1 = bytes;
3468
+ this.g21_1 = contentType;
3469
+ this.h21_1 = status;
3470
+ }
3471
+ protoOf(ByteArrayContent).i21 = function () {
3472
+ return this.g21_1;
3473
+ };
3474
+ protoOf(ByteArrayContent).j21 = function () {
3475
+ return toLong_0(this.f21_1.length);
3476
+ };
3477
+ protoOf(ByteArrayContent).k21 = function () {
3478
+ return this.f21_1;
3479
+ };
3480
+ function NoContent() {
3481
+ OutgoingContent.call(this);
3482
+ }
3483
+ function ReadChannelContent() {
3484
+ OutgoingContent.call(this);
3485
+ }
3486
+ function WriteChannelContent() {
3487
+ }
3488
+ function ByteArrayContent_0() {
3489
+ OutgoingContent.call(this);
3490
+ }
3491
+ function ProtocolUpgrade() {
3492
+ }
3493
+ function ContentWrapper() {
3494
+ }
3495
+ protoOf(ContentWrapper).t21 = function () {
3496
+ return this.s21_1;
3497
+ };
3498
+ function OutgoingContent() {
3499
+ this.l21_1 = null;
3500
+ }
3501
+ protoOf(OutgoingContent).i21 = function () {
3502
+ return null;
3503
+ };
3504
+ protoOf(OutgoingContent).j21 = function () {
3505
+ return null;
3506
+ };
3507
+ protoOf(OutgoingContent).s1v = function () {
3508
+ return Companion_getInstance_1().l1r_1;
3509
+ };
3510
+ function NullBody() {
3511
+ }
3512
+ var NullBody_instance;
3513
+ function NullBody_getInstance() {
3514
+ return NullBody_instance;
3515
+ }
3516
+ function TextContent(text, contentType, status) {
3517
+ status = status === VOID ? null : status;
3518
+ ByteArrayContent_0.call(this);
3519
+ this.v21_1 = text;
3520
+ this.w21_1 = contentType;
3521
+ this.x21_1 = status;
3522
+ var tmp = this;
3523
+ var tmp0_elvis_lhs = charset(this.w21_1);
3524
+ tmp.y21_1 = toByteArray(this.v21_1, tmp0_elvis_lhs == null ? Charsets_getInstance().a1i_1 : tmp0_elvis_lhs);
3525
+ }
3526
+ protoOf(TextContent).i21 = function () {
3527
+ return this.w21_1;
3528
+ };
3529
+ protoOf(TextContent).j21 = function () {
3530
+ return toLong_0(this.y21_1.length);
3531
+ };
3532
+ protoOf(TextContent).k21 = function () {
3533
+ return this.y21_1;
3534
+ };
3535
+ protoOf(TextContent).toString = function () {
3536
+ return 'TextContent[' + this.w21_1.toString() + '] "' + take(this.v21_1, 30) + '"';
3537
+ };
3538
+ function ParseException(message, cause) {
3539
+ cause = cause === VOID ? null : cause;
3540
+ IllegalArgumentException_init_$Init$_0(message, cause, this);
3541
+ captureStack(this, ParseException);
3542
+ this.z21_1 = message;
3543
+ this.a22_1 = cause;
3544
+ }
3545
+ protoOf(ParseException).q9 = function () {
3546
+ return this.z21_1;
3547
+ };
3548
+ protoOf(ParseException).r9 = function () {
3549
+ return this.a22_1;
3550
+ };
3551
+ function get_origin(_this__u8e3s4) {
3552
+ return get_platform(PlatformUtils_getInstance()).m2_1 === 2 ? locationOrigin() : 'http://localhost';
3553
+ }
3554
+ function locationOrigin() {
3555
+ return function () {
3556
+ var tmpLocation = null;
3557
+ if (typeof window !== 'undefined') {
3558
+ tmpLocation = window.location;
3559
+ } else if (typeof self !== 'undefined') {
3560
+ tmpLocation = self.location;
3561
+ }
3562
+ var origin = '';
3563
+ if (tmpLocation) {
3564
+ origin = tmpLocation.origin;
3565
+ }
3566
+ return origin && origin != 'null' ? origin : 'http://localhost';
3567
+ }();
3568
+ }
3569
+ //region block: post-declaration
3570
+ protoOf(EmptyHeaders).c1k = get;
3571
+ protoOf(EmptyHeaders).g1l = forEach;
3572
+ protoOf(EmptyParameters).g1l = forEach;
3573
+ defineProp(protoOf(ParseException), 'message', function () {
3574
+ return this.q9();
3575
+ });
3576
+ defineProp(protoOf(ParseException), 'cause', function () {
3577
+ return this.r9();
3578
+ });
3579
+ //endregion
3580
+ //region block: init
3581
+ Companion_instance_0 = new Companion_0();
3582
+ EmptyHeaders_instance = new EmptyHeaders();
3583
+ EmptyParameters_instance = new EmptyParameters();
3584
+ Companion_instance_8 = new Companion_8();
3585
+ Companion_instance_9 = new Companion_9();
3586
+ NullBody_instance = new NullBody();
3587
+ //endregion
3588
+ //region block: exports
3589
+ _.$_$ = _.$_$ || {};
3590
+ _.$_$.a = NullBody_instance;
3591
+ _.$_$.b = Application_getInstance;
3592
+ _.$_$.c = Text_getInstance;
3593
+ _.$_$.d = Companion_getInstance_1;
3594
+ _.$_$.e = HttpHeaders_getInstance;
3595
+ _.$_$.f = Companion_getInstance_2;
3596
+ _.$_$.g = Companion_getInstance_3;
3597
+ _.$_$.h = Companion_getInstance_4;
3598
+ _.$_$.i = Companion_getInstance_7;
3599
+ _.$_$.j = Parameterized;
3600
+ _.$_$.k = parseAuthorizationHeaders;
3601
+ _.$_$.l = ByteArrayContent;
3602
+ _.$_$.m = NullBody;
3603
+ _.$_$.n = ByteArrayContent_0;
3604
+ _.$_$.o = ContentWrapper;
3605
+ _.$_$.p = NoContent;
3606
+ _.$_$.q = ProtocolUpgrade;
3607
+ _.$_$.r = ReadChannelContent;
3608
+ _.$_$.s = WriteChannelContent;
3609
+ _.$_$.t = OutgoingContent;
3610
+ _.$_$.u = TextContent;
3611
+ _.$_$.v = HeadersBuilder;
3612
+ _.$_$.w = HttpStatusCode;
3613
+ _.$_$.x = ParametersBuilder;
3614
+ _.$_$.y = URLBuilder_1;
3615
+ _.$_$.z = URLBuilder;
3616
+ _.$_$.a1 = UnsafeHeaderException;
3617
+ _.$_$.b1 = append;
3618
+ _.$_$.c1 = get_authority;
3619
+ _.$_$.d1 = get_authority_0;
3620
+ _.$_$.e1 = charset_0;
3621
+ _.$_$.f1 = charset;
3622
+ _.$_$.g1 = contentLength;
3623
+ _.$_$.h1 = contentType;
3624
+ _.$_$.i1 = contentType_0;
3625
+ _.$_$.j1 = get_encodedPath;
3626
+ _.$_$.k1 = isSecure;
3627
+ _.$_$.l1 = isSuccess;
3628
+ _.$_$.m1 = isWebsocket;
3629
+ _.$_$.n1 = parseAndSortHeader;
3630
+ _.$_$.o1 = takeFrom_0;
3631
+ _.$_$.p1 = takeFrom;
3632
+ _.$_$.q1 = withCharsetIfNeeded;
3633
+ _.$_$.r1 = withCharset;
3634
+ //endregion
3635
+ return _;
3636
+ }(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./ktor-ktor-io.js'), require('./ktor-ktor-utils.js')));
3637
+
3638
+ //# sourceMappingURL=ktor-ktor-http.js.map