raspberry_games_server_game_logic 1.8.248

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 (68) hide show
  1. package/Kosi-Kaverit-kaverit.js +339 -0
  2. package/Kosi-Kaverit-kaverit.js.map +1 -0
  3. package/Kosi-Kodein-kodein-di.js +2389 -0
  4. package/Kosi-Kodein-kodein-di.js.map +1 -0
  5. package/Kotlin-DateTime-library-kotlinx-datetime.js +6215 -0
  6. package/Kotlin-DateTime-library-kotlinx-datetime.js.map +1 -0
  7. package/Logic_Debertz-core.js +6885 -0
  8. package/Logic_Debertz-core.js.map +1 -0
  9. package/Logic_Debertz-engine.js +52055 -0
  10. package/Logic_Debertz-engine.js.map +1 -0
  11. package/Logic_Debertz-game_server.d.ts +1918 -0
  12. package/Logic_Debertz-game_server.js +5140 -0
  13. package/Logic_Debertz-game_server.js.map +1 -0
  14. package/kotlin-kotlin-stdlib.js +15597 -0
  15. package/kotlin-kotlin-stdlib.js.map +1 -0
  16. package/kotlin-kotlinx-atomicfu-runtime.js +15 -0
  17. package/kotlin-kotlinx-atomicfu-runtime.js.map +1 -0
  18. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +15 -0
  19. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -0
  20. package/kotlinx-atomicfu.js +276 -0
  21. package/kotlinx-atomicfu.js.map +1 -0
  22. package/kotlinx-coroutines-core.js +11628 -0
  23. package/kotlinx-coroutines-core.js.map +1 -0
  24. package/kotlinx-io-kotlinx-io-bytestring.js +15 -0
  25. package/kotlinx-io-kotlinx-io-bytestring.js.map +1 -0
  26. package/kotlinx-io-kotlinx-io-core.js +1557 -0
  27. package/kotlinx-io-kotlinx-io-core.js.map +1 -0
  28. package/kotlinx-serialization-kotlinx-serialization-core.js +6315 -0
  29. package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -0
  30. package/kotlinx-serialization-kotlinx-serialization-json.js +5092 -0
  31. package/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -0
  32. package/ktor-ktor-client-content-negotiation.js +713 -0
  33. package/ktor-ktor-client-content-negotiation.js.map +1 -0
  34. package/ktor-ktor-client-core.js +7235 -0
  35. package/ktor-ktor-client-core.js.map +1 -0
  36. package/ktor-ktor-client-js.js +15 -0
  37. package/ktor-ktor-client-js.js.map +1 -0
  38. package/ktor-ktor-client-logging.js +1530 -0
  39. package/ktor-ktor-client-logging.js.map +1 -0
  40. package/ktor-ktor-events.js +97 -0
  41. package/ktor-ktor-events.js.map +1 -0
  42. package/ktor-ktor-http.js +3285 -0
  43. package/ktor-ktor-http.js.map +1 -0
  44. package/ktor-ktor-io.js +6463 -0
  45. package/ktor-ktor-io.js.map +1 -0
  46. package/ktor-ktor-serialization-kotlinx-json.js +67 -0
  47. package/ktor-ktor-serialization-kotlinx-json.js.map +1 -0
  48. package/ktor-ktor-serialization-kotlinx.js +893 -0
  49. package/ktor-ktor-serialization-kotlinx.js.map +1 -0
  50. package/ktor-ktor-serialization.js +395 -0
  51. package/ktor-ktor-serialization.js.map +1 -0
  52. package/ktor-ktor-utils.js +2659 -0
  53. package/ktor-ktor-utils.js.map +1 -0
  54. package/ktor-ktor-websocket-serialization.js +15 -0
  55. package/ktor-ktor-websocket-serialization.js.map +1 -0
  56. package/ktor-ktor-websockets.js +466 -0
  57. package/ktor-ktor-websockets.js.map +1 -0
  58. package/package.json +13 -0
  59. package/raspberry-cardgame-lib-core.js +1429 -0
  60. package/raspberry-cardgame-lib-core.js.map +1 -0
  61. package/raspberry-cardgame-lib-logger.js +423 -0
  62. package/raspberry-cardgame-lib-logger.js.map +1 -0
  63. package/raspberry-cardgame-lib-random.js +3060 -0
  64. package/raspberry-cardgame-lib-random.js.map +1 -0
  65. package/secure-random-secure-random.js +173 -0
  66. package/secure-random-secure-random.js.map +1 -0
  67. package/uuid.js +163 -0
  68. package/uuid.js.map +1 -0
@@ -0,0 +1,3285 @@
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd)
3
+ define(['exports', './kotlin-kotlin-stdlib.js', './ktor-ktor-io.js', './ktor-ktor-utils.js'], factory);
4
+ else if (typeof exports === 'object')
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./ktor-ktor-io.js'), require('./ktor-ktor-utils.js'));
6
+ else {
7
+ if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
8
+ throw new Error("Error loading module 'ktor-ktor-http'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'ktor-ktor-http'.");
9
+ }
10
+ if (typeof globalThis['ktor-ktor-io'] === 'undefined') {
11
+ throw new Error("Error loading module 'ktor-ktor-http'. Its dependency 'ktor-ktor-io' was not found. Please, check whether 'ktor-ktor-io' is loaded prior to 'ktor-ktor-http'.");
12
+ }
13
+ if (typeof globalThis['ktor-ktor-utils'] === 'undefined') {
14
+ throw new Error("Error loading module 'ktor-ktor-http'. Its dependency 'ktor-ktor-utils' was not found. Please, check whether 'ktor-ktor-utils' is loaded prior to 'ktor-ktor-http'.");
15
+ }
16
+ globalThis['ktor-ktor-http'] = factory(typeof globalThis['ktor-ktor-http'] === 'undefined' ? {} : globalThis['ktor-ktor-http'], globalThis['kotlin-kotlin-stdlib'], globalThis['ktor-ktor-io'], globalThis['ktor-ktor-utils']);
17
+ }
18
+ }(function (_, kotlin_kotlin, kotlin_io_ktor_ktor_io, kotlin_io_ktor_ktor_utils) {
19
+ 'use strict';
20
+ //region block: imports
21
+ var imul = Math.imul;
22
+ var VOID = kotlin_kotlin.$_$.f;
23
+ var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.f1;
24
+ var Charsets_getInstance = kotlin_io_ktor_ktor_io.$_$.g;
25
+ var encode = kotlin_io_ktor_ktor_io.$_$.l;
26
+ var Unit_instance = kotlin_kotlin.$_$.p5;
27
+ var prepareReadFirstHead = kotlin_io_ktor_ktor_io.$_$.o;
28
+ var prepareReadNextHead = kotlin_io_ktor_ktor_io.$_$.p;
29
+ var completeReadHead = kotlin_io_ktor_ktor_io.$_$.n;
30
+ var charArray = kotlin_kotlin.$_$.fb;
31
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.x2;
32
+ var concatToString = kotlin_kotlin.$_$.xd;
33
+ var charSequenceGet = kotlin_kotlin.$_$.gb;
34
+ var toString = kotlin_kotlin.$_$.yc;
35
+ var Char = kotlin_kotlin.$_$.cg;
36
+ var isSurrogate = kotlin_kotlin.$_$.me;
37
+ var Char__plus_impl_qi7pgj = kotlin_kotlin.$_$.b3;
38
+ var Char__minus_impl_a2frrh = kotlin_kotlin.$_$.a3;
39
+ var StringBuilder_init_$Create$_0 = kotlin_kotlin.$_$.e1;
40
+ var charSequenceLength = kotlin_kotlin.$_$.hb;
41
+ var charSequenceSubSequence = kotlin_kotlin.$_$.ib;
42
+ var toString_0 = kotlin_kotlin.$_$.e3;
43
+ var toByte = kotlin_kotlin.$_$.vc;
44
+ var String_0 = kotlin_io_ktor_ktor_io.$_$.u;
45
+ var Exception = kotlin_kotlin.$_$.jg;
46
+ var Exception_init_$Init$ = kotlin_kotlin.$_$.l1;
47
+ var captureStack = kotlin_kotlin.$_$.db;
48
+ var protoOf = kotlin_kotlin.$_$.uc;
49
+ var initMetadataForClass = kotlin_kotlin.$_$.tb;
50
+ var Char__minus_impl_a2frrh_0 = kotlin_kotlin.$_$.z2;
51
+ var numberToChar = kotlin_kotlin.$_$.qc;
52
+ var Char__rangeTo_impl_tkncvp = kotlin_kotlin.$_$.c3;
53
+ var plus = kotlin_kotlin.$_$.y8;
54
+ var plus_0 = kotlin_kotlin.$_$.z8;
55
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.s6;
56
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.m;
57
+ var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.d3;
58
+ var toSet = kotlin_kotlin.$_$.z9;
59
+ var setOf = kotlin_kotlin.$_$.g9;
60
+ var plus_1 = kotlin_kotlin.$_$.x8;
61
+ var listOf = kotlin_kotlin.$_$.q8;
62
+ var emptyList = kotlin_kotlin.$_$.n7;
63
+ var objectCreate = kotlin_kotlin.$_$.tc;
64
+ var equals = kotlin_kotlin.$_$.ee;
65
+ var Collection = kotlin_kotlin.$_$.r5;
66
+ var isInterface = kotlin_kotlin.$_$.hc;
67
+ var isBlank = kotlin_kotlin.$_$.je;
68
+ var last = kotlin_kotlin.$_$.l8;
69
+ var indexOf = kotlin_kotlin.$_$.ie;
70
+ var THROW_CCE = kotlin_kotlin.$_$.rg;
71
+ var isCharSequence = kotlin_kotlin.$_$.dc;
72
+ var trim = kotlin_kotlin.$_$.vf;
73
+ var contains = kotlin_kotlin.$_$.zd;
74
+ var initMetadataForCompanion = kotlin_kotlin.$_$.ub;
75
+ var initMetadataForObject = kotlin_kotlin.$_$.yb;
76
+ var plus_2 = kotlin_kotlin.$_$.a9;
77
+ var equals_0 = kotlin_kotlin.$_$.lb;
78
+ var getStringHashCode = kotlin_kotlin.$_$.rb;
79
+ var hashCode = kotlin_kotlin.$_$.sb;
80
+ var Companion_instance = kotlin_io_ktor_ktor_io.$_$.f;
81
+ var IllegalArgumentException = kotlin_kotlin.$_$.kg;
82
+ var get_name = kotlin_io_ktor_ktor_io.$_$.m;
83
+ var get_lastIndex = kotlin_kotlin.$_$.i8;
84
+ var first = kotlin_kotlin.$_$.fe;
85
+ var last_0 = kotlin_kotlin.$_$.qe;
86
+ var get_lastIndex_0 = kotlin_kotlin.$_$.oe;
87
+ var StringValuesBuilderImpl = kotlin_io_ktor_ktor_utils.$_$.r;
88
+ var emptySet = kotlin_kotlin.$_$.p7;
89
+ var get = kotlin_io_ktor_ktor_utils.$_$.q;
90
+ var forEach = kotlin_io_ktor_ktor_utils.$_$.p;
91
+ var StringValues = kotlin_io_ktor_ktor_utils.$_$.t;
92
+ var StringValuesImpl = kotlin_io_ktor_ktor_utils.$_$.s;
93
+ var emptyMap = kotlin_kotlin.$_$.o7;
94
+ var toDoubleOrNull = kotlin_kotlin.$_$.hf;
95
+ var LazyThreadSafetyMode_NONE_getInstance = kotlin_kotlin.$_$.j;
96
+ var lazy = kotlin_kotlin.$_$.nh;
97
+ var to = kotlin_kotlin.$_$.wh;
98
+ var sortedWith = kotlin_kotlin.$_$.k9;
99
+ var FunctionAdapter = kotlin_kotlin.$_$.za;
100
+ var Comparator = kotlin_kotlin.$_$.eg;
101
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.n;
102
+ var compareValues = kotlin_kotlin.$_$.ea;
103
+ var asList = kotlin_kotlin.$_$.i6;
104
+ var Char__compareTo_impl_ypi4mb = kotlin_kotlin.$_$.y2;
105
+ var IllegalArgumentException_init_$Init$ = kotlin_kotlin.$_$.r1;
106
+ var toLong = kotlin_kotlin.$_$.mf;
107
+ var mapCapacity = kotlin_kotlin.$_$.r8;
108
+ var coerceAtLeast = kotlin_kotlin.$_$.dd;
109
+ var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.v;
110
+ var Comparable = kotlin_kotlin.$_$.dg;
111
+ var initMetadataForInterface = kotlin_kotlin.$_$.wb;
112
+ var isWhitespace = kotlin_kotlin.$_$.ne;
113
+ var startsWith = kotlin_kotlin.$_$.bf;
114
+ var charArrayOf = kotlin_kotlin.$_$.eb;
115
+ var split = kotlin_kotlin.$_$.ye;
116
+ var toMutableList = kotlin_kotlin.$_$.w9;
117
+ var first_0 = kotlin_kotlin.$_$.u7;
118
+ var joinToString = kotlin_kotlin.$_$.f8;
119
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.s1;
120
+ var toCharArray = kotlin_io_ktor_ktor_utils.$_$.a1;
121
+ var indexOfAny = kotlin_kotlin.$_$.ge;
122
+ var dropLast = kotlin_kotlin.$_$.l7;
123
+ var IllegalStateException = kotlin_kotlin.$_$.lg;
124
+ var IllegalStateException_init_$Init$ = kotlin_kotlin.$_$.x1;
125
+ var indexOf_0 = kotlin_kotlin.$_$.he;
126
+ var toInt = kotlin_kotlin.$_$.kf;
127
+ var listOf_0 = kotlin_kotlin.$_$.p8;
128
+ var toLowerCasePreservingASCIIRules = kotlin_io_ktor_ktor_utils.$_$.b1;
129
+ var isLowerCase = kotlin_io_ktor_ktor_utils.$_$.w;
130
+ var appendAll = kotlin_io_ktor_ktor_utils.$_$.u;
131
+ var startsWith_0 = kotlin_kotlin.$_$.af;
132
+ var addAll = kotlin_kotlin.$_$.g6;
133
+ var joinTo = kotlin_kotlin.$_$.g8;
134
+ var toString_1 = kotlin_kotlin.$_$.vh;
135
+ var lazy_0 = kotlin_kotlin.$_$.oh;
136
+ var getKClassFromExpression = kotlin_kotlin.$_$.d;
137
+ var KProperty1 = kotlin_kotlin.$_$.pd;
138
+ var getPropertyCallableRef = kotlin_kotlin.$_$.qb;
139
+ var toLong_0 = kotlin_kotlin.$_$.wc;
140
+ var encodeToByteArray = kotlin_kotlin.$_$.be;
141
+ var encodeToByteArray_0 = kotlin_io_ktor_ktor_io.$_$.k;
142
+ var take = kotlin_kotlin.$_$.ff;
143
+ var PlatformUtils_getInstance = kotlin_io_ktor_ktor_utils.$_$.c;
144
+ var get_platform = kotlin_io_ktor_ktor_utils.$_$.x;
145
+ //endregion
146
+ //region block: pre-declaration
147
+ initMetadataForClass(URLDecodeException, 'URLDecodeException', VOID, Exception);
148
+ initMetadataForCompanion(Companion);
149
+ initMetadataForObject(Application, 'Application');
150
+ initMetadataForObject(Text, 'Text');
151
+ initMetadataForClass(HeaderValueWithParameters, 'HeaderValueWithParameters');
152
+ initMetadataForClass(ContentType, 'ContentType', VOID, HeaderValueWithParameters);
153
+ initMetadataForClass(BadContentTypeFormatException, 'BadContentTypeFormatException', VOID, Exception);
154
+ initMetadataForCompanion(Companion_0);
155
+ initMetadataForCompanion(Companion_1);
156
+ initMetadataForClass(HeadersBuilder, 'HeadersBuilder', HeadersBuilder, StringValuesBuilderImpl);
157
+ initMetadataForObject(EmptyHeaders, 'EmptyHeaders', VOID, VOID, [StringValues]);
158
+ initMetadataForClass(HeadersImpl, 'HeadersImpl', HeadersImpl, StringValuesImpl, [StringValues, StringValuesImpl]);
159
+ initMetadataForClass(HeaderValueParam, 'HeaderValueParam');
160
+ initMetadataForClass(HeaderValue, 'HeaderValue');
161
+ initMetadataForClass(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', VOID, VOID, [Comparator, FunctionAdapter]);
162
+ initMetadataForObject(HttpHeaders, 'HttpHeaders');
163
+ initMetadataForClass(IllegalHeaderNameException, 'IllegalHeaderNameException', VOID, IllegalArgumentException);
164
+ initMetadataForClass(IllegalHeaderValueException, 'IllegalHeaderValueException', VOID, IllegalArgumentException);
165
+ initMetadataForClass(UnsafeHeaderException, 'UnsafeHeaderException', VOID, IllegalArgumentException);
166
+ initMetadataForCompanion(Companion_2);
167
+ initMetadataForClass(HttpMethod, 'HttpMethod');
168
+ initMetadataForCompanion(Companion_3);
169
+ initMetadataForClass(HttpProtocolVersion, 'HttpProtocolVersion');
170
+ initMetadataForCompanion(Companion_4);
171
+ initMetadataForClass(HttpStatusCode, 'HttpStatusCode', VOID, VOID, [Comparable]);
172
+ initMetadataForCompanion(Companion_5);
173
+ initMetadataForInterface(Parameters, 'Parameters', VOID, VOID, [StringValues]);
174
+ initMetadataForObject(EmptyParameters, 'EmptyParameters', VOID, VOID, [Parameters]);
175
+ initMetadataForClass(ParametersBuilderImpl, 'ParametersBuilderImpl', ParametersBuilderImpl, StringValuesBuilderImpl);
176
+ initMetadataForClass(ParametersImpl, 'ParametersImpl', ParametersImpl, StringValuesImpl, [Parameters, StringValuesImpl]);
177
+ initMetadataForCompanion(Companion_6);
178
+ initMetadataForClass(URLBuilder, 'URLBuilder', URLBuilder);
179
+ initMetadataForClass(URLParserException, 'URLParserException', VOID, IllegalStateException);
180
+ initMetadataForCompanion(Companion_7);
181
+ initMetadataForClass(URLProtocol, 'URLProtocol');
182
+ initMetadataForCompanion(Companion_8);
183
+ initMetadataForClass(Url_1, 'Url');
184
+ initMetadataForClass(UrlDecodedParametersBuilder, 'UrlDecodedParametersBuilder');
185
+ initMetadataForClass(OutgoingContent, 'OutgoingContent');
186
+ initMetadataForClass(ByteArrayContent_0, 'ByteArrayContent', VOID, OutgoingContent);
187
+ initMetadataForClass(ByteArrayContent, 'ByteArrayContent', VOID, ByteArrayContent_0);
188
+ initMetadataForClass(NoContent, 'NoContent', VOID, OutgoingContent);
189
+ initMetadataForClass(ReadChannelContent, 'ReadChannelContent', VOID, OutgoingContent);
190
+ initMetadataForClass(WriteChannelContent, 'WriteChannelContent', VOID, OutgoingContent, VOID, [1]);
191
+ initMetadataForClass(ProtocolUpgrade, 'ProtocolUpgrade', VOID, OutgoingContent, VOID, [4]);
192
+ initMetadataForObject(NullBody, 'NullBody');
193
+ initMetadataForClass(TextContent, 'TextContent', VOID, ByteArrayContent_0);
194
+ //endregion
195
+ function get_URL_ALPHABET() {
196
+ _init_properties_Codecs_kt__fudxxf();
197
+ return URL_ALPHABET;
198
+ }
199
+ var URL_ALPHABET;
200
+ function get_URL_ALPHABET_CHARS() {
201
+ _init_properties_Codecs_kt__fudxxf();
202
+ return URL_ALPHABET_CHARS;
203
+ }
204
+ var URL_ALPHABET_CHARS;
205
+ function get_HEX_ALPHABET() {
206
+ _init_properties_Codecs_kt__fudxxf();
207
+ return HEX_ALPHABET;
208
+ }
209
+ var HEX_ALPHABET;
210
+ function get_URL_PROTOCOL_PART() {
211
+ _init_properties_Codecs_kt__fudxxf();
212
+ return URL_PROTOCOL_PART;
213
+ }
214
+ var URL_PROTOCOL_PART;
215
+ function get_VALID_PATH_PART() {
216
+ _init_properties_Codecs_kt__fudxxf();
217
+ return VALID_PATH_PART;
218
+ }
219
+ var VALID_PATH_PART;
220
+ var ATTRIBUTE_CHARACTERS;
221
+ function get_SPECIAL_SYMBOLS() {
222
+ _init_properties_Codecs_kt__fudxxf();
223
+ return SPECIAL_SYMBOLS;
224
+ }
225
+ var SPECIAL_SYMBOLS;
226
+ function encodeURLParameter(_this__u8e3s4, spaceToPlus) {
227
+ spaceToPlus = spaceToPlus === VOID ? false : spaceToPlus;
228
+ _init_properties_Codecs_kt__fudxxf();
229
+ // Inline function 'kotlin.text.buildString' call
230
+ // Inline function 'kotlin.contracts.contract' call
231
+ // Inline function 'kotlin.apply' call
232
+ var this_0 = StringBuilder_init_$Create$();
233
+ // Inline function 'kotlin.contracts.contract' call
234
+ // Inline function 'io.ktor.http.encodeURLParameter.<anonymous>' call
235
+ var content = encode(Charsets_getInstance().a1z_1.e1z(), _this__u8e3s4);
236
+ forEach_0(content, encodeURLParameter$lambda(this_0, spaceToPlus));
237
+ return this_0.toString();
238
+ }
239
+ function decodeURLPart(_this__u8e3s4, start, end, charset) {
240
+ start = start === VOID ? 0 : start;
241
+ end = end === VOID ? _this__u8e3s4.length : end;
242
+ charset = charset === VOID ? Charsets_getInstance().a1z_1 : charset;
243
+ _init_properties_Codecs_kt__fudxxf();
244
+ return decodeScan(_this__u8e3s4, start, end, false, charset);
245
+ }
246
+ function encodeURLQueryComponent(_this__u8e3s4, encodeFull, spaceToPlus, charset) {
247
+ encodeFull = encodeFull === VOID ? false : encodeFull;
248
+ spaceToPlus = spaceToPlus === VOID ? false : spaceToPlus;
249
+ charset = charset === VOID ? Charsets_getInstance().a1z_1 : charset;
250
+ _init_properties_Codecs_kt__fudxxf();
251
+ // Inline function 'kotlin.text.buildString' call
252
+ // Inline function 'kotlin.contracts.contract' call
253
+ // Inline function 'kotlin.apply' call
254
+ var this_0 = StringBuilder_init_$Create$();
255
+ // Inline function 'kotlin.contracts.contract' call
256
+ // Inline function 'io.ktor.http.encodeURLQueryComponent.<anonymous>' call
257
+ var content = encode(charset.e1z(), _this__u8e3s4);
258
+ forEach_0(content, encodeURLQueryComponent$lambda(spaceToPlus, this_0, encodeFull));
259
+ return this_0.toString();
260
+ }
261
+ function decodeURLQueryComponent(_this__u8e3s4, start, end, plusIsSpace, charset) {
262
+ start = start === VOID ? 0 : start;
263
+ end = end === VOID ? _this__u8e3s4.length : end;
264
+ plusIsSpace = plusIsSpace === VOID ? false : plusIsSpace;
265
+ charset = charset === VOID ? Charsets_getInstance().a1z_1 : charset;
266
+ _init_properties_Codecs_kt__fudxxf();
267
+ return decodeScan(_this__u8e3s4, start, end, plusIsSpace, charset);
268
+ }
269
+ function encodeURLPathPart(_this__u8e3s4) {
270
+ _init_properties_Codecs_kt__fudxxf();
271
+ return encodeURLPath(_this__u8e3s4, true);
272
+ }
273
+ function forEach_0(_this__u8e3s4, block) {
274
+ _init_properties_Codecs_kt__fudxxf();
275
+ $l$block: {
276
+ // Inline function 'io.ktor.utils.io.core.takeWhile' call
277
+ var release = true;
278
+ var tmp0_elvis_lhs = prepareReadFirstHead(_this__u8e3s4, 1);
279
+ var tmp;
280
+ if (tmp0_elvis_lhs == null) {
281
+ break $l$block;
282
+ } else {
283
+ tmp = tmp0_elvis_lhs;
284
+ }
285
+ var current = tmp;
286
+ try {
287
+ $l$loop_1: do {
288
+ // Inline function 'io.ktor.http.forEach.<anonymous>' call
289
+ var buffer = current;
290
+ $l$loop: while (true) {
291
+ // Inline function 'io.ktor.utils.io.core.canRead' call
292
+ if (!(buffer.r1n_1 > buffer.q1n_1)) {
293
+ break $l$loop;
294
+ }
295
+ block(buffer.c1w());
296
+ }
297
+ if (!true) {
298
+ break $l$loop_1;
299
+ }
300
+ release = false;
301
+ var tmp1_elvis_lhs = prepareReadNextHead(_this__u8e3s4, current);
302
+ var tmp_0;
303
+ if (tmp1_elvis_lhs == null) {
304
+ break $l$loop_1;
305
+ } else {
306
+ tmp_0 = tmp1_elvis_lhs;
307
+ }
308
+ var next = tmp_0;
309
+ current = next;
310
+ release = true;
311
+ }
312
+ while (true);
313
+ }finally {
314
+ if (release) {
315
+ completeReadHead(_this__u8e3s4, current);
316
+ }
317
+ }
318
+ }
319
+ }
320
+ function percentEncode(_this__u8e3s4) {
321
+ _init_properties_Codecs_kt__fudxxf();
322
+ var code = _this__u8e3s4 & 255;
323
+ var array = charArray(3);
324
+ array[0] = _Char___init__impl__6a9atx(37);
325
+ array[1] = hexDigitToChar(code >> 4);
326
+ array[2] = hexDigitToChar(code & 15);
327
+ return concatToString(array);
328
+ }
329
+ function decodeScan(_this__u8e3s4, start, end, plusIsSpace, charset) {
330
+ _init_properties_Codecs_kt__fudxxf();
331
+ var inductionVariable = start;
332
+ if (inductionVariable < end)
333
+ do {
334
+ var index = inductionVariable;
335
+ inductionVariable = inductionVariable + 1 | 0;
336
+ var ch = charSequenceGet(_this__u8e3s4, index);
337
+ if (ch === _Char___init__impl__6a9atx(37) || (plusIsSpace && ch === _Char___init__impl__6a9atx(43))) {
338
+ return decodeImpl(_this__u8e3s4, start, end, index, plusIsSpace, charset);
339
+ }
340
+ }
341
+ while (inductionVariable < end);
342
+ var tmp;
343
+ if (start === 0 && end === _this__u8e3s4.length) {
344
+ tmp = toString(_this__u8e3s4);
345
+ } else {
346
+ // Inline function 'kotlin.text.substring' call
347
+ // Inline function 'kotlin.js.asDynamic' call
348
+ tmp = _this__u8e3s4.substring(start, end);
349
+ }
350
+ return tmp;
351
+ }
352
+ function encodeURLPath(_this__u8e3s4, encodeSlash) {
353
+ _init_properties_Codecs_kt__fudxxf();
354
+ // Inline function 'kotlin.text.buildString' call
355
+ // Inline function 'kotlin.contracts.contract' call
356
+ // Inline function 'kotlin.apply' call
357
+ var this_0 = StringBuilder_init_$Create$();
358
+ // Inline function 'kotlin.contracts.contract' call
359
+ // Inline function 'io.ktor.http.encodeURLPath.<anonymous>' call
360
+ var charset = Charsets_getInstance().a1z_1;
361
+ var index = 0;
362
+ $l$loop_0: while (index < _this__u8e3s4.length) {
363
+ var current = charSequenceGet(_this__u8e3s4, index);
364
+ if (!encodeSlash && current === _Char___init__impl__6a9atx(47) || get_URL_ALPHABET_CHARS().s1(new Char(current)) || get_VALID_PATH_PART().s1(new Char(current))) {
365
+ this_0.o8(current);
366
+ index = index + 1 | 0;
367
+ continue $l$loop_0;
368
+ }
369
+ if (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)))) {
370
+ this_0.o8(current);
371
+ this_0.o8(charSequenceGet(_this__u8e3s4, index + 1 | 0));
372
+ this_0.o8(charSequenceGet(_this__u8e3s4, index + 2 | 0));
373
+ index = index + 3 | 0;
374
+ continue $l$loop_0;
375
+ }
376
+ var symbolSize = isSurrogate(current) ? 2 : 1;
377
+ var tmp = encode(charset.e1z(), _this__u8e3s4, index, index + symbolSize | 0);
378
+ forEach_0(tmp, encodeURLPath$lambda(this_0));
379
+ index = index + symbolSize | 0;
380
+ }
381
+ return this_0.toString();
382
+ }
383
+ function hexDigitToChar(digit) {
384
+ _init_properties_Codecs_kt__fudxxf();
385
+ 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);
386
+ }
387
+ function decodeImpl(_this__u8e3s4, start, end, prefixEnd, plusIsSpace, charset) {
388
+ _init_properties_Codecs_kt__fudxxf();
389
+ var length = end - start | 0;
390
+ var sbSize = length > 255 ? length / 3 | 0 : length;
391
+ var sb = StringBuilder_init_$Create$_0(sbSize);
392
+ if (prefixEnd > start) {
393
+ sb.wb(_this__u8e3s4, start, prefixEnd);
394
+ }
395
+ var index = prefixEnd;
396
+ var bytes = null;
397
+ while (index < end) {
398
+ var c = charSequenceGet(_this__u8e3s4, index);
399
+ if (plusIsSpace && c === _Char___init__impl__6a9atx(43)) {
400
+ sb.o8(_Char___init__impl__6a9atx(32));
401
+ index = index + 1 | 0;
402
+ } else if (c === _Char___init__impl__6a9atx(37)) {
403
+ if (bytes == null) {
404
+ bytes = new Int8Array((end - index | 0) / 3 | 0);
405
+ }
406
+ var count = 0;
407
+ while (index < end && charSequenceGet(_this__u8e3s4, index) === _Char___init__impl__6a9atx(37)) {
408
+ if ((index + 2 | 0) >= end) {
409
+ // Inline function 'kotlin.text.substring' call
410
+ var startIndex = index;
411
+ var endIndex = charSequenceLength(_this__u8e3s4);
412
+ var tmp$ret$0 = toString(charSequenceSubSequence(_this__u8e3s4, startIndex, endIndex));
413
+ throw new URLDecodeException('Incomplete trailing HEX escape: ' + tmp$ret$0 + ', in ' + toString(_this__u8e3s4) + ' at ' + index);
414
+ }
415
+ var digit1 = charToHexDigit(charSequenceGet(_this__u8e3s4, index + 1 | 0));
416
+ var digit2 = charToHexDigit(charSequenceGet(_this__u8e3s4, index + 2 | 0));
417
+ if (digit1 === -1 || digit2 === -1) {
418
+ 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);
419
+ }
420
+ var tmp = bytes;
421
+ var tmp1 = count;
422
+ count = tmp1 + 1 | 0;
423
+ tmp[tmp1] = toByte(imul(digit1, 16) + digit2 | 0);
424
+ index = index + 3 | 0;
425
+ }
426
+ sb.n8(String_0(bytes, 0, count, charset));
427
+ } else {
428
+ sb.o8(c);
429
+ index = index + 1 | 0;
430
+ }
431
+ }
432
+ return sb.toString();
433
+ }
434
+ function URLDecodeException(message) {
435
+ Exception_init_$Init$(message, this);
436
+ captureStack(this, URLDecodeException);
437
+ }
438
+ function charToHexDigit(c2) {
439
+ _init_properties_Codecs_kt__fudxxf();
440
+ 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;
441
+ }
442
+ function encodeURLParameterValue(_this__u8e3s4) {
443
+ _init_properties_Codecs_kt__fudxxf();
444
+ return encodeURLParameter(_this__u8e3s4, true);
445
+ }
446
+ function encodeURLParameter$lambda($$this$buildString, $spaceToPlus) {
447
+ return function (it) {
448
+ var tmp;
449
+ if (get_URL_ALPHABET().s1(it) || get_SPECIAL_SYMBOLS().s1(it)) {
450
+ $$this$buildString.o8(numberToChar(it));
451
+ tmp = Unit_instance;
452
+ } else if ($spaceToPlus && it === 32) {
453
+ $$this$buildString.o8(_Char___init__impl__6a9atx(43));
454
+ tmp = Unit_instance;
455
+ } else {
456
+ $$this$buildString.n8(percentEncode(it));
457
+ tmp = Unit_instance;
458
+ }
459
+ return Unit_instance;
460
+ };
461
+ }
462
+ function encodeURLQueryComponent$lambda($spaceToPlus, $$this$buildString, $encodeFull) {
463
+ return function (it) {
464
+ var tmp;
465
+ if (it === 32) {
466
+ var tmp_0;
467
+ if ($spaceToPlus) {
468
+ $$this$buildString.o8(_Char___init__impl__6a9atx(43));
469
+ tmp_0 = Unit_instance;
470
+ } else {
471
+ $$this$buildString.n8('%20');
472
+ tmp_0 = Unit_instance;
473
+ }
474
+ tmp = tmp_0;
475
+ } else if (get_URL_ALPHABET().s1(it) || (!$encodeFull && get_URL_PROTOCOL_PART().s1(it))) {
476
+ $$this$buildString.o8(numberToChar(it));
477
+ tmp = Unit_instance;
478
+ } else {
479
+ $$this$buildString.n8(percentEncode(it));
480
+ tmp = Unit_instance;
481
+ }
482
+ return Unit_instance;
483
+ };
484
+ }
485
+ function encodeURLPath$lambda($$this$buildString) {
486
+ return function (it) {
487
+ $$this$buildString.n8(percentEncode(it));
488
+ return Unit_instance;
489
+ };
490
+ }
491
+ var properties_initialized_Codecs_kt_hkj9s1;
492
+ function _init_properties_Codecs_kt__fudxxf() {
493
+ if (!properties_initialized_Codecs_kt_hkj9s1) {
494
+ properties_initialized_Codecs_kt_hkj9s1 = true;
495
+ // Inline function 'kotlin.collections.map' call
496
+ 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)));
497
+ // Inline function 'kotlin.collections.mapTo' call
498
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
499
+ var tmp0_iterator = this_0.j();
500
+ while (tmp0_iterator.k()) {
501
+ var item = tmp0_iterator.l();
502
+ // Inline function 'io.ktor.http.URL_ALPHABET.<anonymous>' call
503
+ // Inline function 'kotlin.code' call
504
+ var this_1 = item.g1_1;
505
+ var tmp$ret$0 = Char__toInt_impl_vasixd(this_1);
506
+ var tmp$ret$1 = toByte(tmp$ret$0);
507
+ destination.e(tmp$ret$1);
508
+ }
509
+ URL_ALPHABET = toSet(destination);
510
+ 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))));
511
+ 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))));
512
+ // Inline function 'kotlin.collections.map' call
513
+ 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))]);
514
+ // Inline function 'kotlin.collections.mapTo' call
515
+ var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_2, 10));
516
+ var tmp0_iterator_0 = this_2.j();
517
+ while (tmp0_iterator_0.k()) {
518
+ var item_0 = tmp0_iterator_0.l();
519
+ // Inline function 'io.ktor.http.URL_PROTOCOL_PART.<anonymous>' call
520
+ // Inline function 'kotlin.code' call
521
+ var this_3 = item_0.g1_1;
522
+ var tmp$ret$0_0 = Char__toInt_impl_vasixd(this_3);
523
+ var tmp$ret$1_0 = toByte(tmp$ret$0_0);
524
+ destination_0.e(tmp$ret$1_0);
525
+ }
526
+ URL_PROTOCOL_PART = destination_0;
527
+ 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))]);
528
+ 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))]));
529
+ // Inline function 'kotlin.collections.map' call
530
+ 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))]);
531
+ // Inline function 'kotlin.collections.mapTo' call
532
+ var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(this_4, 10));
533
+ var tmp0_iterator_1 = this_4.j();
534
+ while (tmp0_iterator_1.k()) {
535
+ var item_1 = tmp0_iterator_1.l();
536
+ // Inline function 'io.ktor.http.SPECIAL_SYMBOLS.<anonymous>' call
537
+ // Inline function 'kotlin.code' call
538
+ var this_5 = item_1.g1_1;
539
+ var tmp$ret$0_1 = Char__toInt_impl_vasixd(this_5);
540
+ var tmp$ret$1_1 = toByte(tmp$ret$0_1);
541
+ destination_1.e(tmp$ret$1_1);
542
+ }
543
+ SPECIAL_SYMBOLS = destination_1;
544
+ }
545
+ }
546
+ function ContentType_init_$Init$(contentType, contentSubtype, parameters, $this) {
547
+ parameters = parameters === VOID ? emptyList() : parameters;
548
+ ContentType.call($this, contentType, contentSubtype, contentType + '/' + contentSubtype, parameters);
549
+ return $this;
550
+ }
551
+ function ContentType_init_$Create$(contentType, contentSubtype, parameters) {
552
+ return ContentType_init_$Init$(contentType, contentSubtype, parameters, objectCreate(protoOf(ContentType)));
553
+ }
554
+ function hasParameter($this, name, value) {
555
+ var tmp;
556
+ switch ($this.y2a_1.m()) {
557
+ case 0:
558
+ tmp = false;
559
+ break;
560
+ case 1:
561
+ // Inline function 'kotlin.let' call
562
+
563
+ // Inline function 'kotlin.contracts.contract' call
564
+
565
+ // Inline function 'io.ktor.http.ContentType.hasParameter.<anonymous>' call
566
+
567
+ var it = $this.y2a_1.o(0);
568
+ tmp = (equals(it.z2a_1, name, true) && equals(it.a2b_1, value, true));
569
+ break;
570
+ default:
571
+ var tmp$ret$2;
572
+ $l$block_0: {
573
+ // Inline function 'kotlin.collections.any' call
574
+ var this_0 = $this.y2a_1;
575
+ var tmp_0;
576
+ if (isInterface(this_0, Collection)) {
577
+ tmp_0 = this_0.p();
578
+ } else {
579
+ tmp_0 = false;
580
+ }
581
+ if (tmp_0) {
582
+ tmp$ret$2 = false;
583
+ break $l$block_0;
584
+ }
585
+ var tmp0_iterator = this_0.j();
586
+ while (tmp0_iterator.k()) {
587
+ var element = tmp0_iterator.l();
588
+ // Inline function 'io.ktor.http.ContentType.hasParameter.<anonymous>' call
589
+ if (equals(element.z2a_1, name, true) && equals(element.a2b_1, value, true)) {
590
+ tmp$ret$2 = true;
591
+ break $l$block_0;
592
+ }
593
+ }
594
+ tmp$ret$2 = false;
595
+ }
596
+
597
+ tmp = tmp$ret$2;
598
+ break;
599
+ }
600
+ return tmp;
601
+ }
602
+ function Companion() {
603
+ Companion_instance_0 = this;
604
+ this.c2b_1 = ContentType_init_$Create$('*', '*');
605
+ }
606
+ protoOf(Companion).sk = function (value) {
607
+ if (isBlank(value))
608
+ return this.c2b_1;
609
+ // Inline function 'io.ktor.http.Companion.parse' call
610
+ var headerValue = last(parseHeaderValue(value));
611
+ // Inline function 'io.ktor.http.Companion.parse.<anonymous>' call
612
+ var parts = headerValue.d2b_1;
613
+ var parameters = headerValue.e2b_1;
614
+ var slash = indexOf(parts, _Char___init__impl__6a9atx(47));
615
+ if (slash === -1) {
616
+ // Inline function 'kotlin.text.trim' call
617
+ if (toString(trim(isCharSequence(parts) ? parts : THROW_CCE())) === '*')
618
+ return Companion_getInstance().c2b_1;
619
+ throw new BadContentTypeFormatException(value);
620
+ }
621
+ // Inline function 'kotlin.text.trim' call
622
+ // Inline function 'kotlin.text.substring' call
623
+ // Inline function 'kotlin.js.asDynamic' call
624
+ var this_0 = parts.substring(0, slash);
625
+ var type = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
626
+ // Inline function 'kotlin.text.isEmpty' call
627
+ if (charSequenceLength(type) === 0) {
628
+ throw new BadContentTypeFormatException(value);
629
+ }
630
+ // Inline function 'kotlin.text.trim' call
631
+ // Inline function 'kotlin.text.substring' call
632
+ var startIndex = slash + 1 | 0;
633
+ // Inline function 'kotlin.js.asDynamic' call
634
+ var this_1 = parts.substring(startIndex);
635
+ var subtype = toString(trim(isCharSequence(this_1) ? this_1 : THROW_CCE()));
636
+ if (contains(type, _Char___init__impl__6a9atx(32)) || contains(subtype, _Char___init__impl__6a9atx(32))) {
637
+ throw new BadContentTypeFormatException(value);
638
+ }
639
+ var tmp;
640
+ // Inline function 'kotlin.text.isEmpty' call
641
+ if (charSequenceLength(subtype) === 0) {
642
+ tmp = true;
643
+ } else {
644
+ tmp = contains(subtype, _Char___init__impl__6a9atx(47));
645
+ }
646
+ if (tmp) {
647
+ throw new BadContentTypeFormatException(value);
648
+ }
649
+ return ContentType_init_$Create$(type, subtype, parameters);
650
+ };
651
+ var Companion_instance_0;
652
+ function Companion_getInstance() {
653
+ if (Companion_instance_0 == null)
654
+ new Companion();
655
+ return Companion_instance_0;
656
+ }
657
+ function Application() {
658
+ Application_instance = this;
659
+ this.g2b_1 = ContentType_init_$Create$('application', '*');
660
+ this.h2b_1 = ContentType_init_$Create$('application', 'atom+xml');
661
+ this.i2b_1 = ContentType_init_$Create$('application', 'cbor');
662
+ this.j2b_1 = ContentType_init_$Create$('application', 'json');
663
+ this.k2b_1 = ContentType_init_$Create$('application', 'hal+json');
664
+ this.l2b_1 = ContentType_init_$Create$('application', 'javascript');
665
+ this.m2b_1 = ContentType_init_$Create$('application', 'octet-stream');
666
+ this.n2b_1 = ContentType_init_$Create$('application', 'rss+xml');
667
+ this.o2b_1 = ContentType_init_$Create$('application', 'xml');
668
+ this.p2b_1 = ContentType_init_$Create$('application', 'xml-dtd');
669
+ this.q2b_1 = ContentType_init_$Create$('application', 'zip');
670
+ this.r2b_1 = ContentType_init_$Create$('application', 'gzip');
671
+ this.s2b_1 = ContentType_init_$Create$('application', 'x-www-form-urlencoded');
672
+ this.t2b_1 = ContentType_init_$Create$('application', 'pdf');
673
+ this.u2b_1 = ContentType_init_$Create$('application', 'vnd.openxmlformats-officedocument.spreadsheetml.sheet');
674
+ this.v2b_1 = ContentType_init_$Create$('application', 'vnd.openxmlformats-officedocument.wordprocessingml.document');
675
+ this.w2b_1 = ContentType_init_$Create$('application', 'vnd.openxmlformats-officedocument.presentationml.presentation');
676
+ this.x2b_1 = ContentType_init_$Create$('application', 'protobuf');
677
+ this.y2b_1 = ContentType_init_$Create$('application', 'wasm');
678
+ this.z2b_1 = ContentType_init_$Create$('application', 'problem+json');
679
+ this.a2c_1 = ContentType_init_$Create$('application', 'problem+xml');
680
+ }
681
+ var Application_instance;
682
+ function Application_getInstance() {
683
+ if (Application_instance == null)
684
+ new Application();
685
+ return Application_instance;
686
+ }
687
+ function Text() {
688
+ Text_instance = this;
689
+ this.b2c_1 = ContentType_init_$Create$('text', '*');
690
+ this.c2c_1 = ContentType_init_$Create$('text', 'plain');
691
+ this.d2c_1 = ContentType_init_$Create$('text', 'css');
692
+ this.e2c_1 = ContentType_init_$Create$('text', 'csv');
693
+ this.f2c_1 = ContentType_init_$Create$('text', 'html');
694
+ this.g2c_1 = ContentType_init_$Create$('text', 'javascript');
695
+ this.h2c_1 = ContentType_init_$Create$('text', 'vcard');
696
+ this.i2c_1 = ContentType_init_$Create$('text', 'xml');
697
+ this.j2c_1 = ContentType_init_$Create$('text', 'event-stream');
698
+ }
699
+ var Text_instance;
700
+ function Text_getInstance() {
701
+ if (Text_instance == null)
702
+ new Text();
703
+ return Text_instance;
704
+ }
705
+ function ContentType(contentType, contentSubtype, existingContent, parameters) {
706
+ Companion_getInstance();
707
+ parameters = parameters === VOID ? emptyList() : parameters;
708
+ HeaderValueWithParameters.call(this, existingContent, parameters);
709
+ this.m2c_1 = contentType;
710
+ this.n2c_1 = contentSubtype;
711
+ }
712
+ protoOf(ContentType).o2c = function (name, value) {
713
+ if (hasParameter(this, name, value))
714
+ return this;
715
+ return new ContentType(this.m2c_1, this.n2c_1, this.x2a_1, plus_2(this.y2a_1, HeaderValueParam_init_$Create$(name, value)));
716
+ };
717
+ protoOf(ContentType).p2c = function () {
718
+ return this.y2a_1.p() ? this : ContentType_init_$Create$(this.m2c_1, this.n2c_1);
719
+ };
720
+ protoOf(ContentType).q2c = function (pattern) {
721
+ if (!(pattern.m2c_1 === '*') && !equals(pattern.m2c_1, this.m2c_1, true)) {
722
+ return false;
723
+ }
724
+ if (!(pattern.n2c_1 === '*') && !equals(pattern.n2c_1, this.n2c_1, true)) {
725
+ return false;
726
+ }
727
+ var tmp0_iterator = pattern.y2a_1.j();
728
+ while (tmp0_iterator.k()) {
729
+ var tmp1_loop_parameter = tmp0_iterator.l();
730
+ var patternName = tmp1_loop_parameter.pe();
731
+ var patternValue = tmp1_loop_parameter.qe();
732
+ var tmp;
733
+ if (patternName === '*') {
734
+ var tmp_0;
735
+ if (patternValue === '*') {
736
+ tmp_0 = true;
737
+ } else {
738
+ var tmp$ret$0;
739
+ $l$block_0: {
740
+ // Inline function 'kotlin.collections.any' call
741
+ var this_0 = this.y2a_1;
742
+ var tmp_1;
743
+ if (isInterface(this_0, Collection)) {
744
+ tmp_1 = this_0.p();
745
+ } else {
746
+ tmp_1 = false;
747
+ }
748
+ if (tmp_1) {
749
+ tmp$ret$0 = false;
750
+ break $l$block_0;
751
+ }
752
+ var tmp0_iterator_0 = this_0.j();
753
+ while (tmp0_iterator_0.k()) {
754
+ var element = tmp0_iterator_0.l();
755
+ // Inline function 'io.ktor.http.ContentType.match.<anonymous>' call
756
+ if (equals(element.a2b_1, patternValue, true)) {
757
+ tmp$ret$0 = true;
758
+ break $l$block_0;
759
+ }
760
+ }
761
+ tmp$ret$0 = false;
762
+ }
763
+ tmp_0 = tmp$ret$0;
764
+ }
765
+ tmp = tmp_0;
766
+ } else {
767
+ var value = this.r2c(patternName);
768
+ tmp = patternValue === '*' ? !(value == null) : equals(value, patternValue, true);
769
+ }
770
+ var matches = tmp;
771
+ if (!matches) {
772
+ return false;
773
+ }
774
+ }
775
+ return true;
776
+ };
777
+ protoOf(ContentType).equals = function (other) {
778
+ var tmp;
779
+ var tmp_0;
780
+ var tmp_1;
781
+ if (other instanceof ContentType) {
782
+ tmp_1 = equals(this.m2c_1, other.m2c_1, true);
783
+ } else {
784
+ tmp_1 = false;
785
+ }
786
+ if (tmp_1) {
787
+ tmp_0 = equals(this.n2c_1, other.n2c_1, true);
788
+ } else {
789
+ tmp_0 = false;
790
+ }
791
+ if (tmp_0) {
792
+ tmp = equals_0(this.y2a_1, other.y2a_1);
793
+ } else {
794
+ tmp = false;
795
+ }
796
+ return tmp;
797
+ };
798
+ protoOf(ContentType).hashCode = function () {
799
+ // Inline function 'kotlin.text.lowercase' call
800
+ // Inline function 'kotlin.js.asDynamic' call
801
+ var tmp$ret$1 = this.m2c_1.toLowerCase();
802
+ var result = getStringHashCode(tmp$ret$1);
803
+ var tmp = result;
804
+ var tmp_0 = imul(31, result);
805
+ // Inline function 'kotlin.text.lowercase' call
806
+ // Inline function 'kotlin.js.asDynamic' call
807
+ var tmp$ret$3 = this.n2c_1.toLowerCase();
808
+ result = tmp + (tmp_0 + getStringHashCode(tmp$ret$3) | 0) | 0;
809
+ result = result + imul(31, hashCode(this.y2a_1)) | 0;
810
+ return result;
811
+ };
812
+ function BadContentTypeFormatException(value) {
813
+ Exception_init_$Init$('Bad Content-Type format: ' + value, this);
814
+ captureStack(this, BadContentTypeFormatException);
815
+ }
816
+ function charset(_this__u8e3s4) {
817
+ var tmp0_safe_receiver = _this__u8e3s4.r2c('charset');
818
+ var tmp;
819
+ if (tmp0_safe_receiver == null) {
820
+ tmp = null;
821
+ } else {
822
+ // Inline function 'kotlin.let' call
823
+ // Inline function 'kotlin.contracts.contract' call
824
+ // Inline function 'io.ktor.http.charset.<anonymous>' call
825
+ var tmp_0;
826
+ try {
827
+ tmp_0 = Companion_instance.b22(tmp0_safe_receiver);
828
+ } catch ($p) {
829
+ var tmp_1;
830
+ if ($p instanceof IllegalArgumentException) {
831
+ var exception = $p;
832
+ tmp_1 = null;
833
+ } else {
834
+ throw $p;
835
+ }
836
+ tmp_0 = tmp_1;
837
+ }
838
+ tmp = tmp_0;
839
+ }
840
+ return tmp;
841
+ }
842
+ function withCharset(_this__u8e3s4, charset) {
843
+ return _this__u8e3s4.o2c('charset', get_name(charset));
844
+ }
845
+ function withCharsetIfNeeded(_this__u8e3s4, charset) {
846
+ var tmp;
847
+ // Inline function 'kotlin.text.lowercase' call
848
+ // Inline function 'kotlin.js.asDynamic' call
849
+ if (!(_this__u8e3s4.m2c_1.toLowerCase() === 'text')) {
850
+ tmp = _this__u8e3s4;
851
+ } else {
852
+ tmp = _this__u8e3s4.o2c('charset', get_name(charset));
853
+ }
854
+ return tmp;
855
+ }
856
+ function get_HeaderFieldValueSeparators() {
857
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
858
+ return HeaderFieldValueSeparators;
859
+ }
860
+ var HeaderFieldValueSeparators;
861
+ function Companion_0() {
862
+ }
863
+ var Companion_instance_1;
864
+ function Companion_getInstance_0() {
865
+ return Companion_instance_1;
866
+ }
867
+ function HeaderValueWithParameters(content, parameters) {
868
+ parameters = parameters === VOID ? emptyList() : parameters;
869
+ this.x2a_1 = content;
870
+ this.y2a_1 = parameters;
871
+ }
872
+ protoOf(HeaderValueWithParameters).r2c = function (name) {
873
+ var inductionVariable = 0;
874
+ var last = get_lastIndex(this.y2a_1);
875
+ if (inductionVariable <= last)
876
+ do {
877
+ var index = inductionVariable;
878
+ inductionVariable = inductionVariable + 1 | 0;
879
+ var parameter = this.y2a_1.o(index);
880
+ if (equals(parameter.z2a_1, name, true)) {
881
+ return parameter.a2b_1;
882
+ }
883
+ }
884
+ while (!(index === last));
885
+ return null;
886
+ };
887
+ protoOf(HeaderValueWithParameters).toString = function () {
888
+ var tmp;
889
+ if (this.y2a_1.p()) {
890
+ tmp = this.x2a_1;
891
+ } else {
892
+ var tmp_0 = this.x2a_1.length;
893
+ // Inline function 'kotlin.collections.sumOf' call
894
+ var sum = 0;
895
+ var tmp0_iterator = this.y2a_1.j();
896
+ while (tmp0_iterator.k()) {
897
+ var element = tmp0_iterator.l();
898
+ var tmp_1 = sum;
899
+ // Inline function 'io.ktor.http.HeaderValueWithParameters.toString.<anonymous>' call
900
+ sum = tmp_1 + ((element.z2a_1.length + element.a2b_1.length | 0) + 3 | 0) | 0;
901
+ }
902
+ var size = tmp_0 + sum | 0;
903
+ // Inline function 'kotlin.apply' call
904
+ var this_0 = StringBuilder_init_$Create$_0(size);
905
+ // Inline function 'kotlin.contracts.contract' call
906
+ // Inline function 'io.ktor.http.HeaderValueWithParameters.toString.<anonymous>' call
907
+ this_0.n8(this.x2a_1);
908
+ var inductionVariable = 0;
909
+ var last = get_lastIndex(this.y2a_1);
910
+ if (inductionVariable <= last)
911
+ do {
912
+ var index = inductionVariable;
913
+ inductionVariable = inductionVariable + 1 | 0;
914
+ var element_0 = this.y2a_1.o(index);
915
+ this_0.n8('; ');
916
+ this_0.n8(element_0.z2a_1);
917
+ this_0.n8('=');
918
+ // Inline function 'io.ktor.http.escapeIfNeededTo' call
919
+ var this_1 = element_0.a2b_1;
920
+ if (needQuotes$accessor$vynnj(this_1)) {
921
+ this_0.n8(quote(this_1));
922
+ } else {
923
+ this_0.n8(this_1);
924
+ }
925
+ }
926
+ while (!(index === last));
927
+ tmp = this_0.toString();
928
+ }
929
+ return tmp;
930
+ };
931
+ function needQuotes(_this__u8e3s4) {
932
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
933
+ // Inline function 'kotlin.text.isEmpty' call
934
+ if (charSequenceLength(_this__u8e3s4) === 0)
935
+ return true;
936
+ if (isQuoted(_this__u8e3s4))
937
+ return false;
938
+ var inductionVariable = 0;
939
+ var last = _this__u8e3s4.length;
940
+ if (inductionVariable < last)
941
+ do {
942
+ var index = inductionVariable;
943
+ inductionVariable = inductionVariable + 1 | 0;
944
+ if (get_HeaderFieldValueSeparators().s1(new Char(charSequenceGet(_this__u8e3s4, index))))
945
+ return true;
946
+ }
947
+ while (inductionVariable < last);
948
+ return false;
949
+ }
950
+ function quote(_this__u8e3s4) {
951
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
952
+ // Inline function 'kotlin.text.buildString' call
953
+ // Inline function 'kotlin.contracts.contract' call
954
+ // Inline function 'kotlin.apply' call
955
+ var this_0 = StringBuilder_init_$Create$();
956
+ // Inline function 'kotlin.contracts.contract' call
957
+ // Inline function 'io.ktor.http.quote.<anonymous>' call
958
+ quoteTo(_this__u8e3s4, this_0);
959
+ return this_0.toString();
960
+ }
961
+ function isQuoted(_this__u8e3s4) {
962
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
963
+ if (_this__u8e3s4.length < 2) {
964
+ return false;
965
+ }
966
+ if (!(first(_this__u8e3s4) === _Char___init__impl__6a9atx(34)) || !(last_0(_this__u8e3s4) === _Char___init__impl__6a9atx(34))) {
967
+ return false;
968
+ }
969
+ var startIndex = 1;
970
+ $l$loop: do {
971
+ var index = indexOf(_this__u8e3s4, _Char___init__impl__6a9atx(34), startIndex);
972
+ if (index === get_lastIndex_0(_this__u8e3s4)) {
973
+ break $l$loop;
974
+ }
975
+ var slashesCount = 0;
976
+ var slashIndex = index - 1 | 0;
977
+ while (charSequenceGet(_this__u8e3s4, slashIndex) === _Char___init__impl__6a9atx(92)) {
978
+ slashesCount = slashesCount + 1 | 0;
979
+ slashIndex = slashIndex - 1 | 0;
980
+ }
981
+ if ((slashesCount % 2 | 0) === 0) {
982
+ return false;
983
+ }
984
+ startIndex = index + 1 | 0;
985
+ }
986
+ while (startIndex < _this__u8e3s4.length);
987
+ return true;
988
+ }
989
+ function quoteTo(_this__u8e3s4, out) {
990
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
991
+ out.n8('"');
992
+ var inductionVariable = 0;
993
+ var last = _this__u8e3s4.length;
994
+ if (inductionVariable < last)
995
+ do {
996
+ var i = inductionVariable;
997
+ inductionVariable = inductionVariable + 1 | 0;
998
+ var ch = charSequenceGet(_this__u8e3s4, i);
999
+ if (ch === _Char___init__impl__6a9atx(92)) {
1000
+ out.n8('\\\\');
1001
+ } else if (ch === _Char___init__impl__6a9atx(10)) {
1002
+ out.n8('\\n');
1003
+ } else if (ch === _Char___init__impl__6a9atx(13)) {
1004
+ out.n8('\\r');
1005
+ } else if (ch === _Char___init__impl__6a9atx(9)) {
1006
+ out.n8('\\t');
1007
+ } else if (ch === _Char___init__impl__6a9atx(34)) {
1008
+ out.n8('\\"');
1009
+ } else {
1010
+ out.o8(ch);
1011
+ }
1012
+ }
1013
+ while (inductionVariable < last);
1014
+ out.n8('"');
1015
+ }
1016
+ function needQuotes$accessor$vynnj(_this__u8e3s4) {
1017
+ _init_properties_HeaderValueWithParameters_kt__z6luvy();
1018
+ return needQuotes(_this__u8e3s4);
1019
+ }
1020
+ var properties_initialized_HeaderValueWithParameters_kt_yu5xg;
1021
+ function _init_properties_HeaderValueWithParameters_kt__z6luvy() {
1022
+ if (!properties_initialized_HeaderValueWithParameters_kt_yu5xg) {
1023
+ properties_initialized_HeaderValueWithParameters_kt_yu5xg = true;
1024
+ 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))]);
1025
+ }
1026
+ }
1027
+ function Companion_1() {
1028
+ Companion_instance_2 = this;
1029
+ this.s2c_1 = EmptyHeaders_instance;
1030
+ }
1031
+ var Companion_instance_2;
1032
+ function Companion_getInstance_1() {
1033
+ if (Companion_instance_2 == null)
1034
+ new Companion_1();
1035
+ return Companion_instance_2;
1036
+ }
1037
+ function HeadersBuilder(size) {
1038
+ size = size === VOID ? 8 : size;
1039
+ StringValuesBuilderImpl.call(this, true, size);
1040
+ }
1041
+ protoOf(HeadersBuilder).u1r = function () {
1042
+ return new HeadersImpl(this.a27_1);
1043
+ };
1044
+ protoOf(HeadersBuilder).b27 = function (name) {
1045
+ protoOf(StringValuesBuilderImpl).b27.call(this, name);
1046
+ HttpHeaders_getInstance().r2g(name);
1047
+ };
1048
+ protoOf(HeadersBuilder).g27 = function (value) {
1049
+ protoOf(StringValuesBuilderImpl).g27.call(this, value);
1050
+ HttpHeaders_getInstance().s2g(value);
1051
+ };
1052
+ function EmptyHeaders() {
1053
+ }
1054
+ protoOf(EmptyHeaders).u26 = function () {
1055
+ return true;
1056
+ };
1057
+ protoOf(EmptyHeaders).v26 = function (name) {
1058
+ return null;
1059
+ };
1060
+ protoOf(EmptyHeaders).w26 = function () {
1061
+ return emptySet();
1062
+ };
1063
+ protoOf(EmptyHeaders).x26 = function () {
1064
+ return emptySet();
1065
+ };
1066
+ protoOf(EmptyHeaders).toString = function () {
1067
+ return 'Headers ' + toString(this.x26());
1068
+ };
1069
+ var EmptyHeaders_instance;
1070
+ function EmptyHeaders_getInstance() {
1071
+ return EmptyHeaders_instance;
1072
+ }
1073
+ function HeadersImpl(values) {
1074
+ values = values === VOID ? emptyMap() : values;
1075
+ StringValuesImpl.call(this, true, values);
1076
+ }
1077
+ protoOf(HeadersImpl).toString = function () {
1078
+ return 'Headers ' + toString(this.x26());
1079
+ };
1080
+ function HeaderValueParam_init_$Init$(name, value, $this) {
1081
+ HeaderValueParam.call($this, name, value, false);
1082
+ return $this;
1083
+ }
1084
+ function HeaderValueParam_init_$Create$(name, value) {
1085
+ return HeaderValueParam_init_$Init$(name, value, objectCreate(protoOf(HeaderValueParam)));
1086
+ }
1087
+ function HeaderValueParam(name, value, escapeValue) {
1088
+ this.z2a_1 = name;
1089
+ this.a2b_1 = value;
1090
+ this.b2b_1 = escapeValue;
1091
+ }
1092
+ protoOf(HeaderValueParam).equals = function (other) {
1093
+ var tmp;
1094
+ var tmp_0;
1095
+ if (other instanceof HeaderValueParam) {
1096
+ tmp_0 = equals(other.z2a_1, this.z2a_1, true);
1097
+ } else {
1098
+ tmp_0 = false;
1099
+ }
1100
+ if (tmp_0) {
1101
+ tmp = equals(other.a2b_1, this.a2b_1, true);
1102
+ } else {
1103
+ tmp = false;
1104
+ }
1105
+ return tmp;
1106
+ };
1107
+ protoOf(HeaderValueParam).hashCode = function () {
1108
+ // Inline function 'kotlin.text.lowercase' call
1109
+ // Inline function 'kotlin.js.asDynamic' call
1110
+ var tmp$ret$1 = this.z2a_1.toLowerCase();
1111
+ var result = getStringHashCode(tmp$ret$1);
1112
+ var tmp = result;
1113
+ var tmp_0 = imul(31, result);
1114
+ // Inline function 'kotlin.text.lowercase' call
1115
+ // Inline function 'kotlin.js.asDynamic' call
1116
+ var tmp$ret$3 = this.a2b_1.toLowerCase();
1117
+ result = tmp + (tmp_0 + getStringHashCode(tmp$ret$3) | 0) | 0;
1118
+ return result;
1119
+ };
1120
+ protoOf(HeaderValueParam).pe = function () {
1121
+ return this.z2a_1;
1122
+ };
1123
+ protoOf(HeaderValueParam).qe = function () {
1124
+ return this.a2b_1;
1125
+ };
1126
+ protoOf(HeaderValueParam).toString = function () {
1127
+ return 'HeaderValueParam(name=' + this.z2a_1 + ', value=' + this.a2b_1 + ', escapeValue=' + this.b2b_1 + ')';
1128
+ };
1129
+ function HeaderValue(value, params) {
1130
+ params = params === VOID ? emptyList() : params;
1131
+ this.d2b_1 = value;
1132
+ this.e2b_1 = params;
1133
+ var tmp = this;
1134
+ var tmp$ret$1;
1135
+ $l$block: {
1136
+ // Inline function 'kotlin.collections.firstOrNull' call
1137
+ var tmp0_iterator = this.e2b_1.j();
1138
+ while (tmp0_iterator.k()) {
1139
+ var element = tmp0_iterator.l();
1140
+ // Inline function 'io.ktor.http.HeaderValue.quality.<anonymous>' call
1141
+ if (element.z2a_1 === 'q') {
1142
+ tmp$ret$1 = element;
1143
+ break $l$block;
1144
+ }
1145
+ }
1146
+ tmp$ret$1 = null;
1147
+ }
1148
+ var tmp0_safe_receiver = tmp$ret$1;
1149
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.a2b_1;
1150
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : toDoubleOrNull(tmp1_safe_receiver);
1151
+ var tmp_0;
1152
+ if (tmp2_safe_receiver == null) {
1153
+ tmp_0 = null;
1154
+ } else {
1155
+ // Inline function 'kotlin.takeIf' call
1156
+ // Inline function 'kotlin.contracts.contract' call
1157
+ var tmp_1;
1158
+ // Inline function 'io.ktor.http.HeaderValue.quality.<anonymous>' call
1159
+ if (0.0 <= tmp2_safe_receiver ? tmp2_safe_receiver <= 1.0 : false) {
1160
+ tmp_1 = tmp2_safe_receiver;
1161
+ } else {
1162
+ tmp_1 = null;
1163
+ }
1164
+ tmp_0 = tmp_1;
1165
+ }
1166
+ var tmp3_elvis_lhs = tmp_0;
1167
+ tmp.f2b_1 = tmp3_elvis_lhs == null ? 1.0 : tmp3_elvis_lhs;
1168
+ }
1169
+ protoOf(HeaderValue).pe = function () {
1170
+ return this.d2b_1;
1171
+ };
1172
+ protoOf(HeaderValue).toString = function () {
1173
+ return 'HeaderValue(value=' + this.d2b_1 + ', params=' + toString(this.e2b_1) + ')';
1174
+ };
1175
+ protoOf(HeaderValue).hashCode = function () {
1176
+ var result = getStringHashCode(this.d2b_1);
1177
+ result = imul(result, 31) + hashCode(this.e2b_1) | 0;
1178
+ return result;
1179
+ };
1180
+ protoOf(HeaderValue).equals = function (other) {
1181
+ if (this === other)
1182
+ return true;
1183
+ if (!(other instanceof HeaderValue))
1184
+ return false;
1185
+ var tmp0_other_with_cast = other instanceof HeaderValue ? other : THROW_CCE();
1186
+ if (!(this.d2b_1 === tmp0_other_with_cast.d2b_1))
1187
+ return false;
1188
+ if (!equals_0(this.e2b_1, tmp0_other_with_cast.e2b_1))
1189
+ return false;
1190
+ return true;
1191
+ };
1192
+ function parseHeaderValue(text) {
1193
+ return parseHeaderValue_0(text, false);
1194
+ }
1195
+ function parseHeaderValue_0(text, parametersOnly) {
1196
+ if (text == null) {
1197
+ return emptyList();
1198
+ }
1199
+ var position = 0;
1200
+ var tmp = LazyThreadSafetyMode_NONE_getInstance();
1201
+ var items = lazy(tmp, parseHeaderValue$lambda);
1202
+ while (position <= get_lastIndex_0(text)) {
1203
+ position = parseHeaderValueItem(text, position, items, parametersOnly);
1204
+ }
1205
+ return valueOrEmpty(items);
1206
+ }
1207
+ function parseHeaderValueItem(text, start, items, parametersOnly) {
1208
+ var position = start;
1209
+ var tmp = LazyThreadSafetyMode_NONE_getInstance();
1210
+ var parameters = lazy(tmp, parseHeaderValueItem$lambda);
1211
+ var valueEnd = parametersOnly ? position : null;
1212
+ while (position <= get_lastIndex_0(text)) {
1213
+ var tmp0_subject = charSequenceGet(text, position);
1214
+ if (tmp0_subject === _Char___init__impl__6a9atx(44)) {
1215
+ var tmp_0 = items.u();
1216
+ var tmp1_elvis_lhs = valueEnd;
1217
+ tmp_0.e(new HeaderValue(subtrim(text, start, tmp1_elvis_lhs == null ? position : tmp1_elvis_lhs), valueOrEmpty(parameters)));
1218
+ return position + 1 | 0;
1219
+ } else if (tmp0_subject === _Char___init__impl__6a9atx(59)) {
1220
+ if (valueEnd == null)
1221
+ valueEnd = position;
1222
+ position = parseHeaderValueParameter(text, position + 1 | 0, parameters);
1223
+ } else {
1224
+ var tmp_1;
1225
+ if (parametersOnly) {
1226
+ tmp_1 = parseHeaderValueParameter(text, position, parameters);
1227
+ } else {
1228
+ tmp_1 = position + 1 | 0;
1229
+ }
1230
+ position = tmp_1;
1231
+ }
1232
+ }
1233
+ var tmp_2 = items.u();
1234
+ var tmp2_elvis_lhs = valueEnd;
1235
+ tmp_2.e(new HeaderValue(subtrim(text, start, tmp2_elvis_lhs == null ? position : tmp2_elvis_lhs), valueOrEmpty(parameters)));
1236
+ return position;
1237
+ }
1238
+ function valueOrEmpty(_this__u8e3s4) {
1239
+ return _this__u8e3s4.bk() ? _this__u8e3s4.u() : emptyList();
1240
+ }
1241
+ function subtrim(_this__u8e3s4, start, end) {
1242
+ // Inline function 'kotlin.text.trim' call
1243
+ // Inline function 'kotlin.text.substring' call
1244
+ // Inline function 'kotlin.js.asDynamic' call
1245
+ var this_0 = _this__u8e3s4.substring(start, end);
1246
+ return toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
1247
+ }
1248
+ function parseHeaderValueParameter(text, start, parameters) {
1249
+ var position = start;
1250
+ while (position <= get_lastIndex_0(text)) {
1251
+ var tmp0_subject = charSequenceGet(text, position);
1252
+ if (tmp0_subject === _Char___init__impl__6a9atx(61)) {
1253
+ var tmp1_container = parseHeaderValueParameterValue(text, position + 1 | 0);
1254
+ var paramEnd = tmp1_container.pe();
1255
+ var paramValue = tmp1_container.qe();
1256
+ parseHeaderValueParameter$addParam(parameters, text, start, position, paramValue);
1257
+ return paramEnd;
1258
+ } else if (tmp0_subject === _Char___init__impl__6a9atx(59) ? true : tmp0_subject === _Char___init__impl__6a9atx(44)) {
1259
+ parseHeaderValueParameter$addParam(parameters, text, start, position, '');
1260
+ return position;
1261
+ } else {
1262
+ position = position + 1 | 0;
1263
+ }
1264
+ }
1265
+ parseHeaderValueParameter$addParam(parameters, text, start, position, '');
1266
+ return position;
1267
+ }
1268
+ function parseHeaderValueParameterValue(value, start) {
1269
+ if (value.length === start) {
1270
+ return to(start, '');
1271
+ }
1272
+ var position = start;
1273
+ if (charSequenceGet(value, start) === _Char___init__impl__6a9atx(34)) {
1274
+ return parseHeaderValueParameterValueQuoted(value, position + 1 | 0);
1275
+ }
1276
+ while (position <= get_lastIndex_0(value)) {
1277
+ var tmp0_subject = charSequenceGet(value, position);
1278
+ if (tmp0_subject === _Char___init__impl__6a9atx(59) ? true : tmp0_subject === _Char___init__impl__6a9atx(44))
1279
+ return to(position, subtrim(value, start, position));
1280
+ else {
1281
+ position = position + 1 | 0;
1282
+ }
1283
+ }
1284
+ return to(position, subtrim(value, start, position));
1285
+ }
1286
+ function parseHeaderValueParameterValueQuoted(value, start) {
1287
+ var position = start;
1288
+ var builder = StringBuilder_init_$Create$();
1289
+ loop: while (position <= get_lastIndex_0(value)) {
1290
+ var currentChar = charSequenceGet(value, position);
1291
+ if (currentChar === _Char___init__impl__6a9atx(34) && nextIsSemicolonOrEnd(value, position)) {
1292
+ return to(position + 1 | 0, builder.toString());
1293
+ } else if (currentChar === _Char___init__impl__6a9atx(92) && position < (get_lastIndex_0(value) - 2 | 0)) {
1294
+ builder.o8(charSequenceGet(value, position + 1 | 0));
1295
+ position = position + 2 | 0;
1296
+ continue loop;
1297
+ }
1298
+ builder.o8(currentChar);
1299
+ position = position + 1 | 0;
1300
+ }
1301
+ var tmp = position;
1302
+ // Inline function 'kotlin.text.plus' call
1303
+ var this_0 = _Char___init__impl__6a9atx(34);
1304
+ var other = builder.toString();
1305
+ var tmp$ret$0 = toString_0(this_0) + other;
1306
+ return to(tmp, tmp$ret$0);
1307
+ }
1308
+ function nextIsSemicolonOrEnd(_this__u8e3s4, start) {
1309
+ var position = start + 1 | 0;
1310
+ loop: while (position < _this__u8e3s4.length && charSequenceGet(_this__u8e3s4, position) === _Char___init__impl__6a9atx(32)) {
1311
+ position = position + 1 | 0;
1312
+ }
1313
+ return position === _this__u8e3s4.length || charSequenceGet(_this__u8e3s4, position) === _Char___init__impl__6a9atx(59);
1314
+ }
1315
+ function parseAndSortHeader(header) {
1316
+ // Inline function 'kotlin.collections.sortedByDescending' call
1317
+ var this_0 = parseHeaderValue(header);
1318
+ // Inline function 'kotlin.comparisons.compareByDescending' call
1319
+ var tmp = parseAndSortHeader$lambda;
1320
+ var tmp$ret$0 = new sam$kotlin_Comparator$0(tmp);
1321
+ return sortedWith(this_0, tmp$ret$0);
1322
+ }
1323
+ function sam$kotlin_Comparator$0(function_0) {
1324
+ this.t2g_1 = function_0;
1325
+ }
1326
+ protoOf(sam$kotlin_Comparator$0).mc = function (a, b) {
1327
+ return this.t2g_1(a, b);
1328
+ };
1329
+ protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
1330
+ return this.mc(a, b);
1331
+ };
1332
+ protoOf(sam$kotlin_Comparator$0).o3 = function () {
1333
+ return this.t2g_1;
1334
+ };
1335
+ protoOf(sam$kotlin_Comparator$0).equals = function (other) {
1336
+ var tmp;
1337
+ if (!(other == null) ? isInterface(other, Comparator) : false) {
1338
+ var tmp_0;
1339
+ if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
1340
+ tmp_0 = equals_0(this.o3(), other.o3());
1341
+ } else {
1342
+ tmp_0 = false;
1343
+ }
1344
+ tmp = tmp_0;
1345
+ } else {
1346
+ tmp = false;
1347
+ }
1348
+ return tmp;
1349
+ };
1350
+ protoOf(sam$kotlin_Comparator$0).hashCode = function () {
1351
+ return hashCode(this.o3());
1352
+ };
1353
+ function parseHeaderValueParameter$addParam($parameters, text, start, end, value) {
1354
+ var name = subtrim(text, start, end);
1355
+ // Inline function 'kotlin.text.isEmpty' call
1356
+ if (charSequenceLength(name) === 0) {
1357
+ return Unit_instance;
1358
+ }
1359
+ $parameters.u().e(HeaderValueParam_init_$Create$(name, value));
1360
+ }
1361
+ function parseHeaderValue$lambda() {
1362
+ // Inline function 'kotlin.collections.arrayListOf' call
1363
+ return ArrayList_init_$Create$_0();
1364
+ }
1365
+ function parseHeaderValueItem$lambda() {
1366
+ // Inline function 'kotlin.collections.arrayListOf' call
1367
+ return ArrayList_init_$Create$_0();
1368
+ }
1369
+ function parseAndSortHeader$lambda(a, b) {
1370
+ // Inline function 'kotlin.comparisons.compareValuesBy' call
1371
+ // Inline function 'io.ktor.http.parseAndSortHeader.<anonymous>' call
1372
+ var tmp = b.f2b_1;
1373
+ // Inline function 'io.ktor.http.parseAndSortHeader.<anonymous>' call
1374
+ var tmp$ret$1 = a.f2b_1;
1375
+ return compareValues(tmp, tmp$ret$1);
1376
+ }
1377
+ function HttpHeaders() {
1378
+ HttpHeaders_instance = this;
1379
+ this.v2c_1 = 'Accept';
1380
+ this.w2c_1 = 'Accept-Charset';
1381
+ this.x2c_1 = 'Accept-Encoding';
1382
+ this.y2c_1 = 'Accept-Language';
1383
+ this.z2c_1 = 'Accept-Ranges';
1384
+ this.a2d_1 = 'Age';
1385
+ this.b2d_1 = 'Allow';
1386
+ this.c2d_1 = 'ALPN';
1387
+ this.d2d_1 = 'Authentication-Info';
1388
+ this.e2d_1 = 'Authorization';
1389
+ this.f2d_1 = 'Cache-Control';
1390
+ this.g2d_1 = 'Connection';
1391
+ this.h2d_1 = 'Content-Disposition';
1392
+ this.i2d_1 = 'Content-Encoding';
1393
+ this.j2d_1 = 'Content-Language';
1394
+ this.k2d_1 = 'Content-Length';
1395
+ this.l2d_1 = 'Content-Location';
1396
+ this.m2d_1 = 'Content-Range';
1397
+ this.n2d_1 = 'Content-Type';
1398
+ this.o2d_1 = 'Cookie';
1399
+ this.p2d_1 = 'DASL';
1400
+ this.q2d_1 = 'Date';
1401
+ this.r2d_1 = 'DAV';
1402
+ this.s2d_1 = 'Depth';
1403
+ this.t2d_1 = 'Destination';
1404
+ this.u2d_1 = 'ETag';
1405
+ this.v2d_1 = 'Expect';
1406
+ this.w2d_1 = 'Expires';
1407
+ this.x2d_1 = 'From';
1408
+ this.y2d_1 = 'Forwarded';
1409
+ this.z2d_1 = 'Host';
1410
+ this.a2e_1 = 'HTTP2-Settings';
1411
+ this.b2e_1 = 'If';
1412
+ this.c2e_1 = 'If-Match';
1413
+ this.d2e_1 = 'If-Modified-Since';
1414
+ this.e2e_1 = 'If-None-Match';
1415
+ this.f2e_1 = 'If-Range';
1416
+ this.g2e_1 = 'If-Schedule-Tag-Match';
1417
+ this.h2e_1 = 'If-Unmodified-Since';
1418
+ this.i2e_1 = 'Last-Modified';
1419
+ this.j2e_1 = 'Location';
1420
+ this.k2e_1 = 'Lock-Token';
1421
+ this.l2e_1 = 'Link';
1422
+ this.m2e_1 = 'Max-Forwards';
1423
+ this.n2e_1 = 'MIME-Version';
1424
+ this.o2e_1 = 'Ordering-Type';
1425
+ this.p2e_1 = 'Origin';
1426
+ this.q2e_1 = 'Overwrite';
1427
+ this.r2e_1 = 'Position';
1428
+ this.s2e_1 = 'Pragma';
1429
+ this.t2e_1 = 'Prefer';
1430
+ this.u2e_1 = 'Preference-Applied';
1431
+ this.v2e_1 = 'Proxy-Authenticate';
1432
+ this.w2e_1 = 'Proxy-Authentication-Info';
1433
+ this.x2e_1 = 'Proxy-Authorization';
1434
+ this.y2e_1 = 'Public-Key-Pins';
1435
+ this.z2e_1 = 'Public-Key-Pins-Report-Only';
1436
+ this.a2f_1 = 'Range';
1437
+ this.b2f_1 = 'Referer';
1438
+ this.c2f_1 = 'Retry-After';
1439
+ this.d2f_1 = 'Schedule-Reply';
1440
+ this.e2f_1 = 'Schedule-Tag';
1441
+ this.f2f_1 = 'Sec-WebSocket-Accept';
1442
+ this.g2f_1 = 'Sec-WebSocket-Extensions';
1443
+ this.h2f_1 = 'Sec-WebSocket-Key';
1444
+ this.i2f_1 = 'Sec-WebSocket-Protocol';
1445
+ this.j2f_1 = 'Sec-WebSocket-Version';
1446
+ this.k2f_1 = 'Server';
1447
+ this.l2f_1 = 'Set-Cookie';
1448
+ this.m2f_1 = 'SLUG';
1449
+ this.n2f_1 = 'Strict-Transport-Security';
1450
+ this.o2f_1 = 'TE';
1451
+ this.p2f_1 = 'Timeout';
1452
+ this.q2f_1 = 'Trailer';
1453
+ this.r2f_1 = 'Transfer-Encoding';
1454
+ this.s2f_1 = 'Upgrade';
1455
+ this.t2f_1 = 'User-Agent';
1456
+ this.u2f_1 = 'Vary';
1457
+ this.v2f_1 = 'Via';
1458
+ this.w2f_1 = 'Warning';
1459
+ this.x2f_1 = 'WWW-Authenticate';
1460
+ this.y2f_1 = 'Access-Control-Allow-Origin';
1461
+ this.z2f_1 = 'Access-Control-Allow-Methods';
1462
+ this.a2g_1 = 'Access-Control-Allow-Credentials';
1463
+ this.b2g_1 = 'Access-Control-Allow-Headers';
1464
+ this.c2g_1 = 'Access-Control-Request-Method';
1465
+ this.d2g_1 = 'Access-Control-Request-Headers';
1466
+ this.e2g_1 = 'Access-Control-Expose-Headers';
1467
+ this.f2g_1 = 'Access-Control-Max-Age';
1468
+ this.g2g_1 = 'X-Http-Method-Override';
1469
+ this.h2g_1 = 'X-Forwarded-Host';
1470
+ this.i2g_1 = 'X-Forwarded-Server';
1471
+ this.j2g_1 = 'X-Forwarded-Proto';
1472
+ this.k2g_1 = 'X-Forwarded-For';
1473
+ this.l2g_1 = 'X-Forwarded-Port';
1474
+ this.m2g_1 = 'X-Request-ID';
1475
+ this.n2g_1 = 'X-Correlation-ID';
1476
+ this.o2g_1 = 'X-Total-Count';
1477
+ var tmp = this;
1478
+ // Inline function 'kotlin.arrayOf' call
1479
+ // Inline function 'kotlin.js.unsafeCast' call
1480
+ // Inline function 'kotlin.js.asDynamic' call
1481
+ tmp.p2g_1 = [this.r2f_1, this.s2f_1];
1482
+ this.q2g_1 = asList(this.p2g_1);
1483
+ }
1484
+ protoOf(HttpHeaders).r2g = function (name) {
1485
+ // Inline function 'kotlin.text.forEachIndexed' call
1486
+ var index = 0;
1487
+ var inductionVariable = 0;
1488
+ while (inductionVariable < charSequenceLength(name)) {
1489
+ var item = charSequenceGet(name, inductionVariable);
1490
+ inductionVariable = inductionVariable + 1 | 0;
1491
+ // Inline function 'io.ktor.http.HttpHeaders.checkHeaderName.<anonymous>' call
1492
+ var tmp1 = index;
1493
+ index = tmp1 + 1 | 0;
1494
+ if (Char__compareTo_impl_ypi4mb(item, _Char___init__impl__6a9atx(32)) <= 0 || isDelimiter(item)) {
1495
+ throw new IllegalHeaderNameException(name, tmp1);
1496
+ }
1497
+ }
1498
+ };
1499
+ protoOf(HttpHeaders).s2g = function (value) {
1500
+ // Inline function 'kotlin.text.forEachIndexed' call
1501
+ var index = 0;
1502
+ var inductionVariable = 0;
1503
+ while (inductionVariable < charSequenceLength(value)) {
1504
+ var item = charSequenceGet(value, inductionVariable);
1505
+ inductionVariable = inductionVariable + 1 | 0;
1506
+ // Inline function 'io.ktor.http.HttpHeaders.checkHeaderValue.<anonymous>' call
1507
+ var tmp1 = index;
1508
+ index = tmp1 + 1 | 0;
1509
+ if (Char__compareTo_impl_ypi4mb(item, _Char___init__impl__6a9atx(32)) < 0 && !(item === _Char___init__impl__6a9atx(9))) {
1510
+ throw new IllegalHeaderValueException(value, tmp1);
1511
+ }
1512
+ }
1513
+ };
1514
+ var HttpHeaders_instance;
1515
+ function HttpHeaders_getInstance() {
1516
+ if (HttpHeaders_instance == null)
1517
+ new HttpHeaders();
1518
+ return HttpHeaders_instance;
1519
+ }
1520
+ function isDelimiter(ch) {
1521
+ return contains('"(),/:;<=>?@[\\]{}', ch);
1522
+ }
1523
+ function IllegalHeaderNameException(headerName, position) {
1524
+ var tmp = "Header name '" + headerName + "' contains illegal character '" + toString_0(charSequenceGet(headerName, position)) + "'";
1525
+ // Inline function 'kotlin.code' call
1526
+ var this_0 = charSequenceGet(headerName, position);
1527
+ var tmp$ret$0 = Char__toInt_impl_vasixd(this_0);
1528
+ IllegalArgumentException_init_$Init$(tmp + (' (code ' + (tmp$ret$0 & 255) + ')'), this);
1529
+ captureStack(this, IllegalHeaderNameException);
1530
+ this.u2g_1 = headerName;
1531
+ this.v2g_1 = position;
1532
+ }
1533
+ function IllegalHeaderValueException(headerValue, position) {
1534
+ var tmp = "Header value '" + headerValue + "' contains illegal character '" + toString_0(charSequenceGet(headerValue, position)) + "'";
1535
+ // Inline function 'kotlin.code' call
1536
+ var this_0 = charSequenceGet(headerValue, position);
1537
+ var tmp$ret$0 = Char__toInt_impl_vasixd(this_0);
1538
+ IllegalArgumentException_init_$Init$(tmp + (' (code ' + (tmp$ret$0 & 255) + ')'), this);
1539
+ captureStack(this, IllegalHeaderValueException);
1540
+ this.w2g_1 = headerValue;
1541
+ this.x2g_1 = position;
1542
+ }
1543
+ function UnsafeHeaderException(header) {
1544
+ IllegalArgumentException_init_$Init$('Header(s) ' + header + ' are controlled by the engine and ' + 'cannot be set explicitly', this);
1545
+ captureStack(this, UnsafeHeaderException);
1546
+ }
1547
+ function contentType(_this__u8e3s4) {
1548
+ var tmp0_safe_receiver = _this__u8e3s4.y2g().t25(HttpHeaders_getInstance().n2d_1);
1549
+ var tmp;
1550
+ if (tmp0_safe_receiver == null) {
1551
+ tmp = null;
1552
+ } else {
1553
+ // Inline function 'kotlin.let' call
1554
+ // Inline function 'kotlin.contracts.contract' call
1555
+ // Inline function 'io.ktor.http.contentType.<anonymous>' call
1556
+ tmp = Companion_getInstance().sk(tmp0_safe_receiver);
1557
+ }
1558
+ return tmp;
1559
+ }
1560
+ function contentLength(_this__u8e3s4) {
1561
+ var tmp0_safe_receiver = _this__u8e3s4.y2g().t25(HttpHeaders_getInstance().k2d_1);
1562
+ return tmp0_safe_receiver == null ? null : toLong(tmp0_safe_receiver);
1563
+ }
1564
+ function charset_0(_this__u8e3s4) {
1565
+ var tmp0_safe_receiver = contentType_0(_this__u8e3s4);
1566
+ return tmp0_safe_receiver == null ? null : charset(tmp0_safe_receiver);
1567
+ }
1568
+ function contentType_0(_this__u8e3s4) {
1569
+ var tmp0_safe_receiver = _this__u8e3s4.y2g().t25(HttpHeaders_getInstance().n2d_1);
1570
+ var tmp;
1571
+ if (tmp0_safe_receiver == null) {
1572
+ tmp = null;
1573
+ } else {
1574
+ // Inline function 'kotlin.let' call
1575
+ // Inline function 'kotlin.contracts.contract' call
1576
+ // Inline function 'io.ktor.http.contentType.<anonymous>' call
1577
+ tmp = Companion_getInstance().sk(tmp0_safe_receiver);
1578
+ }
1579
+ return tmp;
1580
+ }
1581
+ function Companion_2() {
1582
+ Companion_instance_3 = this;
1583
+ this.z2g_1 = new HttpMethod('GET');
1584
+ this.a2h_1 = new HttpMethod('POST');
1585
+ this.b2h_1 = new HttpMethod('PUT');
1586
+ this.c2h_1 = new HttpMethod('PATCH');
1587
+ this.d2h_1 = new HttpMethod('DELETE');
1588
+ this.e2h_1 = new HttpMethod('HEAD');
1589
+ this.f2h_1 = new HttpMethod('OPTIONS');
1590
+ this.g2h_1 = listOf([this.z2g_1, this.a2h_1, this.b2h_1, this.c2h_1, this.d2h_1, this.e2h_1, this.f2h_1]);
1591
+ }
1592
+ var Companion_instance_3;
1593
+ function Companion_getInstance_2() {
1594
+ if (Companion_instance_3 == null)
1595
+ new Companion_2();
1596
+ return Companion_instance_3;
1597
+ }
1598
+ function HttpMethod(value) {
1599
+ Companion_getInstance_2();
1600
+ this.h2h_1 = value;
1601
+ }
1602
+ protoOf(HttpMethod).toString = function () {
1603
+ return 'HttpMethod(value=' + this.h2h_1 + ')';
1604
+ };
1605
+ protoOf(HttpMethod).hashCode = function () {
1606
+ return getStringHashCode(this.h2h_1);
1607
+ };
1608
+ protoOf(HttpMethod).equals = function (other) {
1609
+ if (this === other)
1610
+ return true;
1611
+ if (!(other instanceof HttpMethod))
1612
+ return false;
1613
+ var tmp0_other_with_cast = other instanceof HttpMethod ? other : THROW_CCE();
1614
+ if (!(this.h2h_1 === tmp0_other_with_cast.h2h_1))
1615
+ return false;
1616
+ return true;
1617
+ };
1618
+ function Companion_3() {
1619
+ Companion_instance_4 = this;
1620
+ this.i2h_1 = new HttpProtocolVersion('HTTP', 2, 0);
1621
+ this.j2h_1 = new HttpProtocolVersion('HTTP', 1, 1);
1622
+ this.k2h_1 = new HttpProtocolVersion('HTTP', 1, 0);
1623
+ this.l2h_1 = new HttpProtocolVersion('SPDY', 3, 0);
1624
+ this.m2h_1 = new HttpProtocolVersion('QUIC', 1, 0);
1625
+ }
1626
+ var Companion_instance_4;
1627
+ function Companion_getInstance_3() {
1628
+ if (Companion_instance_4 == null)
1629
+ new Companion_3();
1630
+ return Companion_instance_4;
1631
+ }
1632
+ function HttpProtocolVersion(name, major, minor) {
1633
+ Companion_getInstance_3();
1634
+ this.n2h_1 = name;
1635
+ this.o2h_1 = major;
1636
+ this.p2h_1 = minor;
1637
+ }
1638
+ protoOf(HttpProtocolVersion).toString = function () {
1639
+ return this.n2h_1 + '/' + this.o2h_1 + '.' + this.p2h_1;
1640
+ };
1641
+ protoOf(HttpProtocolVersion).hashCode = function () {
1642
+ var result = getStringHashCode(this.n2h_1);
1643
+ result = imul(result, 31) + this.o2h_1 | 0;
1644
+ result = imul(result, 31) + this.p2h_1 | 0;
1645
+ return result;
1646
+ };
1647
+ protoOf(HttpProtocolVersion).equals = function (other) {
1648
+ if (this === other)
1649
+ return true;
1650
+ if (!(other instanceof HttpProtocolVersion))
1651
+ return false;
1652
+ var tmp0_other_with_cast = other instanceof HttpProtocolVersion ? other : THROW_CCE();
1653
+ if (!(this.n2h_1 === tmp0_other_with_cast.n2h_1))
1654
+ return false;
1655
+ if (!(this.o2h_1 === tmp0_other_with_cast.o2h_1))
1656
+ return false;
1657
+ if (!(this.p2h_1 === tmp0_other_with_cast.p2h_1))
1658
+ return false;
1659
+ return true;
1660
+ };
1661
+ function Companion_4() {
1662
+ Companion_instance_5 = this;
1663
+ this.q2h_1 = new HttpStatusCode(100, 'Continue');
1664
+ this.r2h_1 = new HttpStatusCode(101, 'Switching Protocols');
1665
+ this.s2h_1 = new HttpStatusCode(102, 'Processing');
1666
+ this.t2h_1 = new HttpStatusCode(200, 'OK');
1667
+ this.u2h_1 = new HttpStatusCode(201, 'Created');
1668
+ this.v2h_1 = new HttpStatusCode(202, 'Accepted');
1669
+ this.w2h_1 = new HttpStatusCode(203, 'Non-Authoritative Information');
1670
+ this.x2h_1 = new HttpStatusCode(204, 'No Content');
1671
+ this.y2h_1 = new HttpStatusCode(205, 'Reset Content');
1672
+ this.z2h_1 = new HttpStatusCode(206, 'Partial Content');
1673
+ this.a2i_1 = new HttpStatusCode(207, 'Multi-Status');
1674
+ this.b2i_1 = new HttpStatusCode(300, 'Multiple Choices');
1675
+ this.c2i_1 = new HttpStatusCode(301, 'Moved Permanently');
1676
+ this.d2i_1 = new HttpStatusCode(302, 'Found');
1677
+ this.e2i_1 = new HttpStatusCode(303, 'See Other');
1678
+ this.f2i_1 = new HttpStatusCode(304, 'Not Modified');
1679
+ this.g2i_1 = new HttpStatusCode(305, 'Use Proxy');
1680
+ this.h2i_1 = new HttpStatusCode(306, 'Switch Proxy');
1681
+ this.i2i_1 = new HttpStatusCode(307, 'Temporary Redirect');
1682
+ this.j2i_1 = new HttpStatusCode(308, 'Permanent Redirect');
1683
+ this.k2i_1 = new HttpStatusCode(400, 'Bad Request');
1684
+ this.l2i_1 = new HttpStatusCode(401, 'Unauthorized');
1685
+ this.m2i_1 = new HttpStatusCode(402, 'Payment Required');
1686
+ this.n2i_1 = new HttpStatusCode(403, 'Forbidden');
1687
+ this.o2i_1 = new HttpStatusCode(404, 'Not Found');
1688
+ this.p2i_1 = new HttpStatusCode(405, 'Method Not Allowed');
1689
+ this.q2i_1 = new HttpStatusCode(406, 'Not Acceptable');
1690
+ this.r2i_1 = new HttpStatusCode(407, 'Proxy Authentication Required');
1691
+ this.s2i_1 = new HttpStatusCode(408, 'Request Timeout');
1692
+ this.t2i_1 = new HttpStatusCode(409, 'Conflict');
1693
+ this.u2i_1 = new HttpStatusCode(410, 'Gone');
1694
+ this.v2i_1 = new HttpStatusCode(411, 'Length Required');
1695
+ this.w2i_1 = new HttpStatusCode(412, 'Precondition Failed');
1696
+ this.x2i_1 = new HttpStatusCode(413, 'Payload Too Large');
1697
+ this.y2i_1 = new HttpStatusCode(414, 'Request-URI Too Long');
1698
+ this.z2i_1 = new HttpStatusCode(415, 'Unsupported Media Type');
1699
+ this.a2j_1 = new HttpStatusCode(416, 'Requested Range Not Satisfiable');
1700
+ this.b2j_1 = new HttpStatusCode(417, 'Expectation Failed');
1701
+ this.c2j_1 = new HttpStatusCode(422, 'Unprocessable Entity');
1702
+ this.d2j_1 = new HttpStatusCode(423, 'Locked');
1703
+ this.e2j_1 = new HttpStatusCode(424, 'Failed Dependency');
1704
+ this.f2j_1 = new HttpStatusCode(425, 'Too Early');
1705
+ this.g2j_1 = new HttpStatusCode(426, 'Upgrade Required');
1706
+ this.h2j_1 = new HttpStatusCode(429, 'Too Many Requests');
1707
+ this.i2j_1 = new HttpStatusCode(431, 'Request Header Fields Too Large');
1708
+ this.j2j_1 = new HttpStatusCode(500, 'Internal Server Error');
1709
+ this.k2j_1 = new HttpStatusCode(501, 'Not Implemented');
1710
+ this.l2j_1 = new HttpStatusCode(502, 'Bad Gateway');
1711
+ this.m2j_1 = new HttpStatusCode(503, 'Service Unavailable');
1712
+ this.n2j_1 = new HttpStatusCode(504, 'Gateway Timeout');
1713
+ this.o2j_1 = new HttpStatusCode(505, 'HTTP Version Not Supported');
1714
+ this.p2j_1 = new HttpStatusCode(506, 'Variant Also Negotiates');
1715
+ this.q2j_1 = new HttpStatusCode(507, 'Insufficient Storage');
1716
+ this.r2j_1 = allStatusCodes();
1717
+ var tmp = this;
1718
+ // Inline function 'kotlin.collections.associateBy' call
1719
+ var this_0 = this.r2j_1;
1720
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1721
+ // Inline function 'kotlin.collections.associateByTo' call
1722
+ var destination = LinkedHashMap_init_$Create$(capacity);
1723
+ var tmp0_iterator = this_0.j();
1724
+ while (tmp0_iterator.k()) {
1725
+ var element = tmp0_iterator.l();
1726
+ // Inline function 'io.ktor.http.Companion.statusCodesMap.<anonymous>' call
1727
+ var tmp$ret$0 = element.t2j_1;
1728
+ destination.j2(tmp$ret$0, element);
1729
+ }
1730
+ tmp.s2j_1 = destination;
1731
+ }
1732
+ var Companion_instance_5;
1733
+ function Companion_getInstance_4() {
1734
+ if (Companion_instance_5 == null)
1735
+ new Companion_4();
1736
+ return Companion_instance_5;
1737
+ }
1738
+ function HttpStatusCode(value, description) {
1739
+ Companion_getInstance_4();
1740
+ this.t2j_1 = value;
1741
+ this.u2j_1 = description;
1742
+ }
1743
+ protoOf(HttpStatusCode).toString = function () {
1744
+ return '' + this.t2j_1 + ' ' + this.u2j_1;
1745
+ };
1746
+ protoOf(HttpStatusCode).equals = function (other) {
1747
+ var tmp;
1748
+ if (other instanceof HttpStatusCode) {
1749
+ tmp = other.t2j_1 === this.t2j_1;
1750
+ } else {
1751
+ tmp = false;
1752
+ }
1753
+ return tmp;
1754
+ };
1755
+ protoOf(HttpStatusCode).hashCode = function () {
1756
+ return this.t2j_1;
1757
+ };
1758
+ protoOf(HttpStatusCode).v2j = function (other) {
1759
+ return this.t2j_1 - other.t2j_1 | 0;
1760
+ };
1761
+ protoOf(HttpStatusCode).d = function (other) {
1762
+ return this.v2j(other instanceof HttpStatusCode ? other : THROW_CCE());
1763
+ };
1764
+ function allStatusCodes() {
1765
+ return listOf([Companion_getInstance_4().q2h_1, Companion_getInstance_4().r2h_1, Companion_getInstance_4().s2h_1, Companion_getInstance_4().t2h_1, Companion_getInstance_4().u2h_1, Companion_getInstance_4().v2h_1, Companion_getInstance_4().w2h_1, Companion_getInstance_4().x2h_1, Companion_getInstance_4().y2h_1, Companion_getInstance_4().z2h_1, Companion_getInstance_4().a2i_1, Companion_getInstance_4().b2i_1, Companion_getInstance_4().c2i_1, Companion_getInstance_4().d2i_1, Companion_getInstance_4().e2i_1, Companion_getInstance_4().f2i_1, Companion_getInstance_4().g2i_1, Companion_getInstance_4().h2i_1, Companion_getInstance_4().i2i_1, Companion_getInstance_4().j2i_1, Companion_getInstance_4().k2i_1, Companion_getInstance_4().l2i_1, Companion_getInstance_4().m2i_1, Companion_getInstance_4().n2i_1, Companion_getInstance_4().o2i_1, Companion_getInstance_4().p2i_1, Companion_getInstance_4().q2i_1, Companion_getInstance_4().r2i_1, Companion_getInstance_4().s2i_1, Companion_getInstance_4().t2i_1, Companion_getInstance_4().u2i_1, Companion_getInstance_4().v2i_1, Companion_getInstance_4().w2i_1, Companion_getInstance_4().x2i_1, Companion_getInstance_4().y2i_1, Companion_getInstance_4().z2i_1, Companion_getInstance_4().a2j_1, Companion_getInstance_4().b2j_1, Companion_getInstance_4().c2j_1, Companion_getInstance_4().d2j_1, Companion_getInstance_4().e2j_1, Companion_getInstance_4().f2j_1, Companion_getInstance_4().g2j_1, Companion_getInstance_4().h2j_1, Companion_getInstance_4().i2j_1, Companion_getInstance_4().j2j_1, Companion_getInstance_4().k2j_1, Companion_getInstance_4().l2j_1, Companion_getInstance_4().m2j_1, Companion_getInstance_4().n2j_1, Companion_getInstance_4().o2j_1, Companion_getInstance_4().p2j_1, Companion_getInstance_4().q2j_1]);
1766
+ }
1767
+ function Companion_5() {
1768
+ Companion_instance_6 = this;
1769
+ this.w2j_1 = EmptyParameters_instance;
1770
+ }
1771
+ var Companion_instance_6;
1772
+ function Companion_getInstance_5() {
1773
+ if (Companion_instance_6 == null)
1774
+ new Companion_5();
1775
+ return Companion_instance_6;
1776
+ }
1777
+ function Parameters() {
1778
+ }
1779
+ function ParametersBuilder(size) {
1780
+ size = size === VOID ? 8 : size;
1781
+ return new ParametersBuilderImpl(size);
1782
+ }
1783
+ function EmptyParameters() {
1784
+ }
1785
+ protoOf(EmptyParameters).u26 = function () {
1786
+ return true;
1787
+ };
1788
+ protoOf(EmptyParameters).v26 = function (name) {
1789
+ return null;
1790
+ };
1791
+ protoOf(EmptyParameters).w26 = function () {
1792
+ return emptySet();
1793
+ };
1794
+ protoOf(EmptyParameters).x26 = function () {
1795
+ return emptySet();
1796
+ };
1797
+ protoOf(EmptyParameters).p = function () {
1798
+ return true;
1799
+ };
1800
+ protoOf(EmptyParameters).toString = function () {
1801
+ return 'Parameters ' + toString(this.x26());
1802
+ };
1803
+ protoOf(EmptyParameters).equals = function (other) {
1804
+ var tmp;
1805
+ if (!(other == null) ? isInterface(other, Parameters) : false) {
1806
+ tmp = other.p();
1807
+ } else {
1808
+ tmp = false;
1809
+ }
1810
+ return tmp;
1811
+ };
1812
+ var EmptyParameters_instance;
1813
+ function EmptyParameters_getInstance() {
1814
+ return EmptyParameters_instance;
1815
+ }
1816
+ function ParametersBuilderImpl(size) {
1817
+ size = size === VOID ? 8 : size;
1818
+ StringValuesBuilderImpl.call(this, true, size);
1819
+ }
1820
+ protoOf(ParametersBuilderImpl).u1r = function () {
1821
+ return new ParametersImpl(this.a27_1);
1822
+ };
1823
+ function ParametersImpl(values) {
1824
+ values = values === VOID ? emptyMap() : values;
1825
+ StringValuesImpl.call(this, true, values);
1826
+ }
1827
+ protoOf(ParametersImpl).toString = function () {
1828
+ return 'Parameters ' + toString(this.x26());
1829
+ };
1830
+ function parseQueryString(query, startIndex, limit, decode) {
1831
+ startIndex = startIndex === VOID ? 0 : startIndex;
1832
+ limit = limit === VOID ? 1000 : limit;
1833
+ decode = decode === VOID ? true : decode;
1834
+ var tmp;
1835
+ if (startIndex > get_lastIndex_0(query)) {
1836
+ tmp = Companion_getInstance_5().w2j_1;
1837
+ } else {
1838
+ // Inline function 'io.ktor.http.Companion.build' call
1839
+ Companion_getInstance_5();
1840
+ // Inline function 'kotlin.apply' call
1841
+ var this_0 = ParametersBuilder();
1842
+ // Inline function 'kotlin.contracts.contract' call
1843
+ // Inline function 'io.ktor.http.parseQueryString.<anonymous>' call
1844
+ parse(this_0, query, startIndex, limit, decode);
1845
+ tmp = this_0.u1r();
1846
+ }
1847
+ return tmp;
1848
+ }
1849
+ function parse(_this__u8e3s4, query, startIndex, limit, decode) {
1850
+ var count = 0;
1851
+ var nameIndex = startIndex;
1852
+ var equalIndex = -1;
1853
+ var inductionVariable = startIndex;
1854
+ var last = get_lastIndex_0(query);
1855
+ if (inductionVariable <= last)
1856
+ do {
1857
+ var index = inductionVariable;
1858
+ inductionVariable = inductionVariable + 1 | 0;
1859
+ if (count === limit) {
1860
+ return Unit_instance;
1861
+ }
1862
+ var tmp1_subject = charSequenceGet(query, index);
1863
+ if (tmp1_subject === _Char___init__impl__6a9atx(38)) {
1864
+ appendParam(_this__u8e3s4, query, nameIndex, equalIndex, index, decode);
1865
+ nameIndex = index + 1 | 0;
1866
+ equalIndex = -1;
1867
+ count = count + 1 | 0;
1868
+ } else if (tmp1_subject === _Char___init__impl__6a9atx(61)) {
1869
+ if (equalIndex === -1) {
1870
+ equalIndex = index;
1871
+ }
1872
+ }
1873
+ }
1874
+ while (!(index === last));
1875
+ if (count === limit) {
1876
+ return Unit_instance;
1877
+ }
1878
+ appendParam(_this__u8e3s4, query, nameIndex, equalIndex, query.length, decode);
1879
+ }
1880
+ function appendParam(_this__u8e3s4, query, nameIndex, equalIndex, endIndex, decode) {
1881
+ if (equalIndex === -1) {
1882
+ var spaceNameIndex = trimStart(nameIndex, endIndex, query);
1883
+ var spaceEndIndex = trimEnd(spaceNameIndex, endIndex, query);
1884
+ if (spaceEndIndex > spaceNameIndex) {
1885
+ var tmp;
1886
+ if (decode) {
1887
+ tmp = decodeURLQueryComponent(query, spaceNameIndex, spaceEndIndex);
1888
+ } else {
1889
+ // Inline function 'kotlin.text.substring' call
1890
+ // Inline function 'kotlin.js.asDynamic' call
1891
+ tmp = query.substring(spaceNameIndex, spaceEndIndex);
1892
+ }
1893
+ var name = tmp;
1894
+ _this__u8e3s4.c27(name, emptyList());
1895
+ }
1896
+ return Unit_instance;
1897
+ }
1898
+ var spaceNameIndex_0 = trimStart(nameIndex, equalIndex, query);
1899
+ var spaceEqualIndex = trimEnd(spaceNameIndex_0, equalIndex, query);
1900
+ if (spaceEqualIndex > spaceNameIndex_0) {
1901
+ var tmp_0;
1902
+ if (decode) {
1903
+ tmp_0 = decodeURLQueryComponent(query, spaceNameIndex_0, spaceEqualIndex);
1904
+ } else {
1905
+ // Inline function 'kotlin.text.substring' call
1906
+ // Inline function 'kotlin.js.asDynamic' call
1907
+ tmp_0 = query.substring(spaceNameIndex_0, spaceEqualIndex);
1908
+ }
1909
+ var name_0 = tmp_0;
1910
+ var spaceValueIndex = trimStart(equalIndex + 1 | 0, endIndex, query);
1911
+ var spaceEndIndex_0 = trimEnd(spaceValueIndex, endIndex, query);
1912
+ var tmp_1;
1913
+ if (decode) {
1914
+ tmp_1 = decodeURLQueryComponent(query, spaceValueIndex, spaceEndIndex_0, true);
1915
+ } else {
1916
+ // Inline function 'kotlin.text.substring' call
1917
+ // Inline function 'kotlin.js.asDynamic' call
1918
+ tmp_1 = query.substring(spaceValueIndex, spaceEndIndex_0);
1919
+ }
1920
+ var value = tmp_1;
1921
+ _this__u8e3s4.h27(name_0, value);
1922
+ }
1923
+ }
1924
+ function trimStart(start, end, query) {
1925
+ var spaceIndex = start;
1926
+ while (spaceIndex < end && isWhitespace(charSequenceGet(query, spaceIndex))) {
1927
+ spaceIndex = spaceIndex + 1 | 0;
1928
+ }
1929
+ return spaceIndex;
1930
+ }
1931
+ function trimEnd(start, end, text) {
1932
+ var spaceIndex = end;
1933
+ while (spaceIndex > start && isWhitespace(charSequenceGet(text, spaceIndex - 1 | 0))) {
1934
+ spaceIndex = spaceIndex - 1 | 0;
1935
+ }
1936
+ return spaceIndex;
1937
+ }
1938
+ function applyOrigin($this) {
1939
+ var tmp;
1940
+ // Inline function 'kotlin.text.isNotEmpty' call
1941
+ var this_0 = $this.a2k_1;
1942
+ if (charSequenceLength(this_0) > 0) {
1943
+ tmp = true;
1944
+ } else {
1945
+ tmp = $this.z2j_1.j2k_1 === 'file';
1946
+ }
1947
+ if (tmp)
1948
+ return Unit_instance;
1949
+ $this.a2k_1 = Companion_getInstance_6().b2l_1.m2k_1;
1950
+ if ($this.z2j_1.equals(Companion_getInstance_7().c2l_1))
1951
+ $this.z2j_1 = Companion_getInstance_6().b2l_1.l2k_1;
1952
+ if ($this.b2k_1 === 0)
1953
+ $this.b2k_1 = Companion_getInstance_6().b2l_1.n2k_1;
1954
+ }
1955
+ function Companion_6() {
1956
+ Companion_instance_7 = this;
1957
+ this.b2l_1 = Url(get_origin(this));
1958
+ }
1959
+ var Companion_instance_7;
1960
+ function Companion_getInstance_6() {
1961
+ if (Companion_instance_7 == null)
1962
+ new Companion_6();
1963
+ return Companion_instance_7;
1964
+ }
1965
+ function URLBuilder(protocol, host, port, user, password, pathSegments, parameters, fragment, trailingQuery) {
1966
+ Companion_getInstance_6();
1967
+ protocol = protocol === VOID ? Companion_getInstance_7().c2l_1 : protocol;
1968
+ host = host === VOID ? '' : host;
1969
+ port = port === VOID ? 0 : port;
1970
+ user = user === VOID ? null : user;
1971
+ password = password === VOID ? null : password;
1972
+ pathSegments = pathSegments === VOID ? emptyList() : pathSegments;
1973
+ parameters = parameters === VOID ? Companion_getInstance_5().w2j_1 : parameters;
1974
+ fragment = fragment === VOID ? '' : fragment;
1975
+ trailingQuery = trailingQuery === VOID ? false : trailingQuery;
1976
+ this.z2j_1 = protocol;
1977
+ this.a2k_1 = host;
1978
+ this.b2k_1 = port;
1979
+ this.c2k_1 = trailingQuery;
1980
+ var tmp = this;
1981
+ tmp.d2k_1 = user == null ? null : encodeURLParameter(user);
1982
+ var tmp_0 = this;
1983
+ tmp_0.e2k_1 = password == null ? null : encodeURLParameter(password);
1984
+ this.f2k_1 = encodeURLQueryComponent(fragment);
1985
+ var tmp_1 = this;
1986
+ // Inline function 'kotlin.collections.map' call
1987
+ // Inline function 'kotlin.collections.mapTo' call
1988
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(pathSegments, 10));
1989
+ var tmp0_iterator = pathSegments.j();
1990
+ while (tmp0_iterator.k()) {
1991
+ var item = tmp0_iterator.l();
1992
+ // Inline function 'io.ktor.http.URLBuilder.encodedPathSegments.<anonymous>' call
1993
+ var tmp$ret$0 = encodeURLPathPart(item);
1994
+ destination.e(tmp$ret$0);
1995
+ }
1996
+ tmp_1.g2k_1 = destination;
1997
+ this.h2k_1 = encodeParameters(parameters);
1998
+ this.i2k_1 = new UrlDecodedParametersBuilder(this.h2k_1);
1999
+ }
2000
+ protoOf(URLBuilder).i2l = function (value) {
2001
+ var tmp = this;
2002
+ tmp.d2k_1 = value == null ? null : encodeURLParameter(value);
2003
+ };
2004
+ protoOf(URLBuilder).j2l = function () {
2005
+ var tmp0_safe_receiver = this.d2k_1;
2006
+ return tmp0_safe_receiver == null ? null : decodeURLPart(tmp0_safe_receiver);
2007
+ };
2008
+ protoOf(URLBuilder).k2l = function () {
2009
+ var tmp0_safe_receiver = this.e2k_1;
2010
+ return tmp0_safe_receiver == null ? null : decodeURLPart(tmp0_safe_receiver);
2011
+ };
2012
+ protoOf(URLBuilder).l2l = function () {
2013
+ return decodeURLQueryComponent(this.f2k_1);
2014
+ };
2015
+ protoOf(URLBuilder).m2l = function () {
2016
+ // Inline function 'kotlin.collections.map' call
2017
+ var this_0 = this.g2k_1;
2018
+ // Inline function 'kotlin.collections.mapTo' call
2019
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
2020
+ var tmp0_iterator = this_0.j();
2021
+ while (tmp0_iterator.k()) {
2022
+ var item = tmp0_iterator.l();
2023
+ // Inline function 'io.ktor.http.URLBuilder.<get-pathSegments>.<anonymous>' call
2024
+ var tmp$ret$0 = decodeURLPart(item);
2025
+ destination.e(tmp$ret$0);
2026
+ }
2027
+ return destination;
2028
+ };
2029
+ protoOf(URLBuilder).n2l = function (value) {
2030
+ this.h2k_1 = value;
2031
+ this.i2k_1 = new UrlDecodedParametersBuilder(value);
2032
+ };
2033
+ protoOf(URLBuilder).o2l = function () {
2034
+ applyOrigin(this);
2035
+ return appendTo(this, StringBuilder_init_$Create$_0(256)).toString();
2036
+ };
2037
+ protoOf(URLBuilder).toString = function () {
2038
+ return appendTo(this, StringBuilder_init_$Create$_0(256)).toString();
2039
+ };
2040
+ protoOf(URLBuilder).u1r = function () {
2041
+ applyOrigin(this);
2042
+ return new Url_1(this.z2j_1, this.a2k_1, this.b2k_1, this.m2l(), this.i2k_1.u1r(), this.l2l(), this.j2l(), this.k2l(), this.c2k_1, this.o2l());
2043
+ };
2044
+ function get_authority(_this__u8e3s4) {
2045
+ // Inline function 'kotlin.text.buildString' call
2046
+ // Inline function 'kotlin.contracts.contract' call
2047
+ // Inline function 'kotlin.apply' call
2048
+ var this_0 = StringBuilder_init_$Create$();
2049
+ // Inline function 'kotlin.contracts.contract' call
2050
+ // Inline function 'io.ktor.http.<get-authority>.<anonymous>' call
2051
+ this_0.n8(get_encodedUserAndPassword(_this__u8e3s4));
2052
+ this_0.n8(_this__u8e3s4.a2k_1);
2053
+ if (!(_this__u8e3s4.b2k_1 === 0) && !(_this__u8e3s4.b2k_1 === _this__u8e3s4.z2j_1.k2k_1)) {
2054
+ this_0.n8(':');
2055
+ this_0.n8(_this__u8e3s4.b2k_1.toString());
2056
+ }
2057
+ return this_0.toString();
2058
+ }
2059
+ function appendTo(_this__u8e3s4, out) {
2060
+ out.f(_this__u8e3s4.z2j_1.j2k_1);
2061
+ var tmp0_subject = _this__u8e3s4.z2j_1.j2k_1;
2062
+ if (tmp0_subject === 'file') {
2063
+ appendFile(out, _this__u8e3s4.a2k_1, get_encodedPath(_this__u8e3s4));
2064
+ return out;
2065
+ } else if (tmp0_subject === 'mailto') {
2066
+ appendMailto(out, get_encodedUserAndPassword(_this__u8e3s4), _this__u8e3s4.a2k_1);
2067
+ return out;
2068
+ }
2069
+ out.f('://');
2070
+ out.f(get_authority(_this__u8e3s4));
2071
+ appendUrlFullPath(out, get_encodedPath(_this__u8e3s4), _this__u8e3s4.h2k_1, _this__u8e3s4.c2k_1);
2072
+ // Inline function 'kotlin.text.isNotEmpty' call
2073
+ var this_0 = _this__u8e3s4.f2k_1;
2074
+ if (charSequenceLength(this_0) > 0) {
2075
+ out.o8(_Char___init__impl__6a9atx(35));
2076
+ out.f(_this__u8e3s4.f2k_1);
2077
+ }
2078
+ return out;
2079
+ }
2080
+ function get_encodedUserAndPassword(_this__u8e3s4) {
2081
+ // Inline function 'kotlin.text.buildString' call
2082
+ // Inline function 'kotlin.contracts.contract' call
2083
+ // Inline function 'kotlin.apply' call
2084
+ var this_0 = StringBuilder_init_$Create$();
2085
+ // Inline function 'kotlin.contracts.contract' call
2086
+ // Inline function 'io.ktor.http.<get-encodedUserAndPassword>.<anonymous>' call
2087
+ appendUserAndPassword(this_0, _this__u8e3s4.d2k_1, _this__u8e3s4.e2k_1);
2088
+ return this_0.toString();
2089
+ }
2090
+ function appendFile(_this__u8e3s4, host, encodedPath) {
2091
+ _this__u8e3s4.f('://');
2092
+ _this__u8e3s4.f(host);
2093
+ if (!startsWith(encodedPath, _Char___init__impl__6a9atx(47))) {
2094
+ _this__u8e3s4.o8(_Char___init__impl__6a9atx(47));
2095
+ }
2096
+ _this__u8e3s4.f(encodedPath);
2097
+ }
2098
+ function set_encodedPath(_this__u8e3s4, value) {
2099
+ _this__u8e3s4.g2k_1 = isBlank(value) ? emptyList() : value === '/' ? get_ROOT_PATH() : toMutableList(split(value, charArrayOf([_Char___init__impl__6a9atx(47)])));
2100
+ }
2101
+ function get_encodedPath(_this__u8e3s4) {
2102
+ return joinPath(_this__u8e3s4.g2k_1);
2103
+ }
2104
+ function appendMailto(_this__u8e3s4, encodedUser, host) {
2105
+ _this__u8e3s4.f(':');
2106
+ _this__u8e3s4.f(encodedUser);
2107
+ _this__u8e3s4.f(host);
2108
+ }
2109
+ function joinPath(_this__u8e3s4) {
2110
+ if (_this__u8e3s4.p())
2111
+ return '';
2112
+ if (_this__u8e3s4.m() === 1) {
2113
+ // Inline function 'kotlin.text.isEmpty' call
2114
+ var this_0 = first_0(_this__u8e3s4);
2115
+ if (charSequenceLength(this_0) === 0)
2116
+ return '/';
2117
+ return first_0(_this__u8e3s4);
2118
+ }
2119
+ return joinToString(_this__u8e3s4, '/');
2120
+ }
2121
+ function get_ROOT_PATH() {
2122
+ _init_properties_URLParser_kt__sf11to();
2123
+ return ROOT_PATH;
2124
+ }
2125
+ var ROOT_PATH;
2126
+ function takeFrom(_this__u8e3s4, urlString) {
2127
+ _init_properties_URLParser_kt__sf11to();
2128
+ if (isBlank(urlString))
2129
+ return _this__u8e3s4;
2130
+ var tmp;
2131
+ try {
2132
+ tmp = takeFromUnsafe(_this__u8e3s4, urlString);
2133
+ } catch ($p) {
2134
+ var tmp_0;
2135
+ if ($p instanceof Error) {
2136
+ var cause = $p;
2137
+ throw new URLParserException(urlString, cause);
2138
+ } else {
2139
+ throw $p;
2140
+ }
2141
+ }
2142
+ return tmp;
2143
+ }
2144
+ function takeFromUnsafe(_this__u8e3s4, urlString) {
2145
+ _init_properties_URLParser_kt__sf11to();
2146
+ var tmp$ret$1;
2147
+ $l$block: {
2148
+ // Inline function 'kotlin.text.indexOfFirst' call
2149
+ var inductionVariable = 0;
2150
+ var last = charSequenceLength(urlString) - 1 | 0;
2151
+ if (inductionVariable <= last)
2152
+ do {
2153
+ var index = inductionVariable;
2154
+ inductionVariable = inductionVariable + 1 | 0;
2155
+ // Inline function 'io.ktor.http.takeFromUnsafe.<anonymous>' call
2156
+ var it = charSequenceGet(urlString, index);
2157
+ if (!isWhitespace(it)) {
2158
+ tmp$ret$1 = index;
2159
+ break $l$block;
2160
+ }
2161
+ }
2162
+ while (inductionVariable <= last);
2163
+ tmp$ret$1 = -1;
2164
+ }
2165
+ var startIndex = tmp$ret$1;
2166
+ var tmp$ret$3;
2167
+ $l$block_0: {
2168
+ // Inline function 'kotlin.text.indexOfLast' call
2169
+ var inductionVariable_0 = charSequenceLength(urlString) - 1 | 0;
2170
+ if (0 <= inductionVariable_0)
2171
+ do {
2172
+ var index_0 = inductionVariable_0;
2173
+ inductionVariable_0 = inductionVariable_0 + -1 | 0;
2174
+ // Inline function 'io.ktor.http.takeFromUnsafe.<anonymous>' call
2175
+ var it_0 = charSequenceGet(urlString, index_0);
2176
+ if (!isWhitespace(it_0)) {
2177
+ tmp$ret$3 = index_0;
2178
+ break $l$block_0;
2179
+ }
2180
+ }
2181
+ while (0 <= inductionVariable_0);
2182
+ tmp$ret$3 = -1;
2183
+ }
2184
+ var endIndex = tmp$ret$3 + 1 | 0;
2185
+ var schemeLength = findScheme(urlString, startIndex, endIndex);
2186
+ if (schemeLength > 0) {
2187
+ // Inline function 'kotlin.text.substring' call
2188
+ var startIndex_0 = startIndex;
2189
+ var endIndex_0 = startIndex + schemeLength | 0;
2190
+ // Inline function 'kotlin.js.asDynamic' call
2191
+ var scheme = urlString.substring(startIndex_0, endIndex_0);
2192
+ _this__u8e3s4.z2j_1 = Companion_getInstance_7().p2l(scheme);
2193
+ startIndex = startIndex + (schemeLength + 1 | 0) | 0;
2194
+ }
2195
+ var slashCount = count(urlString, startIndex, endIndex, _Char___init__impl__6a9atx(47));
2196
+ startIndex = startIndex + slashCount | 0;
2197
+ if (_this__u8e3s4.z2j_1.j2k_1 === 'file') {
2198
+ parseFile(_this__u8e3s4, urlString, startIndex, endIndex, slashCount);
2199
+ return _this__u8e3s4;
2200
+ }
2201
+ if (_this__u8e3s4.z2j_1.j2k_1 === 'mailto') {
2202
+ // Inline function 'kotlin.require' call
2203
+ // Inline function 'kotlin.contracts.contract' call
2204
+ // Inline function 'kotlin.require' call
2205
+ // Inline function 'kotlin.contracts.contract' call
2206
+ if (!(slashCount === 0)) {
2207
+ // Inline function 'kotlin.require.<anonymous>' call
2208
+ var message = 'Failed requirement.';
2209
+ throw IllegalArgumentException_init_$Create$(toString(message));
2210
+ }
2211
+ parseMailto(_this__u8e3s4, urlString, startIndex, endIndex);
2212
+ return _this__u8e3s4;
2213
+ }
2214
+ if (slashCount >= 2) {
2215
+ loop: while (true) {
2216
+ // Inline function 'kotlin.takeIf' call
2217
+ var this_0 = indexOfAny(urlString, toCharArray('@/\\?#'), startIndex);
2218
+ // Inline function 'kotlin.contracts.contract' call
2219
+ var tmp;
2220
+ // Inline function 'io.ktor.http.takeFromUnsafe.<anonymous>' call
2221
+ if (this_0 > 0) {
2222
+ tmp = this_0;
2223
+ } else {
2224
+ tmp = null;
2225
+ }
2226
+ var tmp0_elvis_lhs = tmp;
2227
+ var delimiter = tmp0_elvis_lhs == null ? endIndex : tmp0_elvis_lhs;
2228
+ if (delimiter < endIndex && charSequenceGet(urlString, delimiter) === _Char___init__impl__6a9atx(64)) {
2229
+ var passwordIndex = indexOfColonInHostPort(urlString, startIndex, delimiter);
2230
+ if (!(passwordIndex === -1)) {
2231
+ var tmp_0 = _this__u8e3s4;
2232
+ // Inline function 'kotlin.text.substring' call
2233
+ var startIndex_1 = startIndex;
2234
+ // Inline function 'kotlin.js.asDynamic' call
2235
+ tmp_0.d2k_1 = urlString.substring(startIndex_1, passwordIndex);
2236
+ var tmp_1 = _this__u8e3s4;
2237
+ // Inline function 'kotlin.text.substring' call
2238
+ var startIndex_2 = passwordIndex + 1 | 0;
2239
+ // Inline function 'kotlin.js.asDynamic' call
2240
+ tmp_1.e2k_1 = urlString.substring(startIndex_2, delimiter);
2241
+ } else {
2242
+ var tmp_2 = _this__u8e3s4;
2243
+ // Inline function 'kotlin.text.substring' call
2244
+ var startIndex_3 = startIndex;
2245
+ // Inline function 'kotlin.js.asDynamic' call
2246
+ tmp_2.d2k_1 = urlString.substring(startIndex_3, delimiter);
2247
+ }
2248
+ startIndex = delimiter + 1 | 0;
2249
+ } else {
2250
+ fillHost(_this__u8e3s4, urlString, startIndex, delimiter);
2251
+ startIndex = delimiter;
2252
+ break loop;
2253
+ }
2254
+ }
2255
+ }
2256
+ if (startIndex >= endIndex) {
2257
+ _this__u8e3s4.g2k_1 = charSequenceGet(urlString, endIndex - 1 | 0) === _Char___init__impl__6a9atx(47) ? get_ROOT_PATH() : emptyList();
2258
+ return _this__u8e3s4;
2259
+ }
2260
+ var tmp_3 = _this__u8e3s4;
2261
+ var tmp_4;
2262
+ if (slashCount === 0) {
2263
+ tmp_4 = dropLast(_this__u8e3s4.g2k_1, 1);
2264
+ } else {
2265
+ tmp_4 = emptyList();
2266
+ }
2267
+ tmp_3.g2k_1 = tmp_4;
2268
+ // Inline function 'kotlin.takeIf' call
2269
+ var this_1 = indexOfAny(urlString, toCharArray('?#'), startIndex);
2270
+ // Inline function 'kotlin.contracts.contract' call
2271
+ var tmp_5;
2272
+ // Inline function 'io.ktor.http.takeFromUnsafe.<anonymous>' call
2273
+ if (this_1 > 0) {
2274
+ tmp_5 = this_1;
2275
+ } else {
2276
+ tmp_5 = null;
2277
+ }
2278
+ var tmp1_elvis_lhs = tmp_5;
2279
+ var pathEnd = tmp1_elvis_lhs == null ? endIndex : tmp1_elvis_lhs;
2280
+ if (pathEnd > startIndex) {
2281
+ // Inline function 'kotlin.text.substring' call
2282
+ var startIndex_4 = startIndex;
2283
+ // Inline function 'kotlin.js.asDynamic' call
2284
+ var rawPath = urlString.substring(startIndex_4, pathEnd);
2285
+ var tmp_6;
2286
+ var tmp_7;
2287
+ if (_this__u8e3s4.g2k_1.m() === 1) {
2288
+ // Inline function 'kotlin.text.isEmpty' call
2289
+ var this_2 = first_0(_this__u8e3s4.g2k_1);
2290
+ tmp_7 = charSequenceLength(this_2) === 0;
2291
+ } else {
2292
+ tmp_7 = false;
2293
+ }
2294
+ if (tmp_7) {
2295
+ tmp_6 = emptyList();
2296
+ } else {
2297
+ tmp_6 = _this__u8e3s4.g2k_1;
2298
+ }
2299
+ var basePath = tmp_6;
2300
+ var rawChunks = rawPath === '/' ? get_ROOT_PATH() : split(rawPath, charArrayOf([_Char___init__impl__6a9atx(47)]));
2301
+ var relativePath = plus_0(slashCount === 1 ? get_ROOT_PATH() : emptyList(), rawChunks);
2302
+ _this__u8e3s4.g2k_1 = plus_0(basePath, relativePath);
2303
+ startIndex = pathEnd;
2304
+ }
2305
+ if (startIndex < endIndex && charSequenceGet(urlString, startIndex) === _Char___init__impl__6a9atx(63)) {
2306
+ startIndex = parseQuery(_this__u8e3s4, urlString, startIndex, endIndex);
2307
+ }
2308
+ parseFragment(_this__u8e3s4, urlString, startIndex, endIndex);
2309
+ return _this__u8e3s4;
2310
+ }
2311
+ function URLParserException(urlString, cause) {
2312
+ IllegalStateException_init_$Init$('Fail to parse url: ' + urlString, cause, this);
2313
+ captureStack(this, URLParserException);
2314
+ }
2315
+ function findScheme(urlString, startIndex, endIndex) {
2316
+ _init_properties_URLParser_kt__sf11to();
2317
+ var current = startIndex;
2318
+ var incorrectSchemePosition = -1;
2319
+ var firstChar = charSequenceGet(urlString, current);
2320
+ 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)) {
2321
+ incorrectSchemePosition = current;
2322
+ }
2323
+ while (current < endIndex) {
2324
+ var char = charSequenceGet(urlString, current);
2325
+ if (char === _Char___init__impl__6a9atx(58)) {
2326
+ if (!(incorrectSchemePosition === -1)) {
2327
+ throw IllegalArgumentException_init_$Create$('Illegal character in scheme at position ' + incorrectSchemePosition);
2328
+ }
2329
+ return current - startIndex | 0;
2330
+ }
2331
+ if (char === _Char___init__impl__6a9atx(47) || char === _Char___init__impl__6a9atx(63) || char === _Char___init__impl__6a9atx(35))
2332
+ return -1;
2333
+ 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))) {
2334
+ incorrectSchemePosition = current;
2335
+ }
2336
+ current = current + 1 | 0;
2337
+ }
2338
+ return -1;
2339
+ }
2340
+ function count(urlString, startIndex, endIndex, char) {
2341
+ _init_properties_URLParser_kt__sf11to();
2342
+ var result = 0;
2343
+ $l$loop: while ((startIndex + result | 0) < endIndex && charSequenceGet(urlString, startIndex + result | 0) === char) {
2344
+ result = result + 1 | 0;
2345
+ }
2346
+ return result;
2347
+ }
2348
+ function parseFile(_this__u8e3s4, urlString, startIndex, endIndex, slashCount) {
2349
+ _init_properties_URLParser_kt__sf11to();
2350
+ switch (slashCount) {
2351
+ case 2:
2352
+ var nextSlash = indexOf(urlString, _Char___init__impl__6a9atx(47), startIndex);
2353
+ if (nextSlash === -1 || nextSlash === endIndex) {
2354
+ var tmp = _this__u8e3s4;
2355
+ // Inline function 'kotlin.text.substring' call
2356
+ // Inline function 'kotlin.js.asDynamic' call
2357
+ tmp.a2k_1 = urlString.substring(startIndex, endIndex);
2358
+ return Unit_instance;
2359
+ }
2360
+
2361
+ var tmp_0 = _this__u8e3s4;
2362
+ // Inline function 'kotlin.text.substring' call
2363
+
2364
+ // Inline function 'kotlin.js.asDynamic' call
2365
+
2366
+ tmp_0.a2k_1 = urlString.substring(startIndex, nextSlash);
2367
+ // Inline function 'kotlin.text.substring' call
2368
+
2369
+ // Inline function 'kotlin.js.asDynamic' call
2370
+
2371
+ var tmp$ret$5 = urlString.substring(nextSlash, endIndex);
2372
+ set_encodedPath(_this__u8e3s4, tmp$ret$5);
2373
+ break;
2374
+ case 3:
2375
+ _this__u8e3s4.a2k_1 = '';
2376
+ // Inline function 'kotlin.text.substring' call
2377
+
2378
+ // Inline function 'kotlin.js.asDynamic' call
2379
+
2380
+ var tmp$ret$7 = urlString.substring(startIndex, endIndex);
2381
+ set_encodedPath(_this__u8e3s4, '/' + tmp$ret$7);
2382
+ break;
2383
+ default:
2384
+ throw IllegalArgumentException_init_$Create$('Invalid file url: ' + urlString);
2385
+ }
2386
+ }
2387
+ function parseMailto(_this__u8e3s4, urlString, startIndex, endIndex) {
2388
+ _init_properties_URLParser_kt__sf11to();
2389
+ var delimiter = indexOf_0(urlString, '@', startIndex);
2390
+ if (delimiter === -1) {
2391
+ throw IllegalArgumentException_init_$Create$('Invalid mailto url: ' + urlString + ", it should contain '@'.");
2392
+ }
2393
+ // Inline function 'kotlin.text.substring' call
2394
+ // Inline function 'kotlin.js.asDynamic' call
2395
+ var tmp$ret$1 = urlString.substring(startIndex, delimiter);
2396
+ _this__u8e3s4.i2l(decodeURLPart(tmp$ret$1));
2397
+ var tmp = _this__u8e3s4;
2398
+ // Inline function 'kotlin.text.substring' call
2399
+ var startIndex_0 = delimiter + 1 | 0;
2400
+ // Inline function 'kotlin.js.asDynamic' call
2401
+ tmp.a2k_1 = urlString.substring(startIndex_0, endIndex);
2402
+ }
2403
+ function indexOfColonInHostPort(_this__u8e3s4, startIndex, endIndex) {
2404
+ _init_properties_URLParser_kt__sf11to();
2405
+ var skip = false;
2406
+ var inductionVariable = startIndex;
2407
+ if (inductionVariable < endIndex)
2408
+ do {
2409
+ var index = inductionVariable;
2410
+ inductionVariable = inductionVariable + 1 | 0;
2411
+ var tmp1_subject = charSequenceGet(_this__u8e3s4, index);
2412
+ if (tmp1_subject === _Char___init__impl__6a9atx(91))
2413
+ skip = true;
2414
+ else if (tmp1_subject === _Char___init__impl__6a9atx(93))
2415
+ skip = false;
2416
+ else if (tmp1_subject === _Char___init__impl__6a9atx(58))
2417
+ if (!skip)
2418
+ return index;
2419
+ }
2420
+ while (inductionVariable < endIndex);
2421
+ return -1;
2422
+ }
2423
+ function fillHost(_this__u8e3s4, urlString, startIndex, endIndex) {
2424
+ _init_properties_URLParser_kt__sf11to();
2425
+ // Inline function 'kotlin.takeIf' call
2426
+ var this_0 = indexOfColonInHostPort(urlString, startIndex, endIndex);
2427
+ // Inline function 'kotlin.contracts.contract' call
2428
+ var tmp;
2429
+ // Inline function 'io.ktor.http.fillHost.<anonymous>' call
2430
+ if (this_0 > 0) {
2431
+ tmp = this_0;
2432
+ } else {
2433
+ tmp = null;
2434
+ }
2435
+ var tmp0_elvis_lhs = tmp;
2436
+ var colonIndex = tmp0_elvis_lhs == null ? endIndex : tmp0_elvis_lhs;
2437
+ var tmp_0 = _this__u8e3s4;
2438
+ // Inline function 'kotlin.text.substring' call
2439
+ // Inline function 'kotlin.js.asDynamic' call
2440
+ tmp_0.a2k_1 = urlString.substring(startIndex, colonIndex);
2441
+ if ((colonIndex + 1 | 0) < endIndex) {
2442
+ var tmp_1 = _this__u8e3s4;
2443
+ // Inline function 'kotlin.text.substring' call
2444
+ var startIndex_0 = colonIndex + 1 | 0;
2445
+ // Inline function 'kotlin.js.asDynamic' call
2446
+ var tmp$ret$5 = urlString.substring(startIndex_0, endIndex);
2447
+ tmp_1.b2k_1 = toInt(tmp$ret$5);
2448
+ } else {
2449
+ _this__u8e3s4.b2k_1 = 0;
2450
+ }
2451
+ }
2452
+ function parseQuery(_this__u8e3s4, urlString, startIndex, endIndex) {
2453
+ _init_properties_URLParser_kt__sf11to();
2454
+ if ((startIndex + 1 | 0) === endIndex) {
2455
+ _this__u8e3s4.c2k_1 = true;
2456
+ return endIndex;
2457
+ }
2458
+ // Inline function 'kotlin.takeIf' call
2459
+ var this_0 = indexOf(urlString, _Char___init__impl__6a9atx(35), startIndex + 1 | 0);
2460
+ // Inline function 'kotlin.contracts.contract' call
2461
+ var tmp;
2462
+ // Inline function 'io.ktor.http.parseQuery.<anonymous>' call
2463
+ if (this_0 > 0) {
2464
+ tmp = this_0;
2465
+ } else {
2466
+ tmp = null;
2467
+ }
2468
+ var tmp0_elvis_lhs = tmp;
2469
+ var fragmentStart = tmp0_elvis_lhs == null ? endIndex : tmp0_elvis_lhs;
2470
+ // Inline function 'kotlin.text.substring' call
2471
+ var startIndex_0 = startIndex + 1 | 0;
2472
+ // Inline function 'kotlin.js.asDynamic' call
2473
+ var tmp$ret$3 = urlString.substring(startIndex_0, fragmentStart);
2474
+ var rawParameters = parseQueryString(tmp$ret$3, VOID, VOID, false);
2475
+ rawParameters.y26(parseQuery$lambda(_this__u8e3s4));
2476
+ return fragmentStart;
2477
+ }
2478
+ function parseFragment(_this__u8e3s4, urlString, startIndex, endIndex) {
2479
+ _init_properties_URLParser_kt__sf11to();
2480
+ if (startIndex < endIndex && charSequenceGet(urlString, startIndex) === _Char___init__impl__6a9atx(35)) {
2481
+ var tmp = _this__u8e3s4;
2482
+ // Inline function 'kotlin.text.substring' call
2483
+ var startIndex_0 = startIndex + 1 | 0;
2484
+ // Inline function 'kotlin.js.asDynamic' call
2485
+ tmp.f2k_1 = urlString.substring(startIndex_0, endIndex);
2486
+ }
2487
+ }
2488
+ function parseQuery$lambda($this_parseQuery) {
2489
+ return function (key, values) {
2490
+ $this_parseQuery.h2k_1.c27(key, values);
2491
+ return Unit_instance;
2492
+ };
2493
+ }
2494
+ var properties_initialized_URLParser_kt_hd1g6a;
2495
+ function _init_properties_URLParser_kt__sf11to() {
2496
+ if (!properties_initialized_URLParser_kt_hd1g6a) {
2497
+ properties_initialized_URLParser_kt_hd1g6a = true;
2498
+ ROOT_PATH = listOf_0('');
2499
+ }
2500
+ }
2501
+ function isWebsocket(_this__u8e3s4) {
2502
+ return _this__u8e3s4.j2k_1 === 'ws' || _this__u8e3s4.j2k_1 === 'wss';
2503
+ }
2504
+ function Companion_7() {
2505
+ Companion_instance_8 = this;
2506
+ this.c2l_1 = new URLProtocol('http', 80);
2507
+ this.d2l_1 = new URLProtocol('https', 443);
2508
+ this.e2l_1 = new URLProtocol('ws', 80);
2509
+ this.f2l_1 = new URLProtocol('wss', 443);
2510
+ this.g2l_1 = new URLProtocol('socks', 1080);
2511
+ var tmp = this;
2512
+ // Inline function 'kotlin.collections.associateBy' call
2513
+ var this_0 = listOf([this.c2l_1, this.d2l_1, this.e2l_1, this.f2l_1, this.g2l_1]);
2514
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
2515
+ // Inline function 'kotlin.collections.associateByTo' call
2516
+ var destination = LinkedHashMap_init_$Create$(capacity);
2517
+ var tmp0_iterator = this_0.j();
2518
+ while (tmp0_iterator.k()) {
2519
+ var element = tmp0_iterator.l();
2520
+ // Inline function 'io.ktor.http.Companion.byName.<anonymous>' call
2521
+ var tmp$ret$0 = element.j2k_1;
2522
+ destination.j2(tmp$ret$0, element);
2523
+ }
2524
+ tmp.h2l_1 = destination;
2525
+ }
2526
+ protoOf(Companion_7).p2l = function (name) {
2527
+ // Inline function 'kotlin.let' call
2528
+ // Inline function 'kotlin.contracts.contract' call
2529
+ // Inline function 'io.ktor.http.Companion.createOrDefault.<anonymous>' call
2530
+ var it = toLowerCasePreservingASCIIRules(name);
2531
+ var tmp0_elvis_lhs = Companion_getInstance_7().h2l_1.g2(it);
2532
+ return tmp0_elvis_lhs == null ? new URLProtocol(it, 0) : tmp0_elvis_lhs;
2533
+ };
2534
+ var Companion_instance_8;
2535
+ function Companion_getInstance_7() {
2536
+ if (Companion_instance_8 == null)
2537
+ new Companion_7();
2538
+ return Companion_instance_8;
2539
+ }
2540
+ function URLProtocol(name, defaultPort) {
2541
+ Companion_getInstance_7();
2542
+ this.j2k_1 = name;
2543
+ this.k2k_1 = defaultPort;
2544
+ // Inline function 'kotlin.require' call
2545
+ var tmp$ret$1;
2546
+ $l$block: {
2547
+ // Inline function 'kotlin.text.all' call
2548
+ var indexedObject = this.j2k_1;
2549
+ var inductionVariable = 0;
2550
+ while (inductionVariable < charSequenceLength(indexedObject)) {
2551
+ var element = charSequenceGet(indexedObject, inductionVariable);
2552
+ inductionVariable = inductionVariable + 1 | 0;
2553
+ // Inline function 'io.ktor.http.URLProtocol.<anonymous>' call
2554
+ if (!isLowerCase(element)) {
2555
+ tmp$ret$1 = false;
2556
+ break $l$block;
2557
+ }
2558
+ }
2559
+ tmp$ret$1 = true;
2560
+ }
2561
+ // Inline function 'kotlin.contracts.contract' call
2562
+ if (!tmp$ret$1) {
2563
+ // Inline function 'io.ktor.http.URLProtocol.<anonymous>' call
2564
+ var message = 'All characters should be lower case';
2565
+ throw IllegalArgumentException_init_$Create$(toString(message));
2566
+ }
2567
+ }
2568
+ protoOf(URLProtocol).toString = function () {
2569
+ return 'URLProtocol(name=' + this.j2k_1 + ', defaultPort=' + this.k2k_1 + ')';
2570
+ };
2571
+ protoOf(URLProtocol).hashCode = function () {
2572
+ var result = getStringHashCode(this.j2k_1);
2573
+ result = imul(result, 31) + this.k2k_1 | 0;
2574
+ return result;
2575
+ };
2576
+ protoOf(URLProtocol).equals = function (other) {
2577
+ if (this === other)
2578
+ return true;
2579
+ if (!(other instanceof URLProtocol))
2580
+ return false;
2581
+ var tmp0_other_with_cast = other instanceof URLProtocol ? other : THROW_CCE();
2582
+ if (!(this.j2k_1 === tmp0_other_with_cast.j2k_1))
2583
+ return false;
2584
+ if (!(this.k2k_1 === tmp0_other_with_cast.k2k_1))
2585
+ return false;
2586
+ return true;
2587
+ };
2588
+ function isSecure(_this__u8e3s4) {
2589
+ return _this__u8e3s4.j2k_1 === 'https' || _this__u8e3s4.j2k_1 === 'wss';
2590
+ }
2591
+ function takeFrom_0(_this__u8e3s4, url) {
2592
+ _this__u8e3s4.z2j_1 = url.z2j_1;
2593
+ _this__u8e3s4.a2k_1 = url.a2k_1;
2594
+ _this__u8e3s4.b2k_1 = url.b2k_1;
2595
+ _this__u8e3s4.g2k_1 = url.g2k_1;
2596
+ _this__u8e3s4.d2k_1 = url.d2k_1;
2597
+ _this__u8e3s4.e2k_1 = url.e2k_1;
2598
+ // Inline function 'kotlin.apply' call
2599
+ var this_0 = ParametersBuilder();
2600
+ // Inline function 'kotlin.contracts.contract' call
2601
+ // Inline function 'io.ktor.http.takeFrom.<anonymous>' call
2602
+ appendAll(this_0, url.h2k_1);
2603
+ _this__u8e3s4.n2l(this_0);
2604
+ _this__u8e3s4.f2k_1 = url.f2k_1;
2605
+ _this__u8e3s4.c2k_1 = url.c2k_1;
2606
+ return _this__u8e3s4;
2607
+ }
2608
+ function Url(urlString) {
2609
+ return URLBuilder_0(urlString).u1r();
2610
+ }
2611
+ function appendUrlFullPath(_this__u8e3s4, encodedPath, encodedQueryParameters, trailingQuery) {
2612
+ var tmp;
2613
+ // Inline function 'kotlin.text.isNotBlank' call
2614
+ if (!isBlank(encodedPath)) {
2615
+ tmp = !startsWith_0(encodedPath, '/');
2616
+ } else {
2617
+ tmp = false;
2618
+ }
2619
+ if (tmp) {
2620
+ _this__u8e3s4.o8(_Char___init__impl__6a9atx(47));
2621
+ }
2622
+ _this__u8e3s4.f(encodedPath);
2623
+ if (!encodedQueryParameters.p() || trailingQuery) {
2624
+ _this__u8e3s4.f('?');
2625
+ }
2626
+ // Inline function 'kotlin.collections.flatMap' call
2627
+ // Inline function 'kotlin.collections.flatMapTo' call
2628
+ var this_0 = encodedQueryParameters.x26();
2629
+ var destination = ArrayList_init_$Create$_0();
2630
+ var tmp0_iterator = this_0.j();
2631
+ while (tmp0_iterator.k()) {
2632
+ var element = tmp0_iterator.l();
2633
+ // Inline function 'io.ktor.http.appendUrlFullPath.<anonymous>' call
2634
+ // Inline function 'kotlin.collections.component1' call
2635
+ var key = element.t();
2636
+ // Inline function 'kotlin.collections.component2' call
2637
+ var value = element.u();
2638
+ var tmp_0;
2639
+ if (value.p()) {
2640
+ tmp_0 = listOf_0(to(key, null));
2641
+ } else {
2642
+ // Inline function 'kotlin.collections.map' call
2643
+ // Inline function 'kotlin.collections.mapTo' call
2644
+ var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(value, 10));
2645
+ var tmp0_iterator_0 = value.j();
2646
+ while (tmp0_iterator_0.k()) {
2647
+ var item = tmp0_iterator_0.l();
2648
+ // Inline function 'io.ktor.http.appendUrlFullPath.<anonymous>.<anonymous>' call
2649
+ var tmp$ret$3 = to(key, item);
2650
+ destination_0.e(tmp$ret$3);
2651
+ }
2652
+ tmp_0 = destination_0;
2653
+ }
2654
+ var list = tmp_0;
2655
+ addAll(destination, list);
2656
+ }
2657
+ var tmp_1 = destination;
2658
+ joinTo(tmp_1, _this__u8e3s4, '&', VOID, VOID, VOID, VOID, appendUrlFullPath$lambda);
2659
+ }
2660
+ function appendUserAndPassword(_this__u8e3s4, encodedUser, encodedPassword) {
2661
+ if (encodedUser == null) {
2662
+ return Unit_instance;
2663
+ }
2664
+ _this__u8e3s4.n8(encodedUser);
2665
+ if (!(encodedPassword == null)) {
2666
+ _this__u8e3s4.o8(_Char___init__impl__6a9atx(58));
2667
+ _this__u8e3s4.n8(encodedPassword);
2668
+ }
2669
+ _this__u8e3s4.n8('@');
2670
+ }
2671
+ function get_hostWithPort(_this__u8e3s4) {
2672
+ return _this__u8e3s4.m2k_1 + ':' + _this__u8e3s4.q2l();
2673
+ }
2674
+ function URLBuilder_0(urlString) {
2675
+ return takeFrom(new URLBuilder(), urlString);
2676
+ }
2677
+ function URLBuilder_1(url) {
2678
+ return takeFrom_1(new URLBuilder(), url);
2679
+ }
2680
+ function Url_0(builder) {
2681
+ return takeFrom_0(new URLBuilder(), builder).u1r();
2682
+ }
2683
+ function takeFrom_1(_this__u8e3s4, url) {
2684
+ _this__u8e3s4.z2j_1 = url.l2k_1;
2685
+ _this__u8e3s4.a2k_1 = url.m2k_1;
2686
+ _this__u8e3s4.b2k_1 = url.q2l();
2687
+ set_encodedPath(_this__u8e3s4, url.r2l());
2688
+ _this__u8e3s4.d2k_1 = url.s2l();
2689
+ _this__u8e3s4.e2k_1 = url.t2l();
2690
+ // Inline function 'kotlin.apply' call
2691
+ var this_0 = ParametersBuilder();
2692
+ // Inline function 'kotlin.contracts.contract' call
2693
+ // Inline function 'io.ktor.http.takeFrom.<anonymous>' call
2694
+ this_0.i27(parseQueryString(url.u2l(), VOID, VOID, false));
2695
+ _this__u8e3s4.n2l(this_0);
2696
+ _this__u8e3s4.f2k_1 = url.v2l();
2697
+ _this__u8e3s4.c2k_1 = url.t2k_1;
2698
+ return _this__u8e3s4;
2699
+ }
2700
+ function appendUrlFullPath$lambda(it) {
2701
+ var key = it.ne_1;
2702
+ var tmp;
2703
+ if (it.oe_1 == null) {
2704
+ tmp = key;
2705
+ } else {
2706
+ var value = toString_1(it.oe_1);
2707
+ tmp = key + '=' + value;
2708
+ }
2709
+ return tmp;
2710
+ }
2711
+ function Companion_8() {
2712
+ }
2713
+ var Companion_instance_9;
2714
+ function Companion_getInstance_8() {
2715
+ return Companion_instance_9;
2716
+ }
2717
+ function Url$encodedPath$delegate$lambda(this$0) {
2718
+ return function () {
2719
+ var tmp;
2720
+ if (this$0.o2k_1.p()) {
2721
+ return '';
2722
+ }
2723
+ var pathStartIndex = indexOf(this$0.u2k_1, _Char___init__impl__6a9atx(47), this$0.l2k_1.j2k_1.length + 3 | 0);
2724
+ var tmp_0;
2725
+ if (pathStartIndex === -1) {
2726
+ return '';
2727
+ }
2728
+ // Inline function 'kotlin.charArrayOf' call
2729
+ var tmp$ret$0 = charArrayOf([_Char___init__impl__6a9atx(63), _Char___init__impl__6a9atx(35)]);
2730
+ var pathEndIndex = indexOfAny(this$0.u2k_1, tmp$ret$0, pathStartIndex);
2731
+ var tmp_1;
2732
+ if (pathEndIndex === -1) {
2733
+ // Inline function 'kotlin.text.substring' call
2734
+ // Inline function 'kotlin.js.asDynamic' call
2735
+ return this$0.u2k_1.substring(pathStartIndex);
2736
+ }
2737
+ // Inline function 'kotlin.text.substring' call
2738
+ // Inline function 'kotlin.js.asDynamic' call
2739
+ return this$0.u2k_1.substring(pathStartIndex, pathEndIndex);
2740
+ };
2741
+ }
2742
+ function Url$encodedQuery$delegate$lambda(this$0) {
2743
+ return function () {
2744
+ var queryStart = indexOf(this$0.u2k_1, _Char___init__impl__6a9atx(63)) + 1 | 0;
2745
+ var tmp;
2746
+ if (queryStart === 0) {
2747
+ return '';
2748
+ }
2749
+ var queryEnd = indexOf(this$0.u2k_1, _Char___init__impl__6a9atx(35), queryStart);
2750
+ var tmp_0;
2751
+ if (queryEnd === -1) {
2752
+ // Inline function 'kotlin.text.substring' call
2753
+ // Inline function 'kotlin.js.asDynamic' call
2754
+ return this$0.u2k_1.substring(queryStart);
2755
+ }
2756
+ // Inline function 'kotlin.text.substring' call
2757
+ // Inline function 'kotlin.js.asDynamic' call
2758
+ return this$0.u2k_1.substring(queryStart, queryEnd);
2759
+ };
2760
+ }
2761
+ function Url$encodedPathAndQuery$delegate$lambda(this$0) {
2762
+ return function () {
2763
+ var pathStart = indexOf(this$0.u2k_1, _Char___init__impl__6a9atx(47), this$0.l2k_1.j2k_1.length + 3 | 0);
2764
+ var tmp;
2765
+ if (pathStart === -1) {
2766
+ return '';
2767
+ }
2768
+ var queryEnd = indexOf(this$0.u2k_1, _Char___init__impl__6a9atx(35), pathStart);
2769
+ var tmp_0;
2770
+ if (queryEnd === -1) {
2771
+ // Inline function 'kotlin.text.substring' call
2772
+ // Inline function 'kotlin.js.asDynamic' call
2773
+ return this$0.u2k_1.substring(pathStart);
2774
+ }
2775
+ // Inline function 'kotlin.text.substring' call
2776
+ // Inline function 'kotlin.js.asDynamic' call
2777
+ return this$0.u2k_1.substring(pathStart, queryEnd);
2778
+ };
2779
+ }
2780
+ function Url$encodedUser$delegate$lambda(this$0) {
2781
+ return function () {
2782
+ var tmp;
2783
+ if (this$0.r2k_1 == null) {
2784
+ return null;
2785
+ }
2786
+ var tmp_0;
2787
+ // Inline function 'kotlin.text.isEmpty' call
2788
+ var this_0 = this$0.r2k_1;
2789
+ if (charSequenceLength(this_0) === 0) {
2790
+ return '';
2791
+ }
2792
+ var usernameStart = this$0.l2k_1.j2k_1.length + 3 | 0;
2793
+ // Inline function 'kotlin.charArrayOf' call
2794
+ var tmp$ret$1 = charArrayOf([_Char___init__impl__6a9atx(58), _Char___init__impl__6a9atx(64)]);
2795
+ var usernameEnd = indexOfAny(this$0.u2k_1, tmp$ret$1, usernameStart);
2796
+ // Inline function 'kotlin.text.substring' call
2797
+ // Inline function 'kotlin.js.asDynamic' call
2798
+ return this$0.u2k_1.substring(usernameStart, usernameEnd);
2799
+ };
2800
+ }
2801
+ function Url$encodedPassword$delegate$lambda(this$0) {
2802
+ return function () {
2803
+ var tmp;
2804
+ if (this$0.s2k_1 == null) {
2805
+ return null;
2806
+ }
2807
+ var tmp_0;
2808
+ // Inline function 'kotlin.text.isEmpty' call
2809
+ var this_0 = this$0.s2k_1;
2810
+ if (charSequenceLength(this_0) === 0) {
2811
+ return '';
2812
+ }
2813
+ var passwordStart = indexOf(this$0.u2k_1, _Char___init__impl__6a9atx(58), this$0.l2k_1.j2k_1.length + 3 | 0) + 1 | 0;
2814
+ var passwordEnd = indexOf(this$0.u2k_1, _Char___init__impl__6a9atx(64));
2815
+ // Inline function 'kotlin.text.substring' call
2816
+ // Inline function 'kotlin.js.asDynamic' call
2817
+ return this$0.u2k_1.substring(passwordStart, passwordEnd);
2818
+ };
2819
+ }
2820
+ function Url$encodedFragment$delegate$lambda(this$0) {
2821
+ return function () {
2822
+ var fragmentStart = indexOf(this$0.u2k_1, _Char___init__impl__6a9atx(35)) + 1 | 0;
2823
+ var tmp;
2824
+ if (fragmentStart === 0) {
2825
+ return '';
2826
+ }
2827
+ // Inline function 'kotlin.text.substring' call
2828
+ // Inline function 'kotlin.js.asDynamic' call
2829
+ return this$0.u2k_1.substring(fragmentStart);
2830
+ };
2831
+ }
2832
+ function Url_1(protocol, host, specifiedPort, pathSegments, parameters, fragment, user, password, trailingQuery, urlString) {
2833
+ this.l2k_1 = protocol;
2834
+ this.m2k_1 = host;
2835
+ this.n2k_1 = specifiedPort;
2836
+ this.o2k_1 = pathSegments;
2837
+ this.p2k_1 = parameters;
2838
+ this.q2k_1 = fragment;
2839
+ this.r2k_1 = user;
2840
+ this.s2k_1 = password;
2841
+ this.t2k_1 = trailingQuery;
2842
+ this.u2k_1 = urlString;
2843
+ // Inline function 'kotlin.require' call
2844
+ var tmp;
2845
+ var containsArg = this.n2k_1;
2846
+ if (0 <= containsArg ? containsArg <= 65535 : false) {
2847
+ tmp = true;
2848
+ } else {
2849
+ tmp = this.n2k_1 === 0;
2850
+ }
2851
+ // Inline function 'kotlin.contracts.contract' call
2852
+ if (!tmp) {
2853
+ // Inline function 'io.ktor.http.Url.<anonymous>' call
2854
+ var message = 'port must be between 0 and 65535, or 0 if not set';
2855
+ throw IllegalArgumentException_init_$Create$(toString(message));
2856
+ }
2857
+ var tmp_0 = this;
2858
+ tmp_0.v2k_1 = lazy_0(Url$encodedPath$delegate$lambda(this));
2859
+ var tmp_1 = this;
2860
+ tmp_1.w2k_1 = lazy_0(Url$encodedQuery$delegate$lambda(this));
2861
+ var tmp_2 = this;
2862
+ tmp_2.x2k_1 = lazy_0(Url$encodedPathAndQuery$delegate$lambda(this));
2863
+ var tmp_3 = this;
2864
+ tmp_3.y2k_1 = lazy_0(Url$encodedUser$delegate$lambda(this));
2865
+ var tmp_4 = this;
2866
+ tmp_4.z2k_1 = lazy_0(Url$encodedPassword$delegate$lambda(this));
2867
+ var tmp_5 = this;
2868
+ tmp_5.a2l_1 = lazy_0(Url$encodedFragment$delegate$lambda(this));
2869
+ }
2870
+ protoOf(Url_1).q2l = function () {
2871
+ // Inline function 'kotlin.takeUnless' call
2872
+ var this_0 = this.n2k_1;
2873
+ // Inline function 'kotlin.contracts.contract' call
2874
+ var tmp;
2875
+ // Inline function 'io.ktor.http.Url.<get-port>.<anonymous>' call
2876
+ if (!(this_0 === 0)) {
2877
+ tmp = this_0;
2878
+ } else {
2879
+ tmp = null;
2880
+ }
2881
+ var tmp0_elvis_lhs = tmp;
2882
+ return tmp0_elvis_lhs == null ? this.l2k_1.k2k_1 : tmp0_elvis_lhs;
2883
+ };
2884
+ protoOf(Url_1).r2l = function () {
2885
+ // Inline function 'kotlin.getValue' call
2886
+ var this_0 = this.v2k_1;
2887
+ encodedPath$factory();
2888
+ return this_0.u();
2889
+ };
2890
+ protoOf(Url_1).u2l = function () {
2891
+ // Inline function 'kotlin.getValue' call
2892
+ var this_0 = this.w2k_1;
2893
+ encodedQuery$factory();
2894
+ return this_0.u();
2895
+ };
2896
+ protoOf(Url_1).s2l = function () {
2897
+ // Inline function 'kotlin.getValue' call
2898
+ var this_0 = this.y2k_1;
2899
+ encodedUser$factory();
2900
+ return this_0.u();
2901
+ };
2902
+ protoOf(Url_1).t2l = function () {
2903
+ // Inline function 'kotlin.getValue' call
2904
+ var this_0 = this.z2k_1;
2905
+ encodedPassword$factory();
2906
+ return this_0.u();
2907
+ };
2908
+ protoOf(Url_1).v2l = function () {
2909
+ // Inline function 'kotlin.getValue' call
2910
+ var this_0 = this.a2l_1;
2911
+ encodedFragment$factory();
2912
+ return this_0.u();
2913
+ };
2914
+ protoOf(Url_1).toString = function () {
2915
+ return this.u2k_1;
2916
+ };
2917
+ protoOf(Url_1).equals = function (other) {
2918
+ if (this === other)
2919
+ return true;
2920
+ if (other == null || !getKClassFromExpression(this).equals(getKClassFromExpression(other)))
2921
+ return false;
2922
+ if (!(other instanceof Url_1))
2923
+ THROW_CCE();
2924
+ if (!(this.u2k_1 === other.u2k_1))
2925
+ return false;
2926
+ return true;
2927
+ };
2928
+ protoOf(Url_1).hashCode = function () {
2929
+ return getStringHashCode(this.u2k_1);
2930
+ };
2931
+ function get_authority_0(_this__u8e3s4) {
2932
+ // Inline function 'kotlin.text.buildString' call
2933
+ // Inline function 'kotlin.contracts.contract' call
2934
+ // Inline function 'kotlin.apply' call
2935
+ var this_0 = StringBuilder_init_$Create$();
2936
+ // Inline function 'kotlin.contracts.contract' call
2937
+ // Inline function 'io.ktor.http.<get-authority>.<anonymous>' call
2938
+ this_0.n8(get_encodedUserAndPassword_0(_this__u8e3s4));
2939
+ if (_this__u8e3s4.n2k_1 === 0 || _this__u8e3s4.n2k_1 === _this__u8e3s4.l2k_1.k2k_1) {
2940
+ this_0.n8(_this__u8e3s4.m2k_1);
2941
+ } else {
2942
+ this_0.n8(get_hostWithPort(_this__u8e3s4));
2943
+ }
2944
+ return this_0.toString();
2945
+ }
2946
+ function get_encodedUserAndPassword_0(_this__u8e3s4) {
2947
+ // Inline function 'kotlin.text.buildString' call
2948
+ // Inline function 'kotlin.contracts.contract' call
2949
+ // Inline function 'kotlin.apply' call
2950
+ var this_0 = StringBuilder_init_$Create$();
2951
+ // Inline function 'kotlin.contracts.contract' call
2952
+ // Inline function 'io.ktor.http.<get-encodedUserAndPassword>.<anonymous>' call
2953
+ appendUserAndPassword(this_0, _this__u8e3s4.s2l(), _this__u8e3s4.t2l());
2954
+ return this_0.toString();
2955
+ }
2956
+ function encodedPath$factory() {
2957
+ return getPropertyCallableRef('encodedPath', 1, KProperty1, function (receiver) {
2958
+ return receiver.r2l();
2959
+ }, null);
2960
+ }
2961
+ function encodedQuery$factory() {
2962
+ return getPropertyCallableRef('encodedQuery', 1, KProperty1, function (receiver) {
2963
+ return receiver.u2l();
2964
+ }, null);
2965
+ }
2966
+ function encodedUser$factory() {
2967
+ return getPropertyCallableRef('encodedUser', 1, KProperty1, function (receiver) {
2968
+ return receiver.s2l();
2969
+ }, null);
2970
+ }
2971
+ function encodedPassword$factory() {
2972
+ return getPropertyCallableRef('encodedPassword', 1, KProperty1, function (receiver) {
2973
+ return receiver.t2l();
2974
+ }, null);
2975
+ }
2976
+ function encodedFragment$factory() {
2977
+ return getPropertyCallableRef('encodedFragment', 1, KProperty1, function (receiver) {
2978
+ return receiver.v2l();
2979
+ }, null);
2980
+ }
2981
+ function UrlDecodedParametersBuilder(encodedParametersBuilder) {
2982
+ this.w2l_1 = encodedParametersBuilder;
2983
+ this.x2l_1 = this.w2l_1.u26();
2984
+ }
2985
+ protoOf(UrlDecodedParametersBuilder).u1r = function () {
2986
+ return decodeParameters(this.w2l_1);
2987
+ };
2988
+ protoOf(UrlDecodedParametersBuilder).u26 = function () {
2989
+ return this.x2l_1;
2990
+ };
2991
+ protoOf(UrlDecodedParametersBuilder).v26 = function (name) {
2992
+ var tmp0_safe_receiver = this.w2l_1.v26(encodeURLParameter(name));
2993
+ var tmp;
2994
+ if (tmp0_safe_receiver == null) {
2995
+ tmp = null;
2996
+ } else {
2997
+ // Inline function 'kotlin.collections.map' call
2998
+ // Inline function 'kotlin.collections.mapTo' call
2999
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_safe_receiver, 10));
3000
+ var tmp0_iterator = tmp0_safe_receiver.j();
3001
+ while (tmp0_iterator.k()) {
3002
+ var item = tmp0_iterator.l();
3003
+ // Inline function 'io.ktor.http.UrlDecodedParametersBuilder.getAll.<anonymous>' call
3004
+ var tmp$ret$0 = decodeURLQueryComponent(item, VOID, VOID, true);
3005
+ destination.e(tmp$ret$0);
3006
+ }
3007
+ tmp = destination;
3008
+ }
3009
+ return tmp;
3010
+ };
3011
+ protoOf(UrlDecodedParametersBuilder).d27 = function (name) {
3012
+ return this.w2l_1.d27(encodeURLParameter(name));
3013
+ };
3014
+ protoOf(UrlDecodedParametersBuilder).w26 = function () {
3015
+ // Inline function 'kotlin.collections.map' call
3016
+ var this_0 = this.w2l_1.w26();
3017
+ // Inline function 'kotlin.collections.mapTo' call
3018
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
3019
+ var tmp0_iterator = this_0.j();
3020
+ while (tmp0_iterator.k()) {
3021
+ var item = tmp0_iterator.l();
3022
+ // Inline function 'io.ktor.http.UrlDecodedParametersBuilder.names.<anonymous>' call
3023
+ var tmp$ret$0 = decodeURLQueryComponent(item);
3024
+ destination.e(tmp$ret$0);
3025
+ }
3026
+ return toSet(destination);
3027
+ };
3028
+ protoOf(UrlDecodedParametersBuilder).p = function () {
3029
+ return this.w2l_1.p();
3030
+ };
3031
+ protoOf(UrlDecodedParametersBuilder).x26 = function () {
3032
+ return decodeParameters(this.w2l_1).x26();
3033
+ };
3034
+ protoOf(UrlDecodedParametersBuilder).h27 = function (name, value) {
3035
+ return this.w2l_1.h27(encodeURLParameter(name), encodeURLParameterValue(value));
3036
+ };
3037
+ protoOf(UrlDecodedParametersBuilder).i27 = function (stringValues) {
3038
+ return appendAllEncoded(this.w2l_1, stringValues);
3039
+ };
3040
+ protoOf(UrlDecodedParametersBuilder).c27 = function (name, values) {
3041
+ var tmp = encodeURLParameter(name);
3042
+ // Inline function 'kotlin.collections.map' call
3043
+ // Inline function 'kotlin.collections.mapTo' call
3044
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(values, 10));
3045
+ var tmp0_iterator = values.j();
3046
+ while (tmp0_iterator.k()) {
3047
+ var item = tmp0_iterator.l();
3048
+ // Inline function 'io.ktor.http.UrlDecodedParametersBuilder.appendAll.<anonymous>' call
3049
+ var tmp$ret$0 = encodeURLParameterValue(item);
3050
+ destination.e(tmp$ret$0);
3051
+ }
3052
+ return this.w2l_1.c27(tmp, destination);
3053
+ };
3054
+ protoOf(UrlDecodedParametersBuilder).a2 = function () {
3055
+ return this.w2l_1.a2();
3056
+ };
3057
+ function encodeParameters(parameters) {
3058
+ // Inline function 'kotlin.apply' call
3059
+ var this_0 = ParametersBuilder();
3060
+ // Inline function 'kotlin.contracts.contract' call
3061
+ // Inline function 'io.ktor.http.encodeParameters.<anonymous>' call
3062
+ appendAllEncoded(this_0, parameters);
3063
+ return this_0;
3064
+ }
3065
+ function decodeParameters(parameters) {
3066
+ // Inline function 'kotlin.apply' call
3067
+ var this_0 = ParametersBuilder();
3068
+ // Inline function 'kotlin.contracts.contract' call
3069
+ // Inline function 'io.ktor.http.decodeParameters.<anonymous>' call
3070
+ appendAllDecoded(this_0, parameters);
3071
+ return this_0.u1r();
3072
+ }
3073
+ function appendAllEncoded(_this__u8e3s4, parameters) {
3074
+ // Inline function 'kotlin.collections.forEach' call
3075
+ var tmp0_iterator = parameters.w26().j();
3076
+ while (tmp0_iterator.k()) {
3077
+ var element = tmp0_iterator.l();
3078
+ // Inline function 'io.ktor.http.appendAllEncoded.<anonymous>' call
3079
+ var tmp0_elvis_lhs = parameters.v26(element);
3080
+ var values = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs;
3081
+ var tmp = encodeURLParameter(element);
3082
+ // Inline function 'kotlin.collections.map' call
3083
+ // Inline function 'kotlin.collections.mapTo' call
3084
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(values, 10));
3085
+ var tmp0_iterator_0 = values.j();
3086
+ while (tmp0_iterator_0.k()) {
3087
+ var item = tmp0_iterator_0.l();
3088
+ // Inline function 'io.ktor.http.appendAllEncoded.<anonymous>.<anonymous>' call
3089
+ var tmp$ret$0 = encodeURLParameterValue(item);
3090
+ destination.e(tmp$ret$0);
3091
+ }
3092
+ _this__u8e3s4.c27(tmp, destination);
3093
+ }
3094
+ }
3095
+ function appendAllDecoded(_this__u8e3s4, parameters) {
3096
+ // Inline function 'kotlin.collections.forEach' call
3097
+ var tmp0_iterator = parameters.w26().j();
3098
+ while (tmp0_iterator.k()) {
3099
+ var element = tmp0_iterator.l();
3100
+ // Inline function 'io.ktor.http.appendAllDecoded.<anonymous>' call
3101
+ var tmp0_elvis_lhs = parameters.v26(element);
3102
+ var values = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs;
3103
+ var tmp = decodeURLQueryComponent(element);
3104
+ // Inline function 'kotlin.collections.map' call
3105
+ // Inline function 'kotlin.collections.mapTo' call
3106
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(values, 10));
3107
+ var tmp0_iterator_0 = values.j();
3108
+ while (tmp0_iterator_0.k()) {
3109
+ var item = tmp0_iterator_0.l();
3110
+ // Inline function 'io.ktor.http.appendAllDecoded.<anonymous>.<anonymous>' call
3111
+ var tmp$ret$0 = decodeURLQueryComponent(item, VOID, VOID, true);
3112
+ destination.e(tmp$ret$0);
3113
+ }
3114
+ _this__u8e3s4.c27(tmp, destination);
3115
+ }
3116
+ }
3117
+ function ByteArrayContent(bytes, contentType, status) {
3118
+ contentType = contentType === VOID ? null : contentType;
3119
+ status = status === VOID ? null : status;
3120
+ ByteArrayContent_0.call(this);
3121
+ this.z2l_1 = bytes;
3122
+ this.a2m_1 = contentType;
3123
+ this.b2m_1 = status;
3124
+ }
3125
+ protoOf(ByteArrayContent).c2m = function () {
3126
+ return this.a2m_1;
3127
+ };
3128
+ protoOf(ByteArrayContent).d2m = function () {
3129
+ return this.b2m_1;
3130
+ };
3131
+ protoOf(ByteArrayContent).e2m = function () {
3132
+ return toLong_0(this.z2l_1.length);
3133
+ };
3134
+ protoOf(ByteArrayContent).f2m = function () {
3135
+ return this.z2l_1;
3136
+ };
3137
+ function NoContent() {
3138
+ OutgoingContent.call(this);
3139
+ }
3140
+ function ReadChannelContent() {
3141
+ OutgoingContent.call(this);
3142
+ }
3143
+ function WriteChannelContent() {
3144
+ }
3145
+ function ByteArrayContent_0() {
3146
+ OutgoingContent.call(this);
3147
+ }
3148
+ function ProtocolUpgrade() {
3149
+ }
3150
+ function OutgoingContent() {
3151
+ this.g2m_1 = null;
3152
+ }
3153
+ protoOf(OutgoingContent).c2m = function () {
3154
+ return null;
3155
+ };
3156
+ protoOf(OutgoingContent).e2m = function () {
3157
+ return null;
3158
+ };
3159
+ protoOf(OutgoingContent).d2m = function () {
3160
+ return null;
3161
+ };
3162
+ protoOf(OutgoingContent).y2g = function () {
3163
+ return Companion_getInstance_1().s2c_1;
3164
+ };
3165
+ function NullBody() {
3166
+ }
3167
+ var NullBody_instance;
3168
+ function NullBody_getInstance() {
3169
+ return NullBody_instance;
3170
+ }
3171
+ function TextContent(text, contentType, status) {
3172
+ status = status === VOID ? null : status;
3173
+ ByteArrayContent_0.call(this);
3174
+ this.n2m_1 = text;
3175
+ this.o2m_1 = contentType;
3176
+ this.p2m_1 = status;
3177
+ var tmp = this;
3178
+ var tmp$ret$0;
3179
+ $l$block: {
3180
+ // Inline function 'io.ktor.utils.io.core.toByteArray' call
3181
+ var this_0 = this.n2m_1;
3182
+ var tmp0_elvis_lhs = charset(this.o2m_1);
3183
+ var charset_0 = tmp0_elvis_lhs == null ? Charsets_getInstance().a1z_1 : tmp0_elvis_lhs;
3184
+ if (charset_0.equals(Charsets_getInstance().a1z_1)) {
3185
+ tmp$ret$0 = encodeToByteArray(this_0);
3186
+ break $l$block;
3187
+ }
3188
+ tmp$ret$0 = encodeToByteArray_0(charset_0.e1z(), this_0, 0, this_0.length);
3189
+ }
3190
+ tmp.q2m_1 = tmp$ret$0;
3191
+ }
3192
+ protoOf(TextContent).c2m = function () {
3193
+ return this.o2m_1;
3194
+ };
3195
+ protoOf(TextContent).d2m = function () {
3196
+ return this.p2m_1;
3197
+ };
3198
+ protoOf(TextContent).e2m = function () {
3199
+ return toLong_0(this.q2m_1.length);
3200
+ };
3201
+ protoOf(TextContent).f2m = function () {
3202
+ return this.q2m_1;
3203
+ };
3204
+ protoOf(TextContent).toString = function () {
3205
+ return 'TextContent[' + this.o2m_1.toString() + '] "' + take(this.n2m_1, 30) + '"';
3206
+ };
3207
+ function get_origin(_this__u8e3s4) {
3208
+ var tmp;
3209
+ if (get_platform(PlatformUtils_getInstance()).n2_1 === 2) {
3210
+ var tmp_0 = function () {
3211
+ var tmpLocation = null;
3212
+ if (typeof window !== 'undefined') {
3213
+ tmpLocation = window.location;
3214
+ } else if (typeof self !== 'undefined') {
3215
+ tmpLocation = self.location;
3216
+ }
3217
+ var origin = '';
3218
+ if (tmpLocation) {
3219
+ origin = tmpLocation.origin;
3220
+ }
3221
+ return origin && origin != 'null' ? origin : 'http://localhost';
3222
+ }();
3223
+ tmp = (!(tmp_0 == null) ? typeof tmp_0 === 'string' : false) ? tmp_0 : THROW_CCE();
3224
+ } else {
3225
+ tmp = 'http://localhost';
3226
+ }
3227
+ return tmp;
3228
+ }
3229
+ //region block: post-declaration
3230
+ protoOf(EmptyHeaders).t25 = get;
3231
+ protoOf(EmptyHeaders).y26 = forEach;
3232
+ protoOf(EmptyParameters).y26 = forEach;
3233
+ //endregion
3234
+ //region block: init
3235
+ Companion_instance_1 = new Companion_0();
3236
+ EmptyHeaders_instance = new EmptyHeaders();
3237
+ EmptyParameters_instance = new EmptyParameters();
3238
+ Companion_instance_9 = new Companion_8();
3239
+ NullBody_instance = new NullBody();
3240
+ //endregion
3241
+ //region block: exports
3242
+ _.$_$ = _.$_$ || {};
3243
+ _.$_$.a = NullBody_instance;
3244
+ _.$_$.b = Application_getInstance;
3245
+ _.$_$.c = Text_getInstance;
3246
+ _.$_$.d = Companion_getInstance_1;
3247
+ _.$_$.e = HttpHeaders_getInstance;
3248
+ _.$_$.f = Companion_getInstance_2;
3249
+ _.$_$.g = Companion_getInstance_3;
3250
+ _.$_$.h = Companion_getInstance_4;
3251
+ _.$_$.i = Companion_getInstance_7;
3252
+ _.$_$.j = ByteArrayContent;
3253
+ _.$_$.k = ByteArrayContent_0;
3254
+ _.$_$.l = NoContent;
3255
+ _.$_$.m = ProtocolUpgrade;
3256
+ _.$_$.n = ReadChannelContent;
3257
+ _.$_$.o = WriteChannelContent;
3258
+ _.$_$.p = OutgoingContent;
3259
+ _.$_$.q = TextContent;
3260
+ _.$_$.r = HeadersBuilder;
3261
+ _.$_$.s = HttpStatusCode;
3262
+ _.$_$.t = ParametersBuilder;
3263
+ _.$_$.u = URLBuilder_1;
3264
+ _.$_$.v = URLBuilder;
3265
+ _.$_$.w = UnsafeHeaderException;
3266
+ _.$_$.x = Url_0;
3267
+ _.$_$.y = get_authority;
3268
+ _.$_$.z = get_authority_0;
3269
+ _.$_$.a1 = charset_0;
3270
+ _.$_$.b1 = charset;
3271
+ _.$_$.c1 = contentLength;
3272
+ _.$_$.d1 = contentType;
3273
+ _.$_$.e1 = contentType_0;
3274
+ _.$_$.f1 = isSecure;
3275
+ _.$_$.g1 = isWebsocket;
3276
+ _.$_$.h1 = parseAndSortHeader;
3277
+ _.$_$.i1 = takeFrom_0;
3278
+ _.$_$.j1 = takeFrom;
3279
+ _.$_$.k1 = withCharsetIfNeeded;
3280
+ _.$_$.l1 = withCharset;
3281
+ //endregion
3282
+ return _;
3283
+ }));
3284
+
3285
+ //# sourceMappingURL=ktor-ktor-http.js.map