@flock/wirespec 0.0.1-ts.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/kotlin/Kotlinx-Cli-Library-kotlinx-cli-js-ir.js +1601 -0
  2. package/kotlin/Kotlinx-Cli-Library-kotlinx-cli-js-ir.js.map +1 -0
  3. package/kotlin/arrow-arrow-annotations.js +15 -0
  4. package/kotlin/arrow-arrow-annotations.js.map +1 -0
  5. package/kotlin/arrow-arrow-atomic.js +57 -0
  6. package/kotlin/arrow-arrow-atomic.js.map +1 -0
  7. package/kotlin/arrow-arrow-continuations.js +31 -0
  8. package/kotlin/arrow-arrow-continuations.js.map +1 -0
  9. package/kotlin/arrow-arrow-core.js +357 -0
  10. package/kotlin/arrow-arrow-core.js.map +1 -0
  11. package/kotlin/kotlin-kotlin-stdlib-js-ir.js +11509 -0
  12. package/kotlin/kotlin-kotlin-stdlib-js-ir.js.map +1 -0
  13. package/kotlin/kotlin-openapi-bindings.js +12060 -0
  14. package/kotlin/kotlin-openapi-bindings.js.map +1 -0
  15. package/kotlin/kotlinx-serialization-kotlinx-serialization-core-js-ir.js +5362 -0
  16. package/kotlin/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.map +1 -0
  17. package/kotlin/kotlinx-serialization-kotlinx-serialization-json-js-ir.js +4421 -0
  18. package/kotlin/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.map +1 -0
  19. package/kotlin/wirespec-bin.js +3 -0
  20. package/kotlin/wirespec-cli.js +1069 -0
  21. package/kotlin/wirespec-cli.js.map +1 -0
  22. package/kotlin/wirespec-core.js +4910 -0
  23. package/kotlin/wirespec-core.js.map +1 -0
  24. package/kotlin/wirespec-lib.js +620 -0
  25. package/kotlin/wirespec-lib.js.map +1 -0
  26. package/kotlin/wirespec-openapi.js +2614 -0
  27. package/kotlin/wirespec-openapi.js.map +1 -0
  28. package/package.json +16 -0
  29. package/sync-hashes/Kotlinx-Cli-Library-kotlinx-cli-js-ir.js.hash +1 -0
  30. package/sync-hashes/Kotlinx-Cli-Library-kotlinx-cli-js-ir.js.map.hash +1 -0
  31. package/sync-hashes/arrow-arrow-annotations.js.hash +1 -0
  32. package/sync-hashes/arrow-arrow-annotations.js.map.hash +1 -0
  33. package/sync-hashes/arrow-arrow-atomic.js.hash +1 -0
  34. package/sync-hashes/arrow-arrow-atomic.js.map.hash +1 -0
  35. package/sync-hashes/arrow-arrow-continuations.js.hash +1 -0
  36. package/sync-hashes/arrow-arrow-continuations.js.map.hash +1 -0
  37. package/sync-hashes/arrow-arrow-core.js.hash +1 -0
  38. package/sync-hashes/arrow-arrow-core.js.map.hash +1 -0
  39. package/sync-hashes/kotlin-kotlin-stdlib-js-ir.js.hash +1 -0
  40. package/sync-hashes/kotlin-kotlin-stdlib-js-ir.js.map.hash +1 -0
  41. package/sync-hashes/kotlin-openapi-bindings.js.hash +1 -0
  42. package/sync-hashes/kotlin-openapi-bindings.js.map.hash +1 -0
  43. package/sync-hashes/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.hash +1 -0
  44. package/sync-hashes/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.map.hash +1 -0
  45. package/sync-hashes/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.hash +1 -0
  46. package/sync-hashes/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.map.hash +1 -0
  47. package/sync-hashes/wirespec-bin.js.hash +1 -0
  48. package/sync-hashes/wirespec-cli.js.hash +1 -0
  49. package/sync-hashes/wirespec-cli.js.map.hash +1 -0
  50. package/sync-hashes/wirespec-core.js.hash +1 -0
  51. package/sync-hashes/wirespec-core.js.map.hash +1 -0
  52. package/sync-hashes/wirespec-lib.js.hash +1 -0
  53. package/sync-hashes/wirespec-lib.js.map.hash +1 -0
  54. package/sync-hashes/wirespec-openapi.js.hash +1 -0
  55. package/sync-hashes/wirespec-openapi.js.map.hash +1 -0
@@ -0,0 +1,4910 @@
1
+ (function (root, factory) {
2
+ if (typeof define === 'function' && define.amd)
3
+ define(['exports', './kotlin-kotlin-stdlib-js-ir.js', './arrow-arrow-core.js'], factory);
4
+ else if (typeof exports === 'object')
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'), require('./arrow-arrow-core.js'));
6
+ else {
7
+ if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
8
+ throw new Error("Error loading module 'wirespec-core'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'wirespec-core'.");
9
+ }
10
+ if (typeof this['arrow-arrow-core'] === 'undefined') {
11
+ throw new Error("Error loading module 'wirespec-core'. Its dependency 'arrow-arrow-core' was not found. Please, check whether 'arrow-arrow-core' is loaded prior to 'wirespec-core'.");
12
+ }
13
+ root['wirespec-core'] = factory(typeof this['wirespec-core'] === 'undefined' ? {} : this['wirespec-core'], this['kotlin-kotlin-stdlib-js-ir'], this['arrow-arrow-core']);
14
+ }
15
+ }(this, function (_, kotlin_kotlin, kotlin_io_arrow_kt_arrow_core) {
16
+ 'use strict';
17
+ //region block: imports
18
+ var imul = Math.imul;
19
+ var toString = kotlin_kotlin.$_$.y7;
20
+ var Unit_getInstance = kotlin_kotlin.$_$.i3;
21
+ var Enum = kotlin_kotlin.$_$.p9;
22
+ var protoOf = kotlin_kotlin.$_$.t7;
23
+ var classMeta = kotlin_kotlin.$_$.q6;
24
+ var VOID = kotlin_kotlin.$_$.ya;
25
+ var setMetadataFor = kotlin_kotlin.$_$.u7;
26
+ var noWhenBranchMatchedException = kotlin_kotlin.$_$.ta;
27
+ var Left = kotlin_io_arrow_kt_arrow_core.$_$.c;
28
+ var Right = kotlin_io_arrow_kt_arrow_core.$_$.d;
29
+ var Regex_init_$Create$ = kotlin_kotlin.$_$.v;
30
+ var to = kotlin_kotlin.$_$.xa;
31
+ var listOf = kotlin_kotlin.$_$.j5;
32
+ var objectMeta = kotlin_kotlin.$_$.s7;
33
+ var trimMargin = kotlin_kotlin.$_$.j9;
34
+ var joinToString = kotlin_kotlin.$_$.a5;
35
+ var split = kotlin_kotlin.$_$.w8;
36
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.g;
37
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.c4;
38
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.f;
39
+ var plus = kotlin_kotlin.$_$.p5;
40
+ var plus_0 = kotlin_kotlin.$_$.q5;
41
+ var filterNotNull = kotlin_kotlin.$_$.u4;
42
+ var toIntOrNull = kotlin_kotlin.$_$.b9;
43
+ var toSet = kotlin_kotlin.$_$.b6;
44
+ var isBlank = kotlin_kotlin.$_$.q8;
45
+ var checkIndexOverflow = kotlin_kotlin.$_$.b4;
46
+ var THROW_CCE = kotlin_kotlin.$_$.y9;
47
+ var isCharSequence = kotlin_kotlin.$_$.e7;
48
+ var trimStart = kotlin_kotlin.$_$.k9;
49
+ var dropLast = kotlin_kotlin.$_$.l8;
50
+ var drop = kotlin_kotlin.$_$.m8;
51
+ var charSequenceLength = kotlin_kotlin.$_$.o6;
52
+ var charSequenceGet = kotlin_kotlin.$_$.n6;
53
+ var toString_0 = kotlin_kotlin.$_$.l1;
54
+ var Collection = kotlin_kotlin.$_$.m3;
55
+ var isInterface = kotlin_kotlin.$_$.i7;
56
+ var listOf_0 = kotlin_kotlin.$_$.i5;
57
+ var interfaceMeta = kotlin_kotlin.$_$.z6;
58
+ var captureStack = kotlin_kotlin.$_$.k6;
59
+ var getKClassFromExpression = kotlin_kotlin.$_$.c;
60
+ var RuntimeException = kotlin_kotlin.$_$.x9;
61
+ var RuntimeException_init_$Init$ = kotlin_kotlin.$_$.h1;
62
+ var getStringHashCode = kotlin_kotlin.$_$.x6;
63
+ var hashCode = kotlin_kotlin.$_$.y6;
64
+ var equals = kotlin_kotlin.$_$.s6;
65
+ var DefaultRaise = kotlin_io_arrow_kt_arrow_core.$_$.a;
66
+ var nonFatalOrThrow = kotlin_io_arrow_kt_arrow_core.$_$.g;
67
+ var raisedOrRethrow = kotlin_io_arrow_kt_arrow_core.$_$.b;
68
+ var CancellationException = kotlin_kotlin.$_$.e6;
69
+ var getKClass = kotlin_kotlin.$_$.d;
70
+ var nonEmptyListOf = kotlin_io_arrow_kt_arrow_core.$_$.f;
71
+ var Companion_getInstance = kotlin_kotlin.$_$.d3;
72
+ var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.m1;
73
+ var createFailure = kotlin_kotlin.$_$.ma;
74
+ var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.p1;
75
+ var isObject = kotlin_kotlin.$_$.k7;
76
+ var _Result___get_isFailure__impl__jpiriv = kotlin_kotlin.$_$.o1;
77
+ var emptyList = kotlin_kotlin.$_$.r4;
78
+ var lastOrNull = kotlin_kotlin.$_$.e5;
79
+ var removePrefix = kotlin_kotlin.$_$.t8;
80
+ var NoSuchElementException_init_$Create$ = kotlin_kotlin.$_$.g1;
81
+ var ensureNotNull = kotlin_kotlin.$_$.na;
82
+ var println = kotlin_kotlin.$_$.h6;
83
+ //endregion
84
+ //region block: pre-declaration
85
+ setMetadataFor(Reported, 'Reported', classMeta, Enum);
86
+ setMetadataFor(Wirespec, 'Wirespec', objectMeta);
87
+ function withLogging(_this__u8e3s4, logger, block) {
88
+ return logger.rk('Emitting Definition: Type', block);
89
+ }
90
+ function withLogging_0(_this__u8e3s4, logger, block) {
91
+ return logger.rk('Emitting Definition: Type Shape', block);
92
+ }
93
+ function withLogging_1(_this__u8e3s4, logger, block) {
94
+ return logger.rk('Emitting Definition: Type Shape Field', block);
95
+ }
96
+ function withLogging_2(_this__u8e3s4, logger, block) {
97
+ return logger.rk('Emitting Definition: Type Shape Field Key', block);
98
+ }
99
+ function withLogging_3(_this__u8e3s4, logger, block) {
100
+ return logger.rk('Emitting Definition: Type Shape Field Value', block);
101
+ }
102
+ setMetadataFor(TypeDefinitionEmitterLogger, 'TypeDefinitionEmitterLogger', interfaceMeta);
103
+ function withLogging_4(_this__u8e3s4, logger, block) {
104
+ return logger.rk('Emitting Definition: Endpoint', block);
105
+ }
106
+ setMetadataFor(EnumDefinitionEmitterLogger, 'EnumDefinitionEmitterLogger', interfaceMeta);
107
+ function withLogging_5(_this__u8e3s4, logger, block) {
108
+ return logger.rk('Emitting Definition: Refined', block);
109
+ }
110
+ function withLogging_6(_this__u8e3s4, logger, block) {
111
+ return logger.rk('Emitting Definition: Refined Validator', block);
112
+ }
113
+ setMetadataFor(RefinedTypeDefinitionEmitterLogger, 'RefinedTypeDefinitionEmitterLogger', interfaceMeta);
114
+ function withLogging_7(_this__u8e3s4, logger, block) {
115
+ return logger.rk('Emitting Definition: Endpoint', block);
116
+ }
117
+ function withLogging_8(_this__u8e3s4, logger, block) {
118
+ return logger.rk('Emitting Definition: Endpoint Segment', block);
119
+ }
120
+ setMetadataFor(EndpointDefinitionEmitterLogger, 'EndpointDefinitionEmitterLogger', interfaceMeta);
121
+ setMetadataFor(Emitter, 'Emitter', classMeta, VOID, [TypeDefinitionEmitterLogger, EnumDefinitionEmitterLogger, RefinedTypeDefinitionEmitterLogger, EndpointDefinitionEmitterLogger]);
122
+ setMetadataFor(JavaEmitter, 'JavaEmitter', classMeta, Emitter);
123
+ setMetadataFor(KotlinEmitter, 'KotlinEmitter', classMeta, Emitter);
124
+ setMetadataFor(Companion, 'Companion', objectMeta);
125
+ setMetadataFor(ScalaEmitter, 'ScalaEmitter', classMeta, Emitter);
126
+ setMetadataFor(TypeScriptEmitter, 'TypeScriptEmitter', classMeta, Emitter);
127
+ setMetadataFor(WirespecEmitter, 'WirespecEmitter', classMeta, Emitter);
128
+ setMetadataFor(Companion_0, 'Companion', objectMeta);
129
+ setMetadataFor(WirespecException, 'WirespecException', classMeta, RuntimeException);
130
+ setMetadataFor(CompilerException, 'CompilerException', classMeta, WirespecException);
131
+ setMetadataFor(ParserException, 'ParserException', classMeta, CompilerException);
132
+ setMetadataFor(NullTokenException, 'NullTokenException', classMeta, ParserException);
133
+ setMetadataFor(StartingException, 'StartingException', classMeta, NullTokenException);
134
+ setMetadataFor(NextException, 'NextException', classMeta, NullTokenException);
135
+ setMetadataFor(WrongTokenException, 'WrongTokenException', classMeta, ParserException);
136
+ setMetadataFor(Type, 'Type', classMeta, Enum);
137
+ setMetadataFor(Custom, 'Custom', classMeta);
138
+ setMetadataFor(Primitive, 'Primitive', classMeta);
139
+ setMetadataFor(Identifier, 'Identifier', classMeta);
140
+ setMetadataFor(Field, 'Field', classMeta);
141
+ setMetadataFor(Shape, 'Shape', classMeta);
142
+ setMetadataFor(Type_0, 'Type', classMeta);
143
+ setMetadataFor(Literal, 'Literal', classMeta);
144
+ setMetadataFor(Param, 'Param', classMeta);
145
+ setMetadataFor(Method, 'Method', classMeta, Enum);
146
+ setMetadataFor(Request, 'Request', classMeta);
147
+ setMetadataFor(Response, 'Response', classMeta);
148
+ setMetadataFor(Content, 'Content', classMeta);
149
+ setMetadataFor(Endpoint, 'Endpoint', classMeta);
150
+ setMetadataFor(Enum_0, 'Enum', classMeta);
151
+ setMetadataFor(Validator, 'Validator', classMeta);
152
+ setMetadataFor(Refined, 'Refined', classMeta);
153
+ setMetadataFor(Parser, 'Parser', classMeta);
154
+ setMetadataFor(TokenProvider, 'TokenProvider', classMeta);
155
+ setMetadataFor(IdxAndLength, 'IdxAndLength', classMeta);
156
+ setMetadataFor(Coordinates, 'Coordinates', classMeta);
157
+ setMetadataFor(Token, 'Token', classMeta);
158
+ function name() {
159
+ return ensureNotNull(getKClassFromExpression(this).fc());
160
+ }
161
+ setMetadataFor(TokenType, 'TokenType', interfaceMeta);
162
+ setMetadataFor(WsTypeDef, 'WsTypeDef', objectMeta, VOID, [TokenType]);
163
+ setMetadataFor(WsEnumTypeDef, 'WsEnumTypeDef', objectMeta, VOID, [TokenType]);
164
+ setMetadataFor(WsRefinedTypeDef, 'WsRefinedTypeDef', objectMeta, VOID, [TokenType]);
165
+ setMetadataFor(WhiteSpace, 'WhiteSpace', interfaceMeta, VOID, [TokenType]);
166
+ setMetadataFor(WhiteSpaceExceptNewLine, 'WhiteSpaceExceptNewLine', objectMeta, VOID, [WhiteSpace]);
167
+ setMetadataFor(NewLine, 'NewLine', objectMeta, VOID, [WhiteSpace]);
168
+ setMetadataFor(LeftCurly, 'LeftCurly', objectMeta, VOID, [TokenType]);
169
+ setMetadataFor(Colon, 'Colon', objectMeta, VOID, [TokenType]);
170
+ setMetadataFor(Comma, 'Comma', objectMeta, VOID, [TokenType]);
171
+ setMetadataFor(QuestionMark, 'QuestionMark', objectMeta, VOID, [TokenType]);
172
+ setMetadataFor(Brackets, 'Brackets', objectMeta, VOID, [TokenType]);
173
+ setMetadataFor(WsType, 'WsType', interfaceMeta, VOID, [TokenType]);
174
+ setMetadataFor(WsString, 'WsString', objectMeta, VOID, [WsType]);
175
+ setMetadataFor(WsInteger, 'WsInteger', objectMeta, VOID, [WsType]);
176
+ setMetadataFor(WsBoolean, 'WsBoolean', objectMeta, VOID, [WsType]);
177
+ setMetadataFor(RightCurly, 'RightCurly', objectMeta, VOID, [TokenType]);
178
+ setMetadataFor(CustomValue, 'CustomValue', objectMeta, VOID, [TokenType]);
179
+ setMetadataFor(CustomType, 'CustomType', objectMeta, VOID, [WsType]);
180
+ setMetadataFor(CustomRegex, 'CustomRegex', objectMeta, VOID, [TokenType]);
181
+ setMetadataFor(Invalid, 'Invalid', objectMeta, VOID, [TokenType]);
182
+ setMetadataFor(EndOfProgram, 'EndOfProgram', objectMeta, VOID, [TokenType]);
183
+ setMetadataFor(Logger, 'Logger', classMeta);
184
+ setMetadataFor(noLogger$1, VOID, classMeta, Logger);
185
+ //endregion
186
+ function compile(_this__u8e3s4, source) {
187
+ return compile$lambda(_this__u8e3s4, source);
188
+ }
189
+ var Reported_TOKENIZED_instance;
190
+ var Reported_PARSED_instance;
191
+ var Reported_VALIDATED_instance;
192
+ var Reported_EMITTED_instance;
193
+ function Reported$report$lambda($logger, this$0) {
194
+ return function (it) {
195
+ $logger.ih('********** ' + this$0.p4_1 + ' **********\n' + toString(it) + '\n########## ' + this$0.p4_1 + ' ##########');
196
+ return Unit_getInstance();
197
+ };
198
+ }
199
+ var Reported_entriesInitialized;
200
+ function Reported_initEntries() {
201
+ if (Reported_entriesInitialized)
202
+ return Unit_getInstance();
203
+ Reported_entriesInitialized = true;
204
+ Reported_TOKENIZED_instance = new Reported('TOKENIZED', 0);
205
+ Reported_PARSED_instance = new Reported('PARSED', 1);
206
+ Reported_VALIDATED_instance = new Reported('VALIDATED', 2);
207
+ Reported_EMITTED_instance = new Reported('EMITTED', 3);
208
+ }
209
+ function Reported(name, ordinal) {
210
+ Enum.call(this, name, ordinal);
211
+ }
212
+ protoOf(Reported).lh = function (logger) {
213
+ return Reported$report$lambda(logger, this);
214
+ };
215
+ function Reported$report$ref($boundThis) {
216
+ var l = function (p0) {
217
+ return $boundThis.lh(p0);
218
+ };
219
+ l.callableName = 'report';
220
+ return l;
221
+ }
222
+ function Reported$report$ref_0($boundThis) {
223
+ var l = function (p0) {
224
+ return $boundThis.lh(p0);
225
+ };
226
+ l.callableName = 'report';
227
+ return l;
228
+ }
229
+ function Reported$report$ref_1($boundThis) {
230
+ var l = function (p0) {
231
+ return $boundThis.lh(p0);
232
+ };
233
+ l.callableName = 'report';
234
+ return l;
235
+ }
236
+ function Reported$report$ref_2($boundThis) {
237
+ var l = function (p0) {
238
+ return $boundThis.lh(p0);
239
+ };
240
+ l.callableName = 'report';
241
+ return l;
242
+ }
243
+ function Reported$report$ref_3($boundThis) {
244
+ var l = function (p0) {
245
+ return $boundThis.lh(p0);
246
+ };
247
+ l.callableName = 'report';
248
+ return l;
249
+ }
250
+ function compile$lambda$lambda($this_compile, $source, $logger) {
251
+ return function (emitter) {
252
+ var tmp$ret$14;
253
+ // Inline function 'kotlin.also' call
254
+ var tmp$ret$13;
255
+ // Inline function 'arrow.core.Either.map' call
256
+ var tmp$ret$9;
257
+ // Inline function 'kotlin.also' call
258
+ var tmp$ret$8;
259
+ // Inline function 'arrow.core.Either.map' call
260
+ var tmp$ret$4;
261
+ // Inline function 'kotlin.also' call
262
+ var tmp$ret$3;
263
+ // Inline function 'kotlin.let' call
264
+ var tmp$ret$1;
265
+ // Inline function 'kotlin.also' call
266
+ var tmp$ret$0;
267
+ // Inline function 'kotlin.also' call
268
+ var tmp0_also = tokenize($this_compile, $source);
269
+ var tmp1_also = Reported$report$ref(Reported_TOKENIZED_getInstance())($logger);
270
+ // Inline function 'kotlin.contracts.contract' call
271
+ tmp1_also(tmp0_also);
272
+ tmp$ret$0 = tmp0_also;
273
+ var tmp2_also = optimize(tmp$ret$0);
274
+ var tmp3_also = Reported$report$ref_0(Reported_VALIDATED_getInstance())($logger);
275
+ // Inline function 'kotlin.contracts.contract' call
276
+ tmp3_also(tmp2_also);
277
+ tmp$ret$1 = tmp2_also;
278
+ var tmp4_let = tmp$ret$1;
279
+ // Inline function 'kotlin.contracts.contract' call
280
+ var tmp$ret$2;
281
+ // Inline function 'community.flock.wirespec.compiler.core.compile.<anonymous>.<anonymous>.<anonymous>' call
282
+ tmp$ret$2 = (new Parser($logger)).nh(tmp4_let);
283
+ tmp$ret$3 = tmp$ret$2;
284
+ var tmp5_also = tmp$ret$3;
285
+ var tmp6_also = Reported$report$ref_1(Reported_PARSED_getInstance())($logger);
286
+ // Inline function 'kotlin.contracts.contract' call
287
+ tmp6_also(tmp5_also);
288
+ tmp$ret$4 = tmp5_also;
289
+ var tmp8_map = tmp$ret$4;
290
+ // Inline function 'kotlin.contracts.contract' call
291
+ var tmp$ret$7;
292
+ // Inline function 'arrow.core.flatMap' call
293
+ // Inline function 'kotlin.contracts.contract' call
294
+ var tmp0_subject = tmp8_map;
295
+ var tmp;
296
+ if (tmp0_subject instanceof Right) {
297
+ var tmp$ret$6;
298
+ // Inline function 'arrow.core.Either.map.<anonymous>' call
299
+ var tmp7__anonymous__b0knam = tmp8_map.og_1;
300
+ var tmp$ret$5;
301
+ // Inline function 'community.flock.wirespec.compiler.core.compile.<anonymous>.<anonymous>.<anonymous>' call
302
+ tmp$ret$5 = validate(tmp7__anonymous__b0knam);
303
+ tmp$ret$6 = new Right(tmp$ret$5);
304
+ tmp = tmp$ret$6;
305
+ } else {
306
+ if (tmp0_subject instanceof Left) {
307
+ tmp = tmp8_map;
308
+ } else {
309
+ noWhenBranchMatchedException();
310
+ }
311
+ }
312
+ tmp$ret$7 = tmp;
313
+ tmp$ret$8 = tmp$ret$7;
314
+ var tmp9_also = tmp$ret$8;
315
+ var tmp10_also = Reported$report$ref_2(Reported_VALIDATED_getInstance())($logger);
316
+ // Inline function 'kotlin.contracts.contract' call
317
+ tmp10_also(tmp9_also);
318
+ tmp$ret$9 = tmp9_also;
319
+ var tmp12_map = tmp$ret$9;
320
+ // Inline function 'kotlin.contracts.contract' call
321
+ var tmp$ret$12;
322
+ // Inline function 'arrow.core.flatMap' call
323
+ // Inline function 'kotlin.contracts.contract' call
324
+ var tmp0_subject_0 = tmp12_map;
325
+ var tmp_0;
326
+ if (tmp0_subject_0 instanceof Right) {
327
+ var tmp$ret$11;
328
+ // Inline function 'arrow.core.Either.map.<anonymous>' call
329
+ var tmp11__anonymous__tkubxh = tmp12_map.og_1;
330
+ var tmp$ret$10;
331
+ // Inline function 'community.flock.wirespec.compiler.core.compile.<anonymous>.<anonymous>.<anonymous>' call
332
+ tmp$ret$10 = emitter.qh(tmp11__anonymous__tkubxh);
333
+ tmp$ret$11 = new Right(tmp$ret$10);
334
+ tmp_0 = tmp$ret$11;
335
+ } else {
336
+ if (tmp0_subject_0 instanceof Left) {
337
+ tmp_0 = tmp12_map;
338
+ } else {
339
+ noWhenBranchMatchedException();
340
+ }
341
+ }
342
+ tmp$ret$12 = tmp_0;
343
+ tmp$ret$13 = tmp$ret$12;
344
+ var tmp13_also = tmp$ret$13;
345
+ var tmp14_also = Reported$report$ref_3(Reported_EMITTED_getInstance())($logger);
346
+ // Inline function 'kotlin.contracts.contract' call
347
+ tmp14_also(tmp13_also);
348
+ tmp$ret$14 = tmp13_also;
349
+ return tmp$ret$14;
350
+ };
351
+ }
352
+ function compile$lambda($this_compile, $source) {
353
+ return function (logger) {
354
+ return compile$lambda$lambda($this_compile, $source, logger);
355
+ };
356
+ }
357
+ function Reported_TOKENIZED_getInstance() {
358
+ Reported_initEntries();
359
+ return Reported_TOKENIZED_instance;
360
+ }
361
+ function Reported_PARSED_getInstance() {
362
+ Reported_initEntries();
363
+ return Reported_PARSED_instance;
364
+ }
365
+ function Reported_VALIDATED_getInstance() {
366
+ Reported_initEntries();
367
+ return Reported_VALIDATED_instance;
368
+ }
369
+ function Reported_EMITTED_getInstance() {
370
+ Reported_initEntries();
371
+ return Reported_EMITTED_instance;
372
+ }
373
+ function Wirespec() {
374
+ Wirespec_instance = this;
375
+ this.rh_1 = listOf([to(Regex_init_$Create$('^type'), WsTypeDef_getInstance()), to(Regex_init_$Create$('^enum'), WsEnumTypeDef_getInstance()), to(Regex_init_$Create$('^refined'), WsRefinedTypeDef_getInstance()), to(Regex_init_$Create$('^[^\\S\\r\\n]+'), WhiteSpaceExceptNewLine_getInstance()), to(Regex_init_$Create$('^[\\r\\n]'), NewLine_getInstance()), to(Regex_init_$Create$('^\\{'), LeftCurly_getInstance()), to(Regex_init_$Create$('^:'), Colon_getInstance()), to(Regex_init_$Create$('^,'), Comma_getInstance()), to(Regex_init_$Create$('^\\?'), QuestionMark_getInstance()), to(Regex_init_$Create$('^\\[\\]'), Brackets_getInstance()), to(Regex_init_$Create$('^String'), WsString_getInstance()), to(Regex_init_$Create$('^Integer'), WsInteger_getInstance()), to(Regex_init_$Create$('^Boolean'), WsBoolean_getInstance()), to(Regex_init_$Create$('^\\}'), RightCurly_getInstance()), to(Regex_init_$Create$('^[a-z][a-zA-Z]*'), CustomValue_getInstance()), to(Regex_init_$Create$('^[A-Z][a-zA-Z]*'), CustomType_getInstance()), to(Regex_init_$Create$('^/.*/g'), CustomRegex_getInstance()), to(Regex_init_$Create$('^.'), Invalid_getInstance())]);
376
+ }
377
+ protoOf(Wirespec).sh = function () {
378
+ return this.rh_1;
379
+ };
380
+ var Wirespec_instance;
381
+ function Wirespec_getInstance() {
382
+ if (Wirespec_instance == null)
383
+ new Wirespec();
384
+ return Wirespec_instance;
385
+ }
386
+ function emitPrimaryType(_this__u8e3s4, $this) {
387
+ return $this.th(_this__u8e3s4, $this.oh_1, JavaEmitter$emitPrimaryType$lambda(_this__u8e3s4));
388
+ }
389
+ function emit(_this__u8e3s4, $this, endpoint) {
390
+ Companion_getInstance_1();
391
+ var tmp = emitContentType(_this__u8e3s4.uh_1, $this);
392
+ var tmp0_safe_receiver = _this__u8e3s4.uh_1;
393
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.wh_1;
394
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : $this.di(tmp1_safe_receiver);
395
+ var tmp_0 = tmp2_elvis_lhs == null ? 'Void' : tmp2_elvis_lhs;
396
+ Companion_getInstance_1();
397
+ Companion_getInstance_1();
398
+ Companion_getInstance_1();
399
+ Companion_getInstance_1();
400
+ Companion_getInstance_1();
401
+ Companion_getInstance_1();
402
+ Companion_getInstance_1();
403
+ Companion_getInstance_1();
404
+ Companion_getInstance_1();
405
+ Companion_getInstance_1();
406
+ var tmp3_safe_receiver = _this__u8e3s4.uh_1;
407
+ var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.wh_1;
408
+ var tmp5_elvis_lhs = tmp4_safe_receiver == null ? null : $this.di(tmp4_safe_receiver);
409
+ var tmp_1 = tmp5_elvis_lhs == null ? 'Void' : tmp5_elvis_lhs;
410
+ Companion_getInstance_1();
411
+ Companion_getInstance_1();
412
+ var tmp_2 = emitContentType(_this__u8e3s4.uh_1, $this);
413
+ var tmp_3 = emitRequestSignature(endpoint, $this, _this__u8e3s4.uh_1);
414
+ Companion_getInstance_1();
415
+ Companion_getInstance_1();
416
+ Companion_getInstance_1();
417
+ var tmp_4 = emitPath(endpoint.gi_1, $this);
418
+ Companion_getInstance_1();
419
+ Companion_getInstance_1();
420
+ Companion_getInstance_1();
421
+ Companion_getInstance_1();
422
+ Companion_getInstance_1();
423
+ Companion_getInstance_1();
424
+ var tmp_5 = emitMap(endpoint.hi_1, $this);
425
+ Companion_getInstance_1();
426
+ Companion_getInstance_1();
427
+ Companion_getInstance_1();
428
+ var tmp_6 = emitMap(endpoint.ii_1, $this);
429
+ Companion_getInstance_1();
430
+ Companion_getInstance_1();
431
+ Companion_getInstance_1();
432
+ var tmp6_safe_receiver = _this__u8e3s4.uh_1;
433
+ var tmp_7;
434
+ if (tmp6_safe_receiver == null) {
435
+ tmp_7 = null;
436
+ } else {
437
+ var tmp$ret$1;
438
+ // Inline function 'kotlin.let' call
439
+ // Inline function 'kotlin.contracts.contract' call
440
+ var tmp$ret$0;
441
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
442
+ tmp$ret$0 = 'new WirespecShared.Content("' + tmp6_safe_receiver.vh_1 + '", body)';
443
+ tmp$ret$1 = tmp$ret$0;
444
+ tmp_7 = tmp$ret$1;
445
+ }
446
+ var tmp7_elvis_lhs = tmp_7;
447
+ var tmp_8 = tmp7_elvis_lhs == null ? 'null' : tmp7_elvis_lhs;
448
+ Companion_getInstance_1();
449
+ Companion_getInstance_1();
450
+ Companion_getInstance_1();
451
+ Companion_getInstance_1();
452
+ Companion_getInstance_1();
453
+ Companion_getInstance_1();
454
+ Companion_getInstance_1();
455
+ Companion_getInstance_1();
456
+ Companion_getInstance_1();
457
+ Companion_getInstance_1();
458
+ Companion_getInstance_1();
459
+ Companion_getInstance_1();
460
+ var tmp8_safe_receiver = _this__u8e3s4.uh_1;
461
+ var tmp9_safe_receiver = tmp8_safe_receiver == null ? null : tmp8_safe_receiver.wh_1;
462
+ var tmp10_elvis_lhs = tmp9_safe_receiver == null ? null : $this.di(tmp9_safe_receiver);
463
+ var tmp_9 = tmp10_elvis_lhs == null ? 'Void' : tmp10_elvis_lhs;
464
+ Companion_getInstance_1();
465
+ return trimMargin('\n |' + ' ' + 'class Request' + tmp + ' implements Request<' + tmp_0 + '> {\n |' + ' ' + ' ' + 'private final String path;\n |' + ' ' + ' ' + 'private final WirespecShared.Method method;\n |' + ' ' + ' ' + 'private final java.util.Map<String, java.util.List<Object>> query;\n |' + ' ' + ' ' + 'private final java.util.Map<String, java.util.List<Object>> headers;\n |' + ' ' + ' ' + 'private final WirespecShared.Content<' + tmp_1 + '> content;\n |' + ' ' + ' ' + 'public Request' + tmp_2 + '(' + tmp_3 + ') {\n |' + ' ' + ' ' + ' ' + 'this.path = ' + tmp_4 + ';\n |' + ' ' + ' ' + ' ' + 'this.method = WirespecShared.Method.' + endpoint.fi_1.p4_1 + ';\n |' + ' ' + ' ' + ' ' + 'this.query = ' + tmp_5 + ';\n |' + ' ' + ' ' + ' ' + 'this.headers = ' + tmp_6 + ';\n |' + ' ' + ' ' + ' ' + 'this.content = ' + tmp_8 + ';\n |' + ' ' + ' ' + '}\n |' + ' ' + ' ' + '@Override public String getPath() {return path;}\n |' + ' ' + ' ' + '@Override public WirespecShared.Method getMethod() {return method;}\n |' + ' ' + ' ' + '@Override public java.util.Map<String, java.util.List<Object>> getQuery() {return query;}\n |' + ' ' + ' ' + '@Override public java.util.Map<String, java.util.List<Object>> getHeaders() {return headers;}\n |' + ' ' + ' ' + '@Override public WirespecShared.Content<' + tmp_9 + '> getContent() {return content;}\n |' + ' ' + '}\n ');
466
+ }
467
+ function emit_0(_this__u8e3s4, $this) {
468
+ Companion_getInstance_1();
469
+ var tmp = Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
470
+ var tmp_0 = emitContentType(_this__u8e3s4.ni_1, $this);
471
+ var tmp$ret$1;
472
+ // Inline function 'kotlin.takeIf' call
473
+ var tmp0_takeIf = _this__u8e3s4.mi_1;
474
+ // Inline function 'kotlin.contracts.contract' call
475
+ var tmp_1;
476
+ var tmp$ret$0;
477
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
478
+ tmp$ret$0 = isInt(tmp0_takeIf, $this);
479
+ if (tmp$ret$0) {
480
+ tmp_1 = tmp0_takeIf;
481
+ } else {
482
+ tmp_1 = null;
483
+ }
484
+ tmp$ret$1 = tmp_1;
485
+ var tmp0_safe_receiver = tmp$ret$1;
486
+ var tmp_2 = orEmptyString(tmp0_safe_receiver == null ? null : groupStatus(tmp0_safe_receiver, $this), $this);
487
+ var tmp1_safe_receiver = _this__u8e3s4.ni_1;
488
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.wh_1;
489
+ var tmp3_elvis_lhs = tmp2_safe_receiver == null ? null : $this.di(tmp2_safe_receiver);
490
+ var tmp_3 = tmp3_elvis_lhs == null ? 'Void' : tmp3_elvis_lhs;
491
+ Companion_getInstance_1();
492
+ Companion_getInstance_1();
493
+ Companion_getInstance_1();
494
+ Companion_getInstance_1();
495
+ Companion_getInstance_1();
496
+ Companion_getInstance_1();
497
+ var tmp4_safe_receiver = _this__u8e3s4.ni_1;
498
+ var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.wh_1;
499
+ var tmp6_elvis_lhs = tmp5_safe_receiver == null ? null : $this.di(tmp5_safe_receiver);
500
+ var tmp_4 = tmp6_elvis_lhs == null ? 'Void' : tmp6_elvis_lhs;
501
+ Companion_getInstance_1();
502
+ Companion_getInstance_1();
503
+ var tmp_5 = Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
504
+ var tmp_6 = emitContentType(_this__u8e3s4.ni_1, $this);
505
+ var tmp$ret$3;
506
+ // Inline function 'kotlin.takeIf' call
507
+ var tmp1_takeIf = _this__u8e3s4.mi_1;
508
+ // Inline function 'kotlin.contracts.contract' call
509
+ var tmp_7;
510
+ var tmp$ret$2;
511
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
512
+ tmp$ret$2 = !isInt(tmp1_takeIf, $this);
513
+ if (tmp$ret$2) {
514
+ tmp_7 = tmp1_takeIf;
515
+ } else {
516
+ tmp_7 = null;
517
+ }
518
+ tmp$ret$3 = tmp_7;
519
+ var tmp7_safe_receiver = tmp$ret$3;
520
+ var tmp_8;
521
+ if (tmp7_safe_receiver == null) {
522
+ tmp_8 = null;
523
+ } else {
524
+ var tmp$ret$5;
525
+ // Inline function 'kotlin.let' call
526
+ // Inline function 'kotlin.contracts.contract' call
527
+ var tmp$ret$4;
528
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
529
+ tmp$ret$4 = 'int status, ';
530
+ tmp$ret$5 = tmp$ret$4;
531
+ tmp_8 = tmp$ret$5;
532
+ }
533
+ var tmp_9 = orEmptyString(tmp_8, $this);
534
+ var tmp8_safe_receiver = _this__u8e3s4.ni_1;
535
+ var tmp_10;
536
+ if (tmp8_safe_receiver == null) {
537
+ tmp_10 = null;
538
+ } else {
539
+ var tmp$ret$7;
540
+ // Inline function 'kotlin.let' call
541
+ // Inline function 'kotlin.contracts.contract' call
542
+ var tmp$ret$6;
543
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
544
+ tmp$ret$6 = ', ' + $this.di(tmp8_safe_receiver.wh_1) + ' body';
545
+ tmp$ret$7 = tmp$ret$6;
546
+ tmp_10 = tmp$ret$7;
547
+ }
548
+ var tmp9_elvis_lhs = tmp_10;
549
+ var tmp_11 = tmp9_elvis_lhs == null ? '' : tmp9_elvis_lhs;
550
+ Companion_getInstance_1();
551
+ Companion_getInstance_1();
552
+ Companion_getInstance_1();
553
+ var tmp$ret$9;
554
+ // Inline function 'kotlin.takeIf' call
555
+ var tmp2_takeIf = _this__u8e3s4.mi_1;
556
+ // Inline function 'kotlin.contracts.contract' call
557
+ var tmp_12;
558
+ var tmp$ret$8;
559
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
560
+ tmp$ret$8 = isInt(tmp2_takeIf, $this);
561
+ if (tmp$ret$8) {
562
+ tmp_12 = tmp2_takeIf;
563
+ } else {
564
+ tmp_12 = null;
565
+ }
566
+ tmp$ret$9 = tmp_12;
567
+ var tmp10_elvis_lhs = tmp$ret$9;
568
+ var tmp_13 = tmp10_elvis_lhs == null ? 'status' : tmp10_elvis_lhs;
569
+ Companion_getInstance_1();
570
+ Companion_getInstance_1();
571
+ Companion_getInstance_1();
572
+ Companion_getInstance_1();
573
+ Companion_getInstance_1();
574
+ Companion_getInstance_1();
575
+ var tmp11_safe_receiver = _this__u8e3s4.ni_1;
576
+ var tmp_14;
577
+ if (tmp11_safe_receiver == null) {
578
+ tmp_14 = null;
579
+ } else {
580
+ var tmp$ret$11;
581
+ // Inline function 'kotlin.let' call
582
+ // Inline function 'kotlin.contracts.contract' call
583
+ var tmp$ret$10;
584
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
585
+ tmp$ret$10 = 'new WirespecShared.Content("' + tmp11_safe_receiver.vh_1 + '", body)';
586
+ tmp$ret$11 = tmp$ret$10;
587
+ tmp_14 = tmp$ret$11;
588
+ }
589
+ var tmp12_elvis_lhs = tmp_14;
590
+ var tmp_15 = tmp12_elvis_lhs == null ? 'null' : tmp12_elvis_lhs;
591
+ Companion_getInstance_1();
592
+ Companion_getInstance_1();
593
+ Companion_getInstance_1();
594
+ Companion_getInstance_1();
595
+ Companion_getInstance_1();
596
+ Companion_getInstance_1();
597
+ Companion_getInstance_1();
598
+ Companion_getInstance_1();
599
+ var tmp13_safe_receiver = _this__u8e3s4.ni_1;
600
+ var tmp14_safe_receiver = tmp13_safe_receiver == null ? null : tmp13_safe_receiver.wh_1;
601
+ var tmp15_elvis_lhs = tmp14_safe_receiver == null ? null : $this.di(tmp14_safe_receiver);
602
+ var tmp_16 = tmp15_elvis_lhs == null ? 'Void' : tmp15_elvis_lhs;
603
+ Companion_getInstance_1();
604
+ return trimMargin('\n |' + ' ' + 'class Response' + tmp + tmp_0 + ' implements Response' + tmp_2 + '<' + tmp_3 + '> {\n |' + ' ' + ' ' + 'private final int status;\n |' + ' ' + ' ' + 'private final java.util.Map<String, java.util.List<Object>> headers;\n |' + ' ' + ' ' + 'private final WirespecShared.Content<' + tmp_4 + '> content;\n |' + ' ' + ' ' + 'public Response' + tmp_5 + tmp_6 + '(' + tmp_9 + 'java.util.Map<String, java.util.List<Object>> headers' + tmp_11 + ') {\n |' + ' ' + ' ' + ' ' + 'this.status = ' + tmp_13 + ';\n |' + ' ' + ' ' + ' ' + 'this.headers = headers;\n |' + ' ' + ' ' + ' ' + 'this.content = ' + tmp_15 + ';\n |' + ' ' + ' ' + '}\n |' + ' ' + ' ' + '@Override public int getStatus() {return status;}\n |' + ' ' + ' ' + '@Override public java.util.Map<String, java.util.List<Object>> getHeaders() {return headers;}\n |' + ' ' + ' ' + '@Override public WirespecShared.Content<' + tmp_16 + '> getContent() {return content;}\n |' + ' ' + '}\n ');
605
+ }
606
+ function emitResponseMapper(_this__u8e3s4, $this) {
607
+ Companion_getInstance_1();
608
+ var tmp = joinToString(_this__u8e3s4, '', VOID, VOID, VOID, VOID, JavaEmitter$emitResponseMapper$lambda($this));
609
+ Companion_getInstance_1();
610
+ Companion_getInstance_1();
611
+ Companion_getInstance_1();
612
+ return trimMargin('\n |' + ' ' + 'static <B> Response RESPONSE_MAPPER(WirespecShared.ContentMapper<B> contentMapper, int status, java.util.Map<String, java.util.List<Object>> headers, WirespecShared.Content<B> content) {\n |' + tmp + '\n |' + ' ' + ' ' + 'throw new IllegalStateException("Unknown response type");\n |' + ' ' + '}\n ');
613
+ }
614
+ function emitResponseMapperCondition(_this__u8e3s4, $this) {
615
+ var tmp0_subject = _this__u8e3s4.ni_1;
616
+ var tmp;
617
+ if (tmp0_subject == null) {
618
+ Companion_getInstance_1();
619
+ Companion_getInstance_1();
620
+ Companion_getInstance_1();
621
+ var tmp$ret$1;
622
+ // Inline function 'kotlin.takeIf' call
623
+ var tmp0_takeIf = _this__u8e3s4.mi_1;
624
+ // Inline function 'kotlin.contracts.contract' call
625
+ var tmp_0;
626
+ var tmp$ret$0;
627
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
628
+ tmp$ret$0 = isInt(tmp0_takeIf, $this);
629
+ if (tmp$ret$0) {
630
+ tmp_0 = tmp0_takeIf;
631
+ } else {
632
+ tmp_0 = null;
633
+ }
634
+ tmp$ret$1 = tmp_0;
635
+ var tmp1_safe_receiver = tmp$ret$1;
636
+ var tmp_1;
637
+ if (tmp1_safe_receiver == null) {
638
+ tmp_1 = null;
639
+ } else {
640
+ var tmp$ret$3;
641
+ // Inline function 'kotlin.let' call
642
+ // Inline function 'kotlin.contracts.contract' call
643
+ var tmp$ret$2;
644
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
645
+ tmp$ret$2 = 'status == ' + _this__u8e3s4.mi_1 + ' && ';
646
+ tmp$ret$3 = tmp$ret$2;
647
+ tmp_1 = tmp$ret$3;
648
+ }
649
+ var tmp_2 = orEmptyString(tmp_1, $this);
650
+ var tmp_3 = Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
651
+ var tmp$ret$5;
652
+ // Inline function 'kotlin.takeIf' call
653
+ var tmp1_takeIf = _this__u8e3s4.mi_1;
654
+ // Inline function 'kotlin.contracts.contract' call
655
+ var tmp_4;
656
+ var tmp$ret$4;
657
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
658
+ tmp$ret$4 = !isInt(tmp1_takeIf, $this);
659
+ if (tmp$ret$4) {
660
+ tmp_4 = tmp1_takeIf;
661
+ } else {
662
+ tmp_4 = null;
663
+ }
664
+ tmp$ret$5 = tmp_4;
665
+ var tmp2_safe_receiver = tmp$ret$5;
666
+ var tmp_5;
667
+ if (tmp2_safe_receiver == null) {
668
+ tmp_5 = null;
669
+ } else {
670
+ var tmp$ret$7;
671
+ // Inline function 'kotlin.let' call
672
+ // Inline function 'kotlin.contracts.contract' call
673
+ var tmp$ret$6;
674
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
675
+ tmp$ret$6 = 'status, ';
676
+ tmp$ret$7 = tmp$ret$6;
677
+ tmp_5 = tmp$ret$7;
678
+ }
679
+ tmp = trimMargin('\n |' + ' ' + ' ' + ' ' + 'if(' + tmp_2 + 'content == null) { return new Response' + tmp_3 + 'Void(' + orEmptyString(tmp_5, $this) + 'headers); }\n |\n ');
680
+ } else {
681
+ Companion_getInstance_1();
682
+ Companion_getInstance_1();
683
+ Companion_getInstance_1();
684
+ var tmp$ret$9;
685
+ // Inline function 'kotlin.takeIf' call
686
+ var tmp2_takeIf = _this__u8e3s4.mi_1;
687
+ // Inline function 'kotlin.contracts.contract' call
688
+ var tmp_6;
689
+ var tmp$ret$8;
690
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
691
+ tmp$ret$8 = isInt(tmp2_takeIf, $this);
692
+ if (tmp$ret$8) {
693
+ tmp_6 = tmp2_takeIf;
694
+ } else {
695
+ tmp_6 = null;
696
+ }
697
+ tmp$ret$9 = tmp_6;
698
+ var tmp3_safe_receiver = tmp$ret$9;
699
+ var tmp_7;
700
+ if (tmp3_safe_receiver == null) {
701
+ tmp_7 = null;
702
+ } else {
703
+ var tmp$ret$11;
704
+ // Inline function 'kotlin.let' call
705
+ // Inline function 'kotlin.contracts.contract' call
706
+ var tmp$ret$10;
707
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
708
+ tmp$ret$10 = 'status == ' + _this__u8e3s4.mi_1 + ' && ';
709
+ tmp$ret$11 = tmp$ret$10;
710
+ tmp_7 = tmp$ret$11;
711
+ }
712
+ var tmp_8 = orEmptyString(tmp_7, $this);
713
+ Companion_getInstance_1();
714
+ Companion_getInstance_1();
715
+ Companion_getInstance_1();
716
+ Companion_getInstance_1();
717
+ var tmp_9 = $this.di(_this__u8e3s4.ni_1.wh_1);
718
+ var tmp_10 = emitPrimaryType(_this__u8e3s4.ni_1.wh_1, $this);
719
+ var tmp_11 = _this__u8e3s4.ni_1.wh_1.qi();
720
+ Companion_getInstance_1();
721
+ Companion_getInstance_1();
722
+ Companion_getInstance_1();
723
+ Companion_getInstance_1();
724
+ var tmp_12 = Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
725
+ var tmp_13 = emitContentType(_this__u8e3s4.ni_1, $this);
726
+ var tmp$ret$13;
727
+ // Inline function 'kotlin.takeIf' call
728
+ var tmp3_takeIf = _this__u8e3s4.mi_1;
729
+ // Inline function 'kotlin.contracts.contract' call
730
+ var tmp_14;
731
+ var tmp$ret$12;
732
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
733
+ tmp$ret$12 = !isInt(tmp3_takeIf, $this);
734
+ if (tmp$ret$12) {
735
+ tmp_14 = tmp3_takeIf;
736
+ } else {
737
+ tmp_14 = null;
738
+ }
739
+ tmp$ret$13 = tmp_14;
740
+ var tmp4_safe_receiver = tmp$ret$13;
741
+ var tmp_15;
742
+ if (tmp4_safe_receiver == null) {
743
+ tmp_15 = null;
744
+ } else {
745
+ var tmp$ret$15;
746
+ // Inline function 'kotlin.let' call
747
+ // Inline function 'kotlin.contracts.contract' call
748
+ var tmp$ret$14;
749
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitResponseMapperCondition.<anonymous>' call
750
+ tmp$ret$14 = 'status, ';
751
+ tmp$ret$15 = tmp$ret$14;
752
+ tmp_15 = tmp$ret$15;
753
+ }
754
+ var tmp_16 = orEmptyString(tmp_15, $this);
755
+ Companion_getInstance_1();
756
+ Companion_getInstance_1();
757
+ Companion_getInstance_1();
758
+ tmp = trimMargin('\n |' + ' ' + ' ' + ' ' + 'if(' + tmp_8 + 'content.type().equals("' + _this__u8e3s4.ni_1.vh_1 + '")) {\n |' + ' ' + ' ' + ' ' + ' ' + 'WirespecShared.Content<' + tmp_9 + '> c = contentMapper.read(content, WirespecShared.getType(' + tmp_10 + '.class, ' + tmp_11 + '));\n |' + ' ' + ' ' + ' ' + ' ' + 'return new Response' + tmp_12 + tmp_13 + '(' + tmp_16 + 'headers, c.body());\n |' + ' ' + ' ' + ' ' + '}\n |\n ');
759
+ }
760
+ return tmp;
761
+ }
762
+ function emitContentType(_this__u8e3s4, $this) {
763
+ var tmp0_safe_receiver = _this__u8e3s4;
764
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.vh_1;
765
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : split(tmp1_safe_receiver, ['/']);
766
+ var tmp;
767
+ if (tmp2_safe_receiver == null) {
768
+ tmp = null;
769
+ } else {
770
+ tmp = joinToString(tmp2_safe_receiver, '', VOID, VOID, VOID, VOID, JavaEmitter$emitContentType$lambda);
771
+ }
772
+ var tmp3_elvis_lhs = tmp;
773
+ return tmp3_elvis_lhs == null ? 'Void' : tmp3_elvis_lhs;
774
+ }
775
+ function emit_1(_this__u8e3s4, $this) {
776
+ return $this.ri(_this__u8e3s4, $this.oh_1, JavaEmitter$emit$lambda_8(_this__u8e3s4));
777
+ }
778
+ function emitRequestSignature(_this__u8e3s4, $this, content) {
779
+ var tmp$ret$4;
780
+ // Inline function 'kotlin.collections.map' call
781
+ var tmp$ret$1;
782
+ // Inline function 'kotlin.collections.filterIsInstance' call
783
+ var tmp1_filterIsInstance = _this__u8e3s4.gi_1;
784
+ var tmp$ret$0;
785
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
786
+ var tmp0_filterIsInstanceTo = ArrayList_init_$Create$();
787
+ var tmp0_iterator = tmp1_filterIsInstance.c();
788
+ while (tmp0_iterator.d()) {
789
+ var element = tmp0_iterator.e();
790
+ if (element instanceof Param) {
791
+ tmp0_filterIsInstanceTo.a(element);
792
+ }
793
+ }
794
+ tmp$ret$0 = tmp0_filterIsInstanceTo;
795
+ tmp$ret$1 = tmp$ret$0;
796
+ var tmp3_map = tmp$ret$1;
797
+ var tmp$ret$3;
798
+ // Inline function 'kotlin.collections.mapTo' call
799
+ var tmp2_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp3_map, 10));
800
+ var tmp0_iterator_0 = tmp3_map.c();
801
+ while (tmp0_iterator_0.d()) {
802
+ var item = tmp0_iterator_0.e();
803
+ var tmp$ret$2;
804
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emitRequestSignature.<anonymous>' call
805
+ tmp$ret$2 = new Field(item.si_1, item.ti_1, false);
806
+ tmp2_mapTo.a(tmp$ret$2);
807
+ }
808
+ tmp$ret$3 = tmp2_mapTo;
809
+ tmp$ret$4 = tmp$ret$3;
810
+ var pathField = tmp$ret$4;
811
+ var parameters = plus(plus(plus(pathField, _this__u8e3s4.hi_1), _this__u8e3s4.ii_1), _this__u8e3s4.ji_1);
812
+ var tmp0_safe_receiver = content;
813
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.wh_1;
814
+ var tmp = filterNotNull(plus_0(parameters, tmp1_safe_receiver == null ? null : toField(tmp1_safe_receiver, 'body', false)));
815
+ return joinToString(tmp, ', ', VOID, VOID, VOID, VOID, JavaEmitter$emitRequestSignature$lambda($this));
816
+ }
817
+ function emitMap(_this__u8e3s4, $this) {
818
+ return joinToString(_this__u8e3s4, ', ', 'java.util.Map.of(', ')', VOID, VOID, JavaEmitter$emitMap$lambda($this));
819
+ }
820
+ function emitSegment(_this__u8e3s4, $this) {
821
+ return '/' + joinToString(_this__u8e3s4, '/', VOID, VOID, VOID, VOID, JavaEmitter$emitSegment$lambda);
822
+ }
823
+ function emitPath(_this__u8e3s4, $this) {
824
+ return '"/" + ' + joinToString(_this__u8e3s4, ' + "/" + ', VOID, VOID, VOID, VOID, JavaEmitter$emitPath$lambda($this));
825
+ }
826
+ function orEmptyString(_this__u8e3s4, $this) {
827
+ var tmp0_elvis_lhs = _this__u8e3s4;
828
+ return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
829
+ }
830
+ function isInt(_this__u8e3s4, $this) {
831
+ return !(toIntOrNull(_this__u8e3s4) == null);
832
+ }
833
+ function groupStatus(_this__u8e3s4, $this) {
834
+ var tmp;
835
+ if (isInt(_this__u8e3s4, $this)) {
836
+ var tmp$ret$1;
837
+ // Inline function 'kotlin.text.substring' call
838
+ var tmp$ret$0;
839
+ // Inline function 'kotlin.js.asDynamic' call
840
+ tmp$ret$0 = _this__u8e3s4;
841
+ tmp$ret$1 = tmp$ret$0.substring(0, 1);
842
+ tmp = tmp$ret$1 + 'XX';
843
+ } else {
844
+ tmp = Companion_getInstance_1().pi(_this__u8e3s4);
845
+ }
846
+ return tmp;
847
+ }
848
+ function JavaEmitter$emit$lambda($this_emit, this$0) {
849
+ return function () {
850
+ return trimMargin('public record ' + $this_emit.ui_1 + '(\n |' + this$0.wi($this_emit.vi_1) + '\n |) {};\n |');
851
+ };
852
+ }
853
+ function JavaEmitter$emit$lambda$lambda(this$0) {
854
+ return function (it) {
855
+ return this$0.xi(it);
856
+ };
857
+ }
858
+ function JavaEmitter$emit$lambda_0($this_emit, this$0) {
859
+ return function () {
860
+ return joinToString($this_emit.yi_1, ',\n', VOID, VOID, VOID, VOID, JavaEmitter$emit$lambda$lambda(this$0));
861
+ };
862
+ }
863
+ function JavaEmitter$emit$lambda_1($this_emit, this$0) {
864
+ return function () {
865
+ Companion_getInstance_1();
866
+ return ' ' + ($this_emit.bj_1 ? 'java.util.Optional<' + this$0.di($this_emit.aj_1) + '>' : this$0.di($this_emit.aj_1)) + ' ' + this$0.cj($this_emit.zi_1);
867
+ };
868
+ }
869
+ function JavaEmitter$emit$lambda_2($this_emit) {
870
+ return function () {
871
+ return $this_emit.dj_1;
872
+ };
873
+ }
874
+ function JavaEmitter$emitPrimaryType$lambda($this_emitPrimaryType) {
875
+ return function () {
876
+ var tmp0_subject = $this_emitPrimaryType;
877
+ var tmp;
878
+ if (tmp0_subject instanceof Custom) {
879
+ tmp = $this_emitPrimaryType.gj_1;
880
+ } else {
881
+ if (tmp0_subject instanceof Primitive) {
882
+ var tmp1_subject = $this_emitPrimaryType.ej_1;
883
+ var tmp0 = tmp1_subject.q4_1;
884
+ var tmp_0;
885
+ switch (tmp0) {
886
+ case 0:
887
+ tmp_0 = 'String';
888
+ break;
889
+ case 1:
890
+ tmp_0 = 'Integer';
891
+ break;
892
+ case 2:
893
+ tmp_0 = 'Boolean';
894
+ break;
895
+ default:
896
+ noWhenBranchMatchedException();
897
+ break;
898
+ }
899
+ tmp = tmp_0;
900
+ } else {
901
+ noWhenBranchMatchedException();
902
+ }
903
+ }
904
+ return tmp;
905
+ };
906
+ }
907
+ function JavaEmitter$emit$lambda_3(this$0, $this_emit) {
908
+ return function () {
909
+ var tmp$ret$1;
910
+ // Inline function 'kotlin.let' call
911
+ var tmp0_let = emitPrimaryType($this_emit, this$0);
912
+ // Inline function 'kotlin.contracts.contract' call
913
+ var tmp$ret$0;
914
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>.<anonymous>' call
915
+ tmp$ret$0 = $this_emit.qi() ? 'java.util.List<' + tmp0_let + '>' : tmp0_let;
916
+ tmp$ret$1 = tmp$ret$0;
917
+ return tmp$ret$1;
918
+ };
919
+ }
920
+ function JavaEmitter$emit$lambda_4($this_emit) {
921
+ return function () {
922
+ Companion_getInstance_1();
923
+ return 'enum ' + $this_emit.ij_1 + ' {\n' + ' ' + joinToString($this_emit.jj_1, ', ') + ';\n}\n';
924
+ };
925
+ }
926
+ function JavaEmitter$emit$lambda_5($this_emit, this$0) {
927
+ return function () {
928
+ Companion_getInstance_1();
929
+ Companion_getInstance_1();
930
+ var tmp = this$0.mj($this_emit.lj_1);
931
+ Companion_getInstance_1();
932
+ return trimMargin('public record ' + $this_emit.kj_1 + '(String value) {\n |' + ' ' + 'static void validate(' + $this_emit.kj_1 + ' record) {\n |' + ' ' + tmp + '\n |' + ' ' + '}\n |}\n |');
933
+ };
934
+ }
935
+ function JavaEmitter$emit$lambda_6($this_emit) {
936
+ return function () {
937
+ Companion_getInstance_1();
938
+ return ' ' + 'java.util.regex.Pattern.compile(' + $this_emit.nj_1 + ').matcher(record.value).find();';
939
+ };
940
+ }
941
+ function JavaEmitter$emit$lambda$lambda_0(this$0, $this_emit) {
942
+ return function (it) {
943
+ return emit(it, this$0, $this_emit);
944
+ };
945
+ }
946
+ function JavaEmitter$emit$lambda$lambda_1(it) {
947
+ Companion_getInstance_1();
948
+ return ' ' + 'interface Response' + it + '<T> extends Response<T>{};';
949
+ }
950
+ function JavaEmitter$emit$lambda$lambda_2(this$0) {
951
+ return function (it) {
952
+ Companion_getInstance_1();
953
+ return ' ' + 'interface Response' + it + '<T> extends Response' + groupStatus(it, this$0) + '<T>{};';
954
+ };
955
+ }
956
+ function JavaEmitter$emit$lambda$lambda_3(this$0) {
957
+ return function (it) {
958
+ return emit_0(it, this$0);
959
+ };
960
+ }
961
+ function JavaEmitter$emit$lambda_7($this_emit, this$0) {
962
+ return function () {
963
+ Companion_getInstance_1();
964
+ var tmp = emitSegment($this_emit.gi_1, this$0);
965
+ var tmp_0 = emitResponseMapper($this_emit.li_1, this$0);
966
+ Companion_getInstance_1();
967
+ var tmp_1 = joinToString($this_emit.ki_1, '\n', VOID, VOID, VOID, VOID, JavaEmitter$emit$lambda$lambda_0(this$0, $this_emit));
968
+ Companion_getInstance_1();
969
+ var tmp$ret$2;
970
+ // Inline function 'kotlin.collections.map' call
971
+ var tmp1_map = $this_emit.li_1;
972
+ var tmp$ret$1;
973
+ // Inline function 'kotlin.collections.mapTo' call
974
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
975
+ var tmp0_iterator = tmp1_map.c();
976
+ while (tmp0_iterator.d()) {
977
+ var item = tmp0_iterator.e();
978
+ var tmp$ret$0;
979
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>.<anonymous>' call
980
+ tmp$ret$0 = groupStatus(item.mi_1, this$0);
981
+ tmp0_mapTo.a(tmp$ret$0);
982
+ }
983
+ tmp$ret$1 = tmp0_mapTo;
984
+ tmp$ret$2 = tmp$ret$1;
985
+ var tmp_2 = toSet(tmp$ret$2);
986
+ var tmp_3 = joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, JavaEmitter$emit$lambda$lambda_1);
987
+ var tmp$ret$8;
988
+ // Inline function 'kotlin.collections.map' call
989
+ var tmp$ret$5;
990
+ // Inline function 'kotlin.collections.filter' call
991
+ var tmp3_filter = $this_emit.li_1;
992
+ var tmp$ret$4;
993
+ // Inline function 'kotlin.collections.filterTo' call
994
+ var tmp2_filterTo = ArrayList_init_$Create$();
995
+ var tmp0_iterator_0 = tmp3_filter.c();
996
+ while (tmp0_iterator_0.d()) {
997
+ var element = tmp0_iterator_0.e();
998
+ var tmp$ret$3;
999
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>.<anonymous>' call
1000
+ tmp$ret$3 = isInt(element.mi_1, this$0);
1001
+ if (tmp$ret$3) {
1002
+ tmp2_filterTo.a(element);
1003
+ }
1004
+ }
1005
+ tmp$ret$4 = tmp2_filterTo;
1006
+ tmp$ret$5 = tmp$ret$4;
1007
+ var tmp5_map = tmp$ret$5;
1008
+ var tmp$ret$7;
1009
+ // Inline function 'kotlin.collections.mapTo' call
1010
+ var tmp4_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp5_map, 10));
1011
+ var tmp0_iterator_1 = tmp5_map.c();
1012
+ while (tmp0_iterator_1.d()) {
1013
+ var item_0 = tmp0_iterator_1.e();
1014
+ var tmp$ret$6;
1015
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>.<anonymous>' call
1016
+ tmp$ret$6 = item_0.mi_1;
1017
+ tmp4_mapTo.a(tmp$ret$6);
1018
+ }
1019
+ tmp$ret$7 = tmp4_mapTo;
1020
+ tmp$ret$8 = tmp$ret$7;
1021
+ var tmp_4 = tmp$ret$8;
1022
+ var tmp_5 = joinToString(tmp_4, '\n', VOID, VOID, VOID, VOID, JavaEmitter$emit$lambda$lambda_2(this$0));
1023
+ var tmp_6 = joinToString($this_emit.li_1, '\n', VOID, VOID, VOID, VOID, JavaEmitter$emit$lambda$lambda_3(this$0));
1024
+ Companion_getInstance_1();
1025
+ return trimMargin('public interface ' + $this_emit.ei_1 + ' {\n |' + ' ' + 'static String PATH = "' + tmp + '";\n |' + tmp_0 + '\n |' + ' ' + 'interface Request<T> extends WirespecShared.Request<T> {}\n |' + tmp_1 + '\n |' + ' ' + 'interface Response<T> extends WirespecShared.Response<T> {}\n |' + tmp_3 + '\n |' + tmp_5 + '\n |' + tmp_6 + '\n |' + ' ' + 'public Response ' + Companion_getInstance_1().oj($this_emit.ei_1) + '(Request request);\n |}\n |');
1026
+ };
1027
+ }
1028
+ function JavaEmitter$emitResponseMapper$lambda(this$0) {
1029
+ return function (it) {
1030
+ return emitResponseMapperCondition(it, this$0);
1031
+ };
1032
+ }
1033
+ function JavaEmitter$emitContentType$lambda(it) {
1034
+ return Companion_getInstance_1().pi(it);
1035
+ }
1036
+ function JavaEmitter$emit$lambda_8($this_emit) {
1037
+ return function () {
1038
+ var tmp0_subject = $this_emit;
1039
+ var tmp;
1040
+ if (tmp0_subject instanceof Literal) {
1041
+ tmp = '"' + $this_emit.pj_1 + '"';
1042
+ } else {
1043
+ if (tmp0_subject instanceof Param) {
1044
+ tmp = $this_emit.si_1.dj_1;
1045
+ } else {
1046
+ noWhenBranchMatchedException();
1047
+ }
1048
+ }
1049
+ return tmp;
1050
+ };
1051
+ }
1052
+ function JavaEmitter$emitRequestSignature$lambda(this$0) {
1053
+ return function (it) {
1054
+ return this$0.xi(it);
1055
+ };
1056
+ }
1057
+ function JavaEmitter$emitMap$lambda(this$0) {
1058
+ return function (it) {
1059
+ return '"' + this$0.cj(it.zi_1) + '", java.util.List.of(' + this$0.cj(it.zi_1) + ')';
1060
+ };
1061
+ }
1062
+ function JavaEmitter$emitSegment$lambda(it) {
1063
+ var tmp0_subject = it;
1064
+ var tmp;
1065
+ if (tmp0_subject instanceof Param) {
1066
+ tmp = '{' + it.si_1.dj_1 + '}';
1067
+ } else {
1068
+ if (tmp0_subject instanceof Literal) {
1069
+ tmp = it.pj_1;
1070
+ } else {
1071
+ noWhenBranchMatchedException();
1072
+ }
1073
+ }
1074
+ return tmp;
1075
+ }
1076
+ function JavaEmitter$emitPath$lambda(this$0) {
1077
+ return function (it) {
1078
+ return emit_1(it, this$0);
1079
+ };
1080
+ }
1081
+ function JavaEmitter(packageName, logger) {
1082
+ packageName = packageName === VOID ? get_DEFAULT_PACKAGE_NAME() : packageName;
1083
+ logger = logger === VOID ? get_noLogger() : logger;
1084
+ Emitter.call(this, logger, true);
1085
+ this.ai_1 = packageName;
1086
+ var tmp = this;
1087
+ Companion_getInstance_1();
1088
+ Companion_getInstance_1();
1089
+ Companion_getInstance_1();
1090
+ Companion_getInstance_1();
1091
+ Companion_getInstance_1();
1092
+ Companion_getInstance_1();
1093
+ Companion_getInstance_1();
1094
+ Companion_getInstance_1();
1095
+ Companion_getInstance_1();
1096
+ Companion_getInstance_1();
1097
+ Companion_getInstance_1();
1098
+ Companion_getInstance_1();
1099
+ Companion_getInstance_1();
1100
+ Companion_getInstance_1();
1101
+ Companion_getInstance_1();
1102
+ Companion_getInstance_1();
1103
+ Companion_getInstance_1();
1104
+ Companion_getInstance_1();
1105
+ Companion_getInstance_1();
1106
+ Companion_getInstance_1();
1107
+ Companion_getInstance_1();
1108
+ Companion_getInstance_1();
1109
+ Companion_getInstance_1();
1110
+ Companion_getInstance_1();
1111
+ Companion_getInstance_1();
1112
+ Companion_getInstance_1();
1113
+ Companion_getInstance_1();
1114
+ Companion_getInstance_1();
1115
+ Companion_getInstance_1();
1116
+ Companion_getInstance_1();
1117
+ Companion_getInstance_1();
1118
+ Companion_getInstance_1();
1119
+ Companion_getInstance_1();
1120
+ Companion_getInstance_1();
1121
+ Companion_getInstance_1();
1122
+ Companion_getInstance_1();
1123
+ tmp.bi_1 = trimMargin('\n |import java.lang.reflect.Type;\n |import java.lang.reflect.ParameterizedType;\n |\n |public interface WirespecShared {\n |' + ' ' + 'enum Method { GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE };\n |' + ' ' + 'record Content<T> (String type, T body) {};\n |' + ' ' + 'interface Request<T> { String getPath(); Method getMethod(); java.util.Map<String, java.util.List<Object>> getQuery(); java.util.Map<String, java.util.List<Object>> getHeaders(); Content<T> getContent(); }\n |' + ' ' + 'interface Response<T> { int getStatus(); java.util.Map<String, java.util.List<Object>> getHeaders(); Content<T> getContent(); }\n |' + ' ' + 'interface ContentMapper<B> { <T> Content<T> read(Content<B> content, Type valueType); <T> Content<B> write(Content<T> content); }\n |' + ' ' + 'static Type getType(final Class<?> type, final boolean isIterable) {\n |' + ' ' + ' ' + 'if(isIterable) {\n |' + ' ' + ' ' + ' ' + 'return new ParameterizedType() {\n |' + ' ' + ' ' + ' ' + ' ' + 'public Type getRawType() {return java.util.List.class;}\n |' + ' ' + ' ' + ' ' + ' ' + 'public Type[] getActualTypeArguments() {Class<?>[] types = {type};return types;}\n |' + ' ' + ' ' + ' ' + ' ' + 'public Type getOwnerType() {return null;}\n |' + ' ' + ' ' + ' ' + '};\n |' + ' ' + ' ' + '}\n |' + ' ' + ' ' + 'else {\n |' + ' ' + ' ' + ' ' + 'return type;\n |' + ' ' + ' ' + '}\n |' + ' ' + '}\n |}\n ');
1124
+ this.ci_1 = isBlank(this.ai_1) ? '' : 'package ' + this.ai_1 + ';';
1125
+ }
1126
+ protoOf(JavaEmitter).qh = function (ast) {
1127
+ var tmp$ret$2;
1128
+ // Inline function 'kotlin.collections.map' call
1129
+ var tmp1_map = protoOf(Emitter).qh.call(this, ast);
1130
+ var tmp$ret$1;
1131
+ // Inline function 'kotlin.collections.mapTo' call
1132
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
1133
+ var tmp0_iterator = tmp1_map.c();
1134
+ while (tmp0_iterator.d()) {
1135
+ var item = tmp0_iterator.e();
1136
+ var tmp$ret$0;
1137
+ // Inline function 'community.flock.wirespec.compiler.core.emit.JavaEmitter.emit.<anonymous>' call
1138
+ var name = item.i3();
1139
+ var result = item.j3();
1140
+ tmp$ret$0 = to(name, this.ci_1 + '\n\n' + result);
1141
+ tmp0_mapTo.a(tmp$ret$0);
1142
+ }
1143
+ tmp$ret$1 = tmp0_mapTo;
1144
+ tmp$ret$2 = tmp$ret$1;
1145
+ return plus_0(tmp$ret$2, to('WirespecShared', this.ci_1 + '\n\n' + this.bi_1));
1146
+ };
1147
+ protoOf(JavaEmitter).qj = function (_this__u8e3s4) {
1148
+ return this.rj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda(_this__u8e3s4, this));
1149
+ };
1150
+ protoOf(JavaEmitter).wi = function (_this__u8e3s4) {
1151
+ return this.sj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_0(_this__u8e3s4, this));
1152
+ };
1153
+ protoOf(JavaEmitter).xi = function (_this__u8e3s4) {
1154
+ return this.tj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_1(_this__u8e3s4, this));
1155
+ };
1156
+ protoOf(JavaEmitter).cj = function (_this__u8e3s4) {
1157
+ return this.uj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_2(_this__u8e3s4));
1158
+ };
1159
+ protoOf(JavaEmitter).di = function (_this__u8e3s4) {
1160
+ return this.th(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_3(this, _this__u8e3s4));
1161
+ };
1162
+ protoOf(JavaEmitter).vj = function (_this__u8e3s4) {
1163
+ return this.wj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_4(_this__u8e3s4));
1164
+ };
1165
+ protoOf(JavaEmitter).xj = function (_this__u8e3s4) {
1166
+ return this.yj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_5(_this__u8e3s4, this));
1167
+ };
1168
+ protoOf(JavaEmitter).mj = function (_this__u8e3s4) {
1169
+ return this.zj(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_6(_this__u8e3s4));
1170
+ };
1171
+ protoOf(JavaEmitter).ak = function (_this__u8e3s4) {
1172
+ return this.bk(_this__u8e3s4, this.oh_1, JavaEmitter$emit$lambda_7(_this__u8e3s4, this));
1173
+ };
1174
+ function emitRequestSignature_0(_this__u8e3s4, $this, content) {
1175
+ var tmp$ret$4;
1176
+ // Inline function 'kotlin.collections.map' call
1177
+ var tmp$ret$1;
1178
+ // Inline function 'kotlin.collections.filterIsInstance' call
1179
+ var tmp1_filterIsInstance = _this__u8e3s4.gi_1;
1180
+ var tmp$ret$0;
1181
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
1182
+ var tmp0_filterIsInstanceTo = ArrayList_init_$Create$();
1183
+ var tmp0_iterator = tmp1_filterIsInstance.c();
1184
+ while (tmp0_iterator.d()) {
1185
+ var element = tmp0_iterator.e();
1186
+ if (element instanceof Param) {
1187
+ tmp0_filterIsInstanceTo.a(element);
1188
+ }
1189
+ }
1190
+ tmp$ret$0 = tmp0_filterIsInstanceTo;
1191
+ tmp$ret$1 = tmp$ret$0;
1192
+ var tmp3_map = tmp$ret$1;
1193
+ var tmp$ret$3;
1194
+ // Inline function 'kotlin.collections.mapTo' call
1195
+ var tmp2_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp3_map, 10));
1196
+ var tmp0_iterator_0 = tmp3_map.c();
1197
+ while (tmp0_iterator_0.d()) {
1198
+ var item = tmp0_iterator_0.e();
1199
+ var tmp$ret$2;
1200
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitRequestSignature.<anonymous>' call
1201
+ tmp$ret$2 = new Field(item.si_1, item.ti_1, false);
1202
+ tmp2_mapTo.a(tmp$ret$2);
1203
+ }
1204
+ tmp$ret$3 = tmp2_mapTo;
1205
+ tmp$ret$4 = tmp$ret$3;
1206
+ var pathField = tmp$ret$4;
1207
+ var parameters = plus(plus(plus(pathField, _this__u8e3s4.hi_1), _this__u8e3s4.ii_1), _this__u8e3s4.ji_1);
1208
+ var tmp0_safe_receiver = content;
1209
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.wh_1;
1210
+ var tmp = filterNotNull(plus_0(parameters, tmp1_safe_receiver == null ? null : toField(tmp1_safe_receiver, 'body', false)));
1211
+ return trimMargin('\n |(' + joinToString(tmp, ', ', VOID, VOID, VOID, VOID, KotlinEmitter$emitRequestSignature$lambda($this)) + ')\n ');
1212
+ }
1213
+ function emitSegment_0(_this__u8e3s4, $this) {
1214
+ return '/' + joinToString(_this__u8e3s4, '/', VOID, VOID, VOID, VOID, KotlinEmitter$emitSegment$lambda);
1215
+ }
1216
+ function emitMap_0(_this__u8e3s4, $this) {
1217
+ return joinToString(_this__u8e3s4, ', ', VOID, VOID, VOID, VOID, KotlinEmitter$emitMap$lambda($this));
1218
+ }
1219
+ function emit_2(_this__u8e3s4, $this) {
1220
+ return $this.ri(_this__u8e3s4, $this.oh_1, KotlinEmitter$emit$lambda_8(_this__u8e3s4));
1221
+ }
1222
+ function emitPath_0(_this__u8e3s4, $this) {
1223
+ return '/' + joinToString(_this__u8e3s4, '/', VOID, VOID, VOID, VOID, KotlinEmitter$emitPath$lambda($this));
1224
+ }
1225
+ function emitResponseMapper_0(_this__u8e3s4, $this) {
1226
+ Companion_getInstance_1();
1227
+ Companion_getInstance_1();
1228
+ Companion_getInstance_1();
1229
+ var tmp$ret$2;
1230
+ // Inline function 'kotlin.collections.filter' call
1231
+ var tmp$ret$1;
1232
+ // Inline function 'kotlin.collections.filterTo' call
1233
+ var tmp0_filterTo = ArrayList_init_$Create$();
1234
+ var tmp0_iterator = _this__u8e3s4.c();
1235
+ while (tmp0_iterator.d()) {
1236
+ var element = tmp0_iterator.e();
1237
+ var tmp$ret$0;
1238
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapper.<anonymous>' call
1239
+ tmp$ret$0 = Companion_getInstance_1().ck(element.mi_1);
1240
+ if (tmp$ret$0) {
1241
+ tmp0_filterTo.a(element);
1242
+ }
1243
+ }
1244
+ tmp$ret$1 = tmp0_filterTo;
1245
+ tmp$ret$2 = tmp$ret$1;
1246
+ var tmp = tmp$ret$2;
1247
+ var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emitResponseMapper$lambda($this));
1248
+ var tmp$ret$5;
1249
+ // Inline function 'kotlin.collections.filter' call
1250
+ var tmp$ret$4;
1251
+ // Inline function 'kotlin.collections.filterTo' call
1252
+ var tmp1_filterTo = ArrayList_init_$Create$();
1253
+ var tmp0_iterator_0 = _this__u8e3s4.c();
1254
+ while (tmp0_iterator_0.d()) {
1255
+ var element_0 = tmp0_iterator_0.e();
1256
+ var tmp$ret$3;
1257
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapper.<anonymous>' call
1258
+ tmp$ret$3 = !Companion_getInstance_1().ck(element_0.mi_1);
1259
+ if (tmp$ret$3) {
1260
+ tmp1_filterTo.a(element_0);
1261
+ }
1262
+ }
1263
+ tmp$ret$4 = tmp1_filterTo;
1264
+ tmp$ret$5 = tmp$ret$4;
1265
+ var tmp_1 = tmp$ret$5;
1266
+ var tmp_2 = joinToString(tmp_1, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emitResponseMapper$lambda_0($this));
1267
+ Companion_getInstance_1();
1268
+ Companion_getInstance_1();
1269
+ Companion_getInstance_1();
1270
+ return trimMargin('\n |fun <B> RESPONSE_MAPPER(contentMapper: WirespecShared.ContentMapper<B>) =\n |' + ' ' + 'fun(status: Int, headers:Map<String, List<Any?>>, content: WirespecShared.Content<B>?) =\n |' + ' ' + ' ' + 'when {\n |' + tmp_0 + '\n |' + tmp_2 + '\n |' + ' ' + ' ' + ' ' + 'else -> error("Cannot map response with status $status")\n ');
1271
+ }
1272
+ function emitResponseMapperCondition_0(_this__u8e3s4, $this) {
1273
+ var tmp0_subject = _this__u8e3s4.ni_1;
1274
+ var tmp;
1275
+ if (tmp0_subject == null) {
1276
+ Companion_getInstance_1();
1277
+ Companion_getInstance_1();
1278
+ Companion_getInstance_1();
1279
+ var tmp$ret$1;
1280
+ // Inline function 'kotlin.takeIf' call
1281
+ var tmp0_takeIf = _this__u8e3s4.mi_1;
1282
+ // Inline function 'kotlin.contracts.contract' call
1283
+ var tmp_0;
1284
+ var tmp$ret$0;
1285
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1286
+ tmp$ret$0 = Companion_getInstance_1().ck(tmp0_takeIf);
1287
+ if (tmp$ret$0) {
1288
+ tmp_0 = tmp0_takeIf;
1289
+ } else {
1290
+ tmp_0 = null;
1291
+ }
1292
+ tmp$ret$1 = tmp_0;
1293
+ var tmp1_safe_receiver = tmp$ret$1;
1294
+ var tmp_1;
1295
+ if (tmp1_safe_receiver == null) {
1296
+ tmp_1 = null;
1297
+ } else {
1298
+ var tmp$ret$3;
1299
+ // Inline function 'kotlin.let' call
1300
+ // Inline function 'kotlin.contracts.contract' call
1301
+ var tmp$ret$2;
1302
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1303
+ tmp$ret$2 = 'status == ' + _this__u8e3s4.mi_1 + ' && ';
1304
+ tmp$ret$3 = tmp$ret$2;
1305
+ tmp_1 = tmp$ret$3;
1306
+ }
1307
+ var tmp_2 = orEmptyString_0(tmp_1);
1308
+ var tmp_3 = Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
1309
+ var tmp$ret$5;
1310
+ // Inline function 'kotlin.takeIf' call
1311
+ var tmp1_takeIf = _this__u8e3s4.mi_1;
1312
+ // Inline function 'kotlin.contracts.contract' call
1313
+ var tmp_4;
1314
+ var tmp$ret$4;
1315
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1316
+ tmp$ret$4 = !Companion_getInstance_1().ck(tmp1_takeIf);
1317
+ if (tmp$ret$4) {
1318
+ tmp_4 = tmp1_takeIf;
1319
+ } else {
1320
+ tmp_4 = null;
1321
+ }
1322
+ tmp$ret$5 = tmp_4;
1323
+ var tmp2_safe_receiver = tmp$ret$5;
1324
+ var tmp_5;
1325
+ if (tmp2_safe_receiver == null) {
1326
+ tmp_5 = null;
1327
+ } else {
1328
+ var tmp$ret$7;
1329
+ // Inline function 'kotlin.let' call
1330
+ // Inline function 'kotlin.contracts.contract' call
1331
+ var tmp$ret$6;
1332
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1333
+ tmp$ret$6 = 'status, ';
1334
+ tmp$ret$7 = tmp$ret$6;
1335
+ tmp_5 = tmp$ret$7;
1336
+ }
1337
+ tmp = trimMargin('\n |' + ' ' + ' ' + ' ' + tmp_2 + 'content == null -> Response' + tmp_3 + 'Unit(' + orEmptyString_0(tmp_5) + 'headers)\n ');
1338
+ } else {
1339
+ Companion_getInstance_1();
1340
+ Companion_getInstance_1();
1341
+ Companion_getInstance_1();
1342
+ var tmp$ret$9;
1343
+ // Inline function 'kotlin.takeIf' call
1344
+ var tmp2_takeIf = _this__u8e3s4.mi_1;
1345
+ // Inline function 'kotlin.contracts.contract' call
1346
+ var tmp_6;
1347
+ var tmp$ret$8;
1348
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1349
+ tmp$ret$8 = Companion_getInstance_1().ck(tmp2_takeIf);
1350
+ if (tmp$ret$8) {
1351
+ tmp_6 = tmp2_takeIf;
1352
+ } else {
1353
+ tmp_6 = null;
1354
+ }
1355
+ tmp$ret$9 = tmp_6;
1356
+ var tmp3_safe_receiver = tmp$ret$9;
1357
+ var tmp_7;
1358
+ if (tmp3_safe_receiver == null) {
1359
+ tmp_7 = null;
1360
+ } else {
1361
+ var tmp$ret$11;
1362
+ // Inline function 'kotlin.let' call
1363
+ // Inline function 'kotlin.contracts.contract' call
1364
+ var tmp$ret$10;
1365
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1366
+ tmp$ret$10 = 'status == ' + _this__u8e3s4.mi_1 + ' && ';
1367
+ tmp$ret$11 = tmp$ret$10;
1368
+ tmp_7 = tmp$ret$11;
1369
+ }
1370
+ var tmp_8 = orEmptyString_0(tmp_7);
1371
+ Companion_getInstance_1();
1372
+ Companion_getInstance_1();
1373
+ Companion_getInstance_1();
1374
+ Companion_getInstance_1();
1375
+ var tmp_9 = $this.di(_this__u8e3s4.ni_1.wh_1);
1376
+ var tmp_10 = $this.di(_this__u8e3s4.ni_1.wh_1);
1377
+ Companion_getInstance_1();
1378
+ Companion_getInstance_1();
1379
+ Companion_getInstance_1();
1380
+ Companion_getInstance_1();
1381
+ var tmp_11 = Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
1382
+ var tmp_12 = emitContentType_0(_this__u8e3s4.ni_1);
1383
+ var tmp$ret$13;
1384
+ // Inline function 'kotlin.takeIf' call
1385
+ var tmp3_takeIf = _this__u8e3s4.mi_1;
1386
+ // Inline function 'kotlin.contracts.contract' call
1387
+ var tmp_13;
1388
+ var tmp$ret$12;
1389
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1390
+ tmp$ret$12 = !Companion_getInstance_1().ck(tmp3_takeIf);
1391
+ if (tmp$ret$12) {
1392
+ tmp_13 = tmp3_takeIf;
1393
+ } else {
1394
+ tmp_13 = null;
1395
+ }
1396
+ tmp$ret$13 = tmp_13;
1397
+ var tmp4_safe_receiver = tmp$ret$13;
1398
+ var tmp_14;
1399
+ if (tmp4_safe_receiver == null) {
1400
+ tmp_14 = null;
1401
+ } else {
1402
+ var tmp$ret$15;
1403
+ // Inline function 'kotlin.let' call
1404
+ // Inline function 'kotlin.contracts.contract' call
1405
+ var tmp$ret$14;
1406
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emitResponseMapperCondition.<anonymous>' call
1407
+ tmp$ret$14 = 'status, ';
1408
+ tmp$ret$15 = tmp$ret$14;
1409
+ tmp_14 = tmp$ret$15;
1410
+ }
1411
+ tmp = trimMargin('\n |' + ' ' + ' ' + ' ' + tmp_8 + 'content?.type == "' + _this__u8e3s4.ni_1.vh_1 + '" -> contentMapper\n |' + ' ' + ' ' + ' ' + ' ' + '.read<' + tmp_9 + '>(content, typeOf<' + tmp_10 + '>())\n |' + ' ' + ' ' + ' ' + ' ' + '.let{ Response' + tmp_11 + tmp_12 + '(' + orEmptyString_0(tmp_14) + 'headers, it.body) }\n ');
1412
+ }
1413
+ return tmp;
1414
+ }
1415
+ function KotlinEmitter$emit$lambda($this_emit, this$0) {
1416
+ return function () {
1417
+ return trimMargin('|data class ' + $this_emit.ui_1 + '(\n |' + this$0.wi($this_emit.vi_1) + '\n |)\n |');
1418
+ };
1419
+ }
1420
+ function KotlinEmitter$emit$lambda$lambda(this$0) {
1421
+ return function (it) {
1422
+ Companion_getInstance_1();
1423
+ return ' ' + 'val ' + this$0.xi(it);
1424
+ };
1425
+ }
1426
+ function KotlinEmitter$emit$lambda_0($this_emit, this$0) {
1427
+ return function () {
1428
+ return joinToString($this_emit.yi_1, ',\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda$lambda(this$0));
1429
+ };
1430
+ }
1431
+ function KotlinEmitter$emit$lambda_1(this$0, $this_emit) {
1432
+ return function () {
1433
+ return this$0.cj($this_emit.zi_1) + ': ' + this$0.di($this_emit.aj_1) + ($this_emit.bj_1 ? '? = null' : '');
1434
+ };
1435
+ }
1436
+ function KotlinEmitter$emit$lambda_2($this_emit) {
1437
+ return function () {
1438
+ var tmp$ret$2;
1439
+ // Inline function 'kotlin.collections.mapIndexed' call
1440
+ var tmp1_mapIndexed = split($this_emit.dj_1, ['-']);
1441
+ var tmp$ret$1;
1442
+ // Inline function 'kotlin.collections.mapIndexedTo' call
1443
+ var tmp0_mapIndexedTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_mapIndexed, 10));
1444
+ var index = 0;
1445
+ var tmp0_iterator = tmp1_mapIndexed.c();
1446
+ while (tmp0_iterator.d()) {
1447
+ var item = tmp0_iterator.e();
1448
+ var tmp$ret$0;
1449
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1450
+ var tmp1 = index;
1451
+ index = tmp1 + 1 | 0;
1452
+ var tmp2__anonymous__z9zvc9 = checkIndexOverflow(tmp1);
1453
+ tmp$ret$0 = tmp2__anonymous__z9zvc9 > 0 ? Companion_getInstance_1().pi(item) : item;
1454
+ tmp0_mapIndexedTo.a(tmp$ret$0);
1455
+ }
1456
+ tmp$ret$1 = tmp0_mapIndexedTo;
1457
+ tmp$ret$2 = tmp$ret$1;
1458
+ return joinToString(tmp$ret$2, '');
1459
+ };
1460
+ }
1461
+ function KotlinEmitter$emit$lambda_3($this_emit) {
1462
+ return function () {
1463
+ var tmp$ret$1;
1464
+ // Inline function 'kotlin.let' call
1465
+ var tmp0_subject = $this_emit;
1466
+ var tmp;
1467
+ if (tmp0_subject instanceof Custom) {
1468
+ tmp = $this_emit.gj_1;
1469
+ } else {
1470
+ if (tmp0_subject instanceof Primitive) {
1471
+ var tmp1_subject = $this_emit.ej_1;
1472
+ var tmp0 = tmp1_subject.q4_1;
1473
+ var tmp_0;
1474
+ switch (tmp0) {
1475
+ case 0:
1476
+ tmp_0 = 'String';
1477
+ break;
1478
+ case 1:
1479
+ tmp_0 = 'Int';
1480
+ break;
1481
+ case 2:
1482
+ tmp_0 = 'Boolean';
1483
+ break;
1484
+ default:
1485
+ noWhenBranchMatchedException();
1486
+ break;
1487
+ }
1488
+ tmp = tmp_0;
1489
+ } else {
1490
+ noWhenBranchMatchedException();
1491
+ }
1492
+ }
1493
+ var tmp0_let = tmp;
1494
+ // Inline function 'kotlin.contracts.contract' call
1495
+ var tmp$ret$0;
1496
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1497
+ tmp$ret$0 = $this_emit.qi() ? 'List<' + tmp0_let + '>' : tmp0_let;
1498
+ tmp$ret$1 = tmp$ret$0;
1499
+ return tmp$ret$1;
1500
+ };
1501
+ }
1502
+ function KotlinEmitter$emit$lambda_4($this_emit) {
1503
+ return function () {
1504
+ Companion_getInstance_1();
1505
+ return 'enum class ' + $this_emit.ij_1 + ' {\n' + ' ' + joinToString($this_emit.jj_1, ', ') + '\n}\n';
1506
+ };
1507
+ }
1508
+ function KotlinEmitter$emit$lambda_5($this_emit, this$0) {
1509
+ return function () {
1510
+ return trimMargin('data class ' + $this_emit.kj_1 + '(val value: String)\n |fun ' + $this_emit.kj_1 + '.validate() = ' + this$0.mj($this_emit.lj_1) + '\n |');
1511
+ };
1512
+ }
1513
+ function KotlinEmitter$emit$lambda_6($this_emit) {
1514
+ return function () {
1515
+ return 'Regex(' + $this_emit.nj_1 + ').find(value)';
1516
+ };
1517
+ }
1518
+ function KotlinEmitter$emit$lambda$lambda_0(this$0, $this_emit) {
1519
+ return function (it) {
1520
+ Companion_getInstance_1();
1521
+ var tmp0_safe_receiver = it.uh_1;
1522
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : emitContentType_0(tmp0_safe_receiver);
1523
+ var tmp = tmp1_elvis_lhs == null ? 'Unit' : tmp1_elvis_lhs;
1524
+ var tmp_0 = emitRequestSignature_0($this_emit, this$0, it.uh_1);
1525
+ var tmp2_safe_receiver = it.uh_1;
1526
+ var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.wh_1;
1527
+ var tmp4_elvis_lhs = tmp3_safe_receiver == null ? null : this$0.di(tmp3_safe_receiver);
1528
+ var tmp_1 = tmp4_elvis_lhs == null ? 'Unit' : tmp4_elvis_lhs;
1529
+ var tmp_2 = emitPath_0($this_emit.gi_1, this$0);
1530
+ var tmp_3 = emitMap_0($this_emit.hi_1, this$0);
1531
+ var tmp_4 = emitMap_0($this_emit.ii_1, this$0);
1532
+ var tmp5_safe_receiver = it.uh_1;
1533
+ var tmp_5;
1534
+ if (tmp5_safe_receiver == null) {
1535
+ tmp_5 = null;
1536
+ } else {
1537
+ var tmp$ret$1;
1538
+ // Inline function 'kotlin.let' call
1539
+ // Inline function 'kotlin.contracts.contract' call
1540
+ var tmp$ret$0;
1541
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
1542
+ tmp$ret$0 = 'WirespecShared.Content("' + tmp5_safe_receiver.vh_1 + '", body)';
1543
+ tmp$ret$1 = tmp$ret$0;
1544
+ tmp_5 = tmp$ret$1;
1545
+ }
1546
+ var tmp6_elvis_lhs = tmp_5;
1547
+ return ' ' + 'class Request' + tmp + ' ' + tmp_0 + ': Request<' + tmp_1 + '> {override val path = "' + tmp_2 + '"; override val method = WirespecShared.Method.' + $this_emit.fi_1.p4_1 + '; override val query = mapOf<String, List<Any?>>(' + tmp_3 + '); override val headers = mapOf<String, List<Any?>>(' + tmp_4 + '); override val content = ' + (tmp6_elvis_lhs == null ? 'null' : tmp6_elvis_lhs) + '}';
1548
+ };
1549
+ }
1550
+ function KotlinEmitter$emit$lambda$lambda_1(it) {
1551
+ Companion_getInstance_1();
1552
+ return ' ' + 'sealed interface Response' + it + '<T>: Response<T>';
1553
+ }
1554
+ function KotlinEmitter$emit$lambda$lambda_2(it) {
1555
+ Companion_getInstance_1();
1556
+ return ' ' + 'sealed interface Response' + it + '<T>: Response' + groupStatus_0(it) + '<T>';
1557
+ }
1558
+ function KotlinEmitter$emit$lambda$lambda_3(this$0) {
1559
+ return function (it) {
1560
+ Companion_getInstance_1();
1561
+ var tmp0_safe_receiver = it.ni_1;
1562
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : emitContentType_0(tmp0_safe_receiver);
1563
+ var tmp = tmp1_elvis_lhs == null ? 'Unit' : tmp1_elvis_lhs;
1564
+ var tmp2_safe_receiver = it.ni_1;
1565
+ var tmp_0;
1566
+ if (tmp2_safe_receiver == null) {
1567
+ tmp_0 = null;
1568
+ } else {
1569
+ var tmp$ret$1;
1570
+ // Inline function 'kotlin.let' call
1571
+ // Inline function 'kotlin.contracts.contract' call
1572
+ var tmp$ret$0;
1573
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
1574
+ tmp$ret$0 = ', body: ' + this$0.di(tmp2_safe_receiver.wh_1);
1575
+ tmp$ret$1 = tmp$ret$0;
1576
+ tmp_0 = tmp$ret$1;
1577
+ }
1578
+ var tmp3_elvis_lhs = tmp_0;
1579
+ var tmp_1 = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
1580
+ var tmp4_safe_receiver = it.ni_1;
1581
+ var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.wh_1;
1582
+ var tmp6_elvis_lhs = tmp5_safe_receiver == null ? null : this$0.di(tmp5_safe_receiver);
1583
+ var tmp_2 = tmp6_elvis_lhs == null ? 'Unit' : tmp6_elvis_lhs;
1584
+ var tmp7_safe_receiver = it.ni_1;
1585
+ var tmp_3;
1586
+ if (tmp7_safe_receiver == null) {
1587
+ tmp_3 = null;
1588
+ } else {
1589
+ var tmp$ret$3;
1590
+ // Inline function 'kotlin.let' call
1591
+ // Inline function 'kotlin.contracts.contract' call
1592
+ var tmp$ret$2;
1593
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
1594
+ tmp$ret$2 = 'WirespecShared.Content("' + tmp7_safe_receiver.vh_1 + '", body)';
1595
+ tmp$ret$3 = tmp$ret$2;
1596
+ tmp_3 = tmp$ret$3;
1597
+ }
1598
+ var tmp8_elvis_lhs = tmp_3;
1599
+ return ' ' + 'class Response' + it.mi_1 + tmp + ' (override val headers: Map<String, List<Any?>>' + tmp_1 + ' ): Response' + it.mi_1 + '<' + tmp_2 + '> { override val status = ' + it.mi_1 + '; override val content = ' + (tmp8_elvis_lhs == null ? 'null' : tmp8_elvis_lhs) + '}';
1600
+ };
1601
+ }
1602
+ function KotlinEmitter$emit$lambda$lambda_4(this$0) {
1603
+ return function (it) {
1604
+ Companion_getInstance_1();
1605
+ var tmp = Companion_getInstance_1().pi(it.mi_1);
1606
+ var tmp0_safe_receiver = it.ni_1;
1607
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : emitContentType_0(tmp0_safe_receiver);
1608
+ var tmp_0 = tmp1_elvis_lhs == null ? 'Unit' : tmp1_elvis_lhs;
1609
+ var tmp2_safe_receiver = it.ni_1;
1610
+ var tmp_1;
1611
+ if (tmp2_safe_receiver == null) {
1612
+ tmp_1 = null;
1613
+ } else {
1614
+ var tmp$ret$1;
1615
+ // Inline function 'kotlin.let' call
1616
+ // Inline function 'kotlin.contracts.contract' call
1617
+ var tmp$ret$0;
1618
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
1619
+ tmp$ret$0 = ', body: ' + this$0.di(tmp2_safe_receiver.wh_1);
1620
+ tmp$ret$1 = tmp$ret$0;
1621
+ tmp_1 = tmp$ret$1;
1622
+ }
1623
+ var tmp3_elvis_lhs = tmp_1;
1624
+ var tmp_2 = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
1625
+ var tmp_3 = Companion_getInstance_1().pi(it.mi_1);
1626
+ var tmp4_safe_receiver = it.ni_1;
1627
+ var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.wh_1;
1628
+ var tmp6_elvis_lhs = tmp5_safe_receiver == null ? null : this$0.di(tmp5_safe_receiver);
1629
+ var tmp_4 = tmp6_elvis_lhs == null ? 'Unit' : tmp6_elvis_lhs;
1630
+ var tmp7_safe_receiver = it.ni_1;
1631
+ var tmp_5;
1632
+ if (tmp7_safe_receiver == null) {
1633
+ tmp_5 = null;
1634
+ } else {
1635
+ var tmp$ret$3;
1636
+ // Inline function 'kotlin.let' call
1637
+ // Inline function 'kotlin.contracts.contract' call
1638
+ var tmp$ret$2;
1639
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
1640
+ tmp$ret$2 = 'WirespecShared.Content("' + tmp7_safe_receiver.vh_1 + '", body)';
1641
+ tmp$ret$3 = tmp$ret$2;
1642
+ tmp_5 = tmp$ret$3;
1643
+ }
1644
+ var tmp8_elvis_lhs = tmp_5;
1645
+ return ' ' + 'class Response' + tmp + tmp_0 + ' (override val status: Int, override val headers: Map<String, List<Any?>>' + tmp_2 + ' ): Response' + tmp_3 + '<' + tmp_4 + '> { override val content = ' + (tmp8_elvis_lhs == null ? 'null' : tmp8_elvis_lhs) + '}';
1646
+ };
1647
+ }
1648
+ function KotlinEmitter$emit$lambda_7($this_emit, this$0) {
1649
+ return function () {
1650
+ Companion_getInstance_1();
1651
+ var tmp = joinToString($this_emit.ki_1, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda$lambda_0(this$0, $this_emit));
1652
+ Companion_getInstance_1();
1653
+ var tmp$ret$2;
1654
+ // Inline function 'kotlin.collections.map' call
1655
+ var tmp1_map = $this_emit.li_1;
1656
+ var tmp$ret$1;
1657
+ // Inline function 'kotlin.collections.mapTo' call
1658
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
1659
+ var tmp0_iterator = tmp1_map.c();
1660
+ while (tmp0_iterator.d()) {
1661
+ var item = tmp0_iterator.e();
1662
+ var tmp$ret$0;
1663
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1664
+ tmp$ret$0 = groupStatus_0(item.mi_1);
1665
+ tmp0_mapTo.a(tmp$ret$0);
1666
+ }
1667
+ tmp$ret$1 = tmp0_mapTo;
1668
+ tmp$ret$2 = tmp$ret$1;
1669
+ var tmp_0 = toSet(tmp$ret$2);
1670
+ var tmp_1 = joinToString(tmp_0, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda$lambda_1);
1671
+ var tmp$ret$8;
1672
+ // Inline function 'kotlin.collections.map' call
1673
+ var tmp$ret$5;
1674
+ // Inline function 'kotlin.collections.filter' call
1675
+ var tmp3_filter = $this_emit.li_1;
1676
+ var tmp$ret$4;
1677
+ // Inline function 'kotlin.collections.filterTo' call
1678
+ var tmp2_filterTo = ArrayList_init_$Create$();
1679
+ var tmp0_iterator_0 = tmp3_filter.c();
1680
+ while (tmp0_iterator_0.d()) {
1681
+ var element = tmp0_iterator_0.e();
1682
+ var tmp$ret$3;
1683
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1684
+ tmp$ret$3 = Companion_getInstance_1().ck(element.mi_1);
1685
+ if (tmp$ret$3) {
1686
+ tmp2_filterTo.a(element);
1687
+ }
1688
+ }
1689
+ tmp$ret$4 = tmp2_filterTo;
1690
+ tmp$ret$5 = tmp$ret$4;
1691
+ var tmp5_map = tmp$ret$5;
1692
+ var tmp$ret$7;
1693
+ // Inline function 'kotlin.collections.mapTo' call
1694
+ var tmp4_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp5_map, 10));
1695
+ var tmp0_iterator_1 = tmp5_map.c();
1696
+ while (tmp0_iterator_1.d()) {
1697
+ var item_0 = tmp0_iterator_1.e();
1698
+ var tmp$ret$6;
1699
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1700
+ tmp$ret$6 = item_0.mi_1;
1701
+ tmp4_mapTo.a(tmp$ret$6);
1702
+ }
1703
+ tmp$ret$7 = tmp4_mapTo;
1704
+ tmp$ret$8 = tmp$ret$7;
1705
+ var tmp_2 = tmp$ret$8;
1706
+ var tmp_3 = joinToString(tmp_2, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda$lambda_2);
1707
+ var tmp$ret$11;
1708
+ // Inline function 'kotlin.collections.filter' call
1709
+ var tmp7_filter = $this_emit.li_1;
1710
+ var tmp$ret$10;
1711
+ // Inline function 'kotlin.collections.filterTo' call
1712
+ var tmp6_filterTo = ArrayList_init_$Create$();
1713
+ var tmp0_iterator_2 = tmp7_filter.c();
1714
+ while (tmp0_iterator_2.d()) {
1715
+ var element_0 = tmp0_iterator_2.e();
1716
+ var tmp$ret$9;
1717
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1718
+ tmp$ret$9 = Companion_getInstance_1().ck(element_0.mi_1);
1719
+ if (tmp$ret$9) {
1720
+ tmp6_filterTo.a(element_0);
1721
+ }
1722
+ }
1723
+ tmp$ret$10 = tmp6_filterTo;
1724
+ tmp$ret$11 = tmp$ret$10;
1725
+ var tmp_4 = tmp$ret$11;
1726
+ var tmp_5 = joinToString(tmp_4, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda$lambda_3(this$0));
1727
+ var tmp$ret$14;
1728
+ // Inline function 'kotlin.collections.filter' call
1729
+ var tmp9_filter = $this_emit.li_1;
1730
+ var tmp$ret$13;
1731
+ // Inline function 'kotlin.collections.filterTo' call
1732
+ var tmp8_filterTo = ArrayList_init_$Create$();
1733
+ var tmp0_iterator_3 = tmp9_filter.c();
1734
+ while (tmp0_iterator_3.d()) {
1735
+ var element_1 = tmp0_iterator_3.e();
1736
+ var tmp$ret$12;
1737
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>.<anonymous>' call
1738
+ tmp$ret$12 = !Companion_getInstance_1().ck(element_1.mi_1);
1739
+ if (tmp$ret$12) {
1740
+ tmp8_filterTo.a(element_1);
1741
+ }
1742
+ }
1743
+ tmp$ret$13 = tmp8_filterTo;
1744
+ tmp$ret$14 = tmp$ret$13;
1745
+ var tmp_6 = tmp$ret$14;
1746
+ var tmp_7 = joinToString(tmp_6, '\n', VOID, VOID, VOID, VOID, KotlinEmitter$emit$lambda$lambda_4(this$0));
1747
+ var tmp_8 = Companion_getInstance_1().oj($this_emit.ei_1);
1748
+ Companion_getInstance_1();
1749
+ Companion_getInstance_1();
1750
+ Companion_getInstance_1();
1751
+ var tmp_9 = emitSegment_0($this_emit.gi_1, this$0);
1752
+ Companion_getInstance_1();
1753
+ Companion_getInstance_1();
1754
+ var tmp_10 = emitResponseMapper_0($this_emit.li_1, this$0);
1755
+ Companion_getInstance_1();
1756
+ Companion_getInstance_1();
1757
+ Companion_getInstance_1();
1758
+ return trimMargin('interface ' + $this_emit.ei_1 + ' {\n |' + ' ' + 'sealed interface Request<T>: WirespecShared.Request<T>\n |' + tmp + '\n |' + ' ' + 'sealed interface Response<T>: WirespecShared.Response<T>\n |' + tmp_1 + '\n |' + tmp_3 + '\n |' + tmp_5 + '\n |' + tmp_7 + '\n |suspend fun ' + tmp_8 + '(request: Request<*>): Response<*>\n |' + ' ' + 'companion object{\n |' + ' ' + ' ' + 'const val PATH = "' + tmp_9 + '"\n |' + ' ' + ' ' + tmp_10 + '\n |' + ' ' + ' ' + '}\n |' + ' ' + '}\n |}\n |');
1759
+ };
1760
+ }
1761
+ function KotlinEmitter$emitRequestSignature$lambda(this$0) {
1762
+ return function (it) {
1763
+ return this$0.xi(it);
1764
+ };
1765
+ }
1766
+ function KotlinEmitter$emitSegment$lambda(it) {
1767
+ var tmp0_subject = it;
1768
+ var tmp;
1769
+ if (tmp0_subject instanceof Param) {
1770
+ tmp = '{' + it.si_1.dj_1 + '}';
1771
+ } else {
1772
+ if (tmp0_subject instanceof Literal) {
1773
+ tmp = it.pj_1;
1774
+ } else {
1775
+ noWhenBranchMatchedException();
1776
+ }
1777
+ }
1778
+ return tmp;
1779
+ }
1780
+ function KotlinEmitter$emitMap$lambda(this$0) {
1781
+ return function (it) {
1782
+ return '"' + this$0.cj(it.zi_1) + '" to listOf(' + this$0.cj(it.zi_1) + ')';
1783
+ };
1784
+ }
1785
+ function KotlinEmitter$emit$lambda_8($this_emit) {
1786
+ return function () {
1787
+ var tmp0_subject = $this_emit;
1788
+ var tmp;
1789
+ if (tmp0_subject instanceof Literal) {
1790
+ tmp = $this_emit.pj_1;
1791
+ } else {
1792
+ if (tmp0_subject instanceof Param) {
1793
+ tmp = '${' + $this_emit.si_1.dj_1 + '}';
1794
+ } else {
1795
+ noWhenBranchMatchedException();
1796
+ }
1797
+ }
1798
+ return tmp;
1799
+ };
1800
+ }
1801
+ function KotlinEmitter$emitPath$lambda(this$0) {
1802
+ return function (it) {
1803
+ return emit_2(it, this$0);
1804
+ };
1805
+ }
1806
+ function KotlinEmitter$emitResponseMapper$lambda(this$0) {
1807
+ return function (it) {
1808
+ return emitResponseMapperCondition_0(it, this$0);
1809
+ };
1810
+ }
1811
+ function KotlinEmitter$emitResponseMapper$lambda_0(this$0) {
1812
+ return function (it) {
1813
+ return emitResponseMapperCondition_0(it, this$0);
1814
+ };
1815
+ }
1816
+ function KotlinEmitter(packageName, logger) {
1817
+ packageName = packageName === VOID ? get_DEFAULT_PACKAGE_NAME() : packageName;
1818
+ logger = logger === VOID ? get_noLogger() : logger;
1819
+ Emitter.call(this, logger);
1820
+ this.fk_1 = packageName;
1821
+ var tmp = this;
1822
+ Companion_getInstance_1();
1823
+ Companion_getInstance_1();
1824
+ Companion_getInstance_1();
1825
+ Companion_getInstance_1();
1826
+ Companion_getInstance_1();
1827
+ tmp.gk_1 = trimMargin('\n |import kotlin.reflect.KType\n |import kotlin.reflect.typeOf\n |object WirespecShared {\n |' + ' ' + 'enum class Method { GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH, TRACE }\n |' + ' ' + 'data class Content<T> (val type:String, val body:T )\n |' + ' ' + 'interface Request<T> { val path:String; val method: Method; val query: Map<String, List<Any?>>; val headers: Map<String, List<Any?>>; val content:Content<T>? }\n |' + ' ' + 'interface Response<T> { val status:Int; val headers: Map<String, List<Any?>>; val content:Content<T>? }\n |' + ' ' + 'interface ContentMapper<B> { fun <T> read(content: Content<B>, valueType: KType): Content<T> fun <T> write(content: Content<T>): Content<B> }\n |}\n ');
1828
+ }
1829
+ protoOf(KotlinEmitter).qh = function (ast) {
1830
+ var tmp$ret$3;
1831
+ // Inline function 'kotlin.collections.map' call
1832
+ var tmp1_map = protoOf(Emitter).qh.call(this, ast);
1833
+ var tmp$ret$2;
1834
+ // Inline function 'kotlin.collections.mapTo' call
1835
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
1836
+ var tmp0_iterator = tmp1_map.c();
1837
+ while (tmp0_iterator.d()) {
1838
+ var item = tmp0_iterator.e();
1839
+ var tmp$ret$1;
1840
+ // Inline function 'community.flock.wirespec.compiler.core.emit.KotlinEmitter.emit.<anonymous>' call
1841
+ var name = item.i3();
1842
+ var result = item.j3();
1843
+ var tmp$ret$0;
1844
+ // Inline function 'kotlin.text.trimStart' call
1845
+ var tmp0_trimStart = trimMargin('\n |' + (isBlank(this.fk_1) ? '' : 'package ' + this.fk_1) + '\n |' + (Companion_getInstance_1().hk(ast) ? this.gk_1 : '') + '\n |' + result + '\n ');
1846
+ tmp$ret$0 = toString(trimStart(isCharSequence(tmp0_trimStart) ? tmp0_trimStart : THROW_CCE()));
1847
+ tmp$ret$1 = to(name, tmp$ret$0);
1848
+ tmp0_mapTo.a(tmp$ret$1);
1849
+ }
1850
+ tmp$ret$2 = tmp0_mapTo;
1851
+ tmp$ret$3 = tmp$ret$2;
1852
+ return tmp$ret$3;
1853
+ };
1854
+ protoOf(KotlinEmitter).qj = function (_this__u8e3s4) {
1855
+ return this.rj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda(_this__u8e3s4, this));
1856
+ };
1857
+ protoOf(KotlinEmitter).wi = function (_this__u8e3s4) {
1858
+ return this.sj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_0(_this__u8e3s4, this));
1859
+ };
1860
+ protoOf(KotlinEmitter).xi = function (_this__u8e3s4) {
1861
+ return this.tj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_1(this, _this__u8e3s4));
1862
+ };
1863
+ protoOf(KotlinEmitter).cj = function (_this__u8e3s4) {
1864
+ return this.uj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_2(_this__u8e3s4));
1865
+ };
1866
+ protoOf(KotlinEmitter).di = function (_this__u8e3s4) {
1867
+ return this.th(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_3(_this__u8e3s4));
1868
+ };
1869
+ protoOf(KotlinEmitter).vj = function (_this__u8e3s4) {
1870
+ return this.wj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_4(_this__u8e3s4));
1871
+ };
1872
+ protoOf(KotlinEmitter).xj = function (_this__u8e3s4) {
1873
+ return this.yj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_5(_this__u8e3s4, this));
1874
+ };
1875
+ protoOf(KotlinEmitter).mj = function (_this__u8e3s4) {
1876
+ return this.zj(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_6(_this__u8e3s4));
1877
+ };
1878
+ protoOf(KotlinEmitter).ak = function (_this__u8e3s4) {
1879
+ return this.bk(_this__u8e3s4, this.oh_1, KotlinEmitter$emit$lambda_7(_this__u8e3s4, this));
1880
+ };
1881
+ function toField(_this__u8e3s4, identifier, isNullable) {
1882
+ return new Field(new Identifier(identifier), _this__u8e3s4, isNullable);
1883
+ }
1884
+ function emitContentType_0(_this__u8e3s4) {
1885
+ var tmp = split(_this__u8e3s4.vh_1, ['/']);
1886
+ return joinToString(tmp, '', VOID, VOID, VOID, VOID, emitContentType$lambda);
1887
+ }
1888
+ function groupStatus_0(_this__u8e3s4) {
1889
+ var tmp;
1890
+ if (Companion_getInstance_1().ck(_this__u8e3s4)) {
1891
+ var tmp$ret$1;
1892
+ // Inline function 'kotlin.text.substring' call
1893
+ var tmp$ret$0;
1894
+ // Inline function 'kotlin.js.asDynamic' call
1895
+ tmp$ret$0 = _this__u8e3s4;
1896
+ tmp$ret$1 = tmp$ret$0.substring(0, 1);
1897
+ tmp = tmp$ret$1 + 'XX';
1898
+ } else {
1899
+ tmp = Companion_getInstance_1().pi(_this__u8e3s4);
1900
+ }
1901
+ return tmp;
1902
+ }
1903
+ function orEmptyString_0(_this__u8e3s4) {
1904
+ var tmp0_elvis_lhs = _this__u8e3s4;
1905
+ return tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
1906
+ }
1907
+ function emitContentType$lambda(it) {
1908
+ return Companion_getInstance_1().pi(it);
1909
+ }
1910
+ function Companion() {
1911
+ Companion_instance = this;
1912
+ this.ik_1 = listOf(['abstract', 'case', 'catch', 'class', 'def', 'do', 'else', 'extends', 'false', 'final', 'finally', 'for', 'forSome', 'if', 'implicit', 'import', 'lazy', 'match', 'new', 'null', 'object', 'override', 'package', 'private', 'protected', 'return', 'sealed', 'super', 'this', 'throw', 'trait', 'true', 'try', 'type', 'val', 'var', 'while', 'with', 'yield']);
1913
+ }
1914
+ var Companion_instance;
1915
+ function Companion_getInstance_0() {
1916
+ if (Companion_instance == null)
1917
+ new Companion();
1918
+ return Companion_instance;
1919
+ }
1920
+ function ScalaEmitter$emit$lambda($this_emit, this$0) {
1921
+ return function () {
1922
+ return trimMargin('case class ' + $this_emit.ui_1 + '(\n |' + this$0.wi($this_emit.vi_1) + '\n |)\n |\n |');
1923
+ };
1924
+ }
1925
+ function ScalaEmitter$emit$lambda$lambda(this$0) {
1926
+ return function (it) {
1927
+ return this$0.xi(it);
1928
+ };
1929
+ }
1930
+ function ScalaEmitter$emit$lambda_0($this_emit, this$0) {
1931
+ return function () {
1932
+ return dropLast(joinToString($this_emit.yi_1, '\n', VOID, VOID, VOID, VOID, ScalaEmitter$emit$lambda$lambda(this$0)), 1);
1933
+ };
1934
+ }
1935
+ function ScalaEmitter$emit$lambda_1(this$0, $this_emit) {
1936
+ return function () {
1937
+ Companion_getInstance_1();
1938
+ return ' ' + 'val ' + this$0.cj($this_emit.zi_1) + ': ' + ($this_emit.bj_1 ? 'Option[' + this$0.di($this_emit.aj_1) + ']' : this$0.di($this_emit.aj_1)) + ',';
1939
+ };
1940
+ }
1941
+ function ScalaEmitter$emit$lambda_2($this_emit) {
1942
+ return function () {
1943
+ return Companion_getInstance_0().ik_1.i1($this_emit.dj_1) ? '`' + $this_emit.dj_1 + '`' : $this_emit.dj_1;
1944
+ };
1945
+ }
1946
+ function ScalaEmitter$emit$lambda_3($this_emit) {
1947
+ return function () {
1948
+ var tmp$ret$1;
1949
+ // Inline function 'kotlin.let' call
1950
+ var tmp0_subject = $this_emit;
1951
+ var tmp;
1952
+ if (tmp0_subject instanceof Custom) {
1953
+ tmp = $this_emit.gj_1;
1954
+ } else {
1955
+ if (tmp0_subject instanceof Primitive) {
1956
+ var tmp1_subject = $this_emit.ej_1;
1957
+ var tmp0 = tmp1_subject.q4_1;
1958
+ var tmp_0;
1959
+ switch (tmp0) {
1960
+ case 0:
1961
+ tmp_0 = 'String';
1962
+ break;
1963
+ case 1:
1964
+ tmp_0 = 'Int';
1965
+ break;
1966
+ case 2:
1967
+ tmp_0 = 'Boolean';
1968
+ break;
1969
+ default:
1970
+ noWhenBranchMatchedException();
1971
+ break;
1972
+ }
1973
+ tmp = tmp_0;
1974
+ } else {
1975
+ noWhenBranchMatchedException();
1976
+ }
1977
+ }
1978
+ var tmp0_let = tmp;
1979
+ // Inline function 'kotlin.contracts.contract' call
1980
+ var tmp$ret$0;
1981
+ // Inline function 'community.flock.wirespec.compiler.core.emit.ScalaEmitter.emit.<anonymous>.<anonymous>' call
1982
+ tmp$ret$0 = $this_emit.qi() ? 'List[' + tmp0_let + ']' : tmp0_let;
1983
+ tmp$ret$1 = tmp$ret$0;
1984
+ return tmp$ret$1;
1985
+ };
1986
+ }
1987
+ function ScalaEmitter$emit$lambda$lambda_0($this_emit) {
1988
+ return function (it) {
1989
+ Companion_getInstance_1();
1990
+ return ' ' + 'final case object ' + it + ' extends ' + $this_emit.ij_1 + '(label = "' + it + '")';
1991
+ };
1992
+ }
1993
+ function ScalaEmitter$emit$lambda_4($this_emit) {
1994
+ return function () {
1995
+ return trimMargin('\n |sealed abstract class ' + $this_emit.ij_1 + '(val label: String)\n |object ' + $this_emit.ij_1 + ' {\n |' + joinToString($this_emit.jj_1, '\n', VOID, VOID, VOID, VOID, ScalaEmitter$emit$lambda$lambda_0($this_emit)) + '\n |}\n |');
1996
+ };
1997
+ }
1998
+ function ScalaEmitter$emit$lambda_5($this_emit, this$0) {
1999
+ return function () {
2000
+ Companion_getInstance_1();
2001
+ var tmp = this$0.mj($this_emit.lj_1);
2002
+ Companion_getInstance_1();
2003
+ return trimMargin('case class ' + $this_emit.kj_1 + '(val value: String) {\n |' + ' ' + 'implicit class ' + $this_emit.kj_1 + 'Ops(val that: ' + $this_emit.kj_1 + ') {\n |' + tmp + '\n |' + ' ' + '}\n |}\n |\n |');
2004
+ };
2005
+ }
2006
+ function ScalaEmitter$emit$lambda_6($this_emit) {
2007
+ return function () {
2008
+ Companion_getInstance_1();
2009
+ Companion_getInstance_1();
2010
+ Companion_getInstance_1();
2011
+ Companion_getInstance_1();
2012
+ return trimMargin(' ' + ' ' + 'val regex = new scala.util.matching.Regex(' + $this_emit.nj_1 + ')\n |' + ' ' + ' ' + 'regex.findFirstIn(that.value)');
2013
+ };
2014
+ }
2015
+ function ScalaEmitter$emit$lambda_7() {
2016
+ return '// TODO("Not yet implemented")\n';
2017
+ }
2018
+ function ScalaEmitter(packageName, logger) {
2019
+ Companion_getInstance_0();
2020
+ packageName = packageName === VOID ? get_DEFAULT_PACKAGE_NAME() : packageName;
2021
+ logger = logger === VOID ? get_noLogger() : logger;
2022
+ Emitter.call(this, logger);
2023
+ this.lk_1 = packageName;
2024
+ }
2025
+ protoOf(ScalaEmitter).qh = function (ast) {
2026
+ var tmp$ret$2;
2027
+ // Inline function 'kotlin.collections.map' call
2028
+ var tmp1_map = protoOf(Emitter).qh.call(this, ast);
2029
+ var tmp$ret$1;
2030
+ // Inline function 'kotlin.collections.mapTo' call
2031
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
2032
+ var tmp0_iterator = tmp1_map.c();
2033
+ while (tmp0_iterator.d()) {
2034
+ var item = tmp0_iterator.e();
2035
+ var tmp$ret$0;
2036
+ // Inline function 'community.flock.wirespec.compiler.core.emit.ScalaEmitter.emit.<anonymous>' call
2037
+ var name = item.i3();
2038
+ var result = item.j3();
2039
+ tmp$ret$0 = to(name, isBlank(this.lk_1) ? '' : 'package ' + this.lk_1 + '\n\n' + result);
2040
+ tmp0_mapTo.a(tmp$ret$0);
2041
+ }
2042
+ tmp$ret$1 = tmp0_mapTo;
2043
+ tmp$ret$2 = tmp$ret$1;
2044
+ return tmp$ret$2;
2045
+ };
2046
+ protoOf(ScalaEmitter).qj = function (_this__u8e3s4) {
2047
+ return this.rj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda(_this__u8e3s4, this));
2048
+ };
2049
+ protoOf(ScalaEmitter).wi = function (_this__u8e3s4) {
2050
+ return this.sj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_0(_this__u8e3s4, this));
2051
+ };
2052
+ protoOf(ScalaEmitter).xi = function (_this__u8e3s4) {
2053
+ return this.tj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_1(this, _this__u8e3s4));
2054
+ };
2055
+ protoOf(ScalaEmitter).cj = function (_this__u8e3s4) {
2056
+ return this.uj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_2(_this__u8e3s4));
2057
+ };
2058
+ protoOf(ScalaEmitter).di = function (_this__u8e3s4) {
2059
+ return this.th(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_3(_this__u8e3s4));
2060
+ };
2061
+ protoOf(ScalaEmitter).vj = function (_this__u8e3s4) {
2062
+ return this.wj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_4(_this__u8e3s4));
2063
+ };
2064
+ protoOf(ScalaEmitter).xj = function (_this__u8e3s4) {
2065
+ return this.yj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_5(_this__u8e3s4, this));
2066
+ };
2067
+ protoOf(ScalaEmitter).mj = function (_this__u8e3s4) {
2068
+ return this.zj(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_6(_this__u8e3s4));
2069
+ };
2070
+ protoOf(ScalaEmitter).ak = function (_this__u8e3s4) {
2071
+ return this.bk(_this__u8e3s4, this.oh_1, ScalaEmitter$emit$lambda_7);
2072
+ };
2073
+ function emitName(_this__u8e3s4, $this) {
2074
+ var tmp0_safe_receiver = _this__u8e3s4.uh_1;
2075
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : emitContentType_0(tmp0_safe_receiver);
2076
+ return 'Request' + (tmp1_elvis_lhs == null ? 'Undefined' : tmp1_elvis_lhs);
2077
+ }
2078
+ function emitName_0(_this__u8e3s4, $this) {
2079
+ var tmp = 'Response' + Companion_getInstance_1().pi(_this__u8e3s4.mi_1);
2080
+ var tmp0_safe_receiver = _this__u8e3s4.ni_1;
2081
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : emitContentType_0(tmp0_safe_receiver);
2082
+ return tmp + (tmp1_elvis_lhs == null ? 'Undefined' : tmp1_elvis_lhs);
2083
+ }
2084
+ function emitMap_1(_this__u8e3s4, $this) {
2085
+ return joinToString(_this__u8e3s4, ', ', VOID, VOID, VOID, VOID, TypeScriptEmitter$emitMap$lambda($this));
2086
+ }
2087
+ function emitPath_1(_this__u8e3s4, $this) {
2088
+ return '/' + joinToString(_this__u8e3s4, '/', VOID, VOID, VOID, VOID, TypeScriptEmitter$emitPath$lambda($this));
2089
+ }
2090
+ function emit_3(_this__u8e3s4, $this) {
2091
+ return $this.ri(_this__u8e3s4, $this.oh_1, TypeScriptEmitter$emit$lambda_8(_this__u8e3s4));
2092
+ }
2093
+ function TypeScriptEmitter$emit$lambda($this_emit, this$0) {
2094
+ return function () {
2095
+ return trimMargin('export type ' + $this_emit.ui_1 + ' = {\n |' + this$0.wi($this_emit.vi_1) + '\n |}\n |\n |');
2096
+ };
2097
+ }
2098
+ function TypeScriptEmitter$emit$lambda$lambda(this$0) {
2099
+ return function (it) {
2100
+ return this$0.xi(it);
2101
+ };
2102
+ }
2103
+ function TypeScriptEmitter$emit$lambda_0($this_emit, this$0) {
2104
+ return function () {
2105
+ return joinToString($this_emit.yi_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda$lambda(this$0));
2106
+ };
2107
+ }
2108
+ function TypeScriptEmitter$emit$lambda_1(this$0, $this_emit) {
2109
+ return function () {
2110
+ Companion_getInstance_1();
2111
+ return ' ' + this$0.cj($this_emit.zi_1) + ($this_emit.bj_1 ? '?' : '') + ': ' + this$0.di($this_emit.aj_1);
2112
+ };
2113
+ }
2114
+ function TypeScriptEmitter$emit$lambda_2($this_emit) {
2115
+ return function () {
2116
+ return $this_emit.dj_1;
2117
+ };
2118
+ }
2119
+ function TypeScriptEmitter$emit$lambda_3($this_emit) {
2120
+ return function () {
2121
+ var tmp$ret$1;
2122
+ // Inline function 'kotlin.let' call
2123
+ var tmp0_subject = $this_emit;
2124
+ var tmp;
2125
+ if (tmp0_subject instanceof Custom) {
2126
+ tmp = $this_emit.gj_1;
2127
+ } else {
2128
+ if (tmp0_subject instanceof Primitive) {
2129
+ var tmp1_subject = $this_emit.ej_1;
2130
+ var tmp0 = tmp1_subject.q4_1;
2131
+ var tmp_0;
2132
+ switch (tmp0) {
2133
+ case 0:
2134
+ tmp_0 = 'string';
2135
+ break;
2136
+ case 1:
2137
+ tmp_0 = 'number';
2138
+ break;
2139
+ case 2:
2140
+ tmp_0 = 'boolean';
2141
+ break;
2142
+ default:
2143
+ noWhenBranchMatchedException();
2144
+ break;
2145
+ }
2146
+ tmp = tmp_0;
2147
+ } else {
2148
+ noWhenBranchMatchedException();
2149
+ }
2150
+ }
2151
+ var tmp0_let = tmp;
2152
+ // Inline function 'kotlin.contracts.contract' call
2153
+ var tmp$ret$0;
2154
+ // Inline function 'community.flock.wirespec.compiler.core.emit.TypeScriptEmitter.emit.<anonymous>.<anonymous>' call
2155
+ tmp$ret$0 = $this_emit.qi() ? tmp0_let + '[]' : tmp0_let;
2156
+ tmp$ret$1 = tmp$ret$0;
2157
+ return tmp$ret$1;
2158
+ };
2159
+ }
2160
+ function TypeScriptEmitter$emit$lambda$lambda_0(it) {
2161
+ return '"' + it + '"';
2162
+ }
2163
+ function TypeScriptEmitter$emit$lambda_4($this_emit) {
2164
+ return function () {
2165
+ return 'type ' + $this_emit.ij_1 + ' = ' + joinToString($this_emit.jj_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda$lambda_0) + '\n';
2166
+ };
2167
+ }
2168
+ function TypeScriptEmitter$emit$lambda_5($this_emit, this$0) {
2169
+ return function () {
2170
+ Companion_getInstance_1();
2171
+ return trimMargin('type ' + $this_emit.kj_1 + ' = {\n |' + ' ' + 'value: string\n |}\n |const validate' + $this_emit.kj_1 + ' = (type: ' + $this_emit.kj_1 + ') => (' + this$0.mj($this_emit.lj_1) + ').test(type.value);\n |\n |');
2172
+ };
2173
+ }
2174
+ function TypeScriptEmitter$emit$lambda_6($this_emit) {
2175
+ return function () {
2176
+ return "new RegExp('" + dropLast(drop($this_emit.nj_1, 1), 1) + "')";
2177
+ };
2178
+ }
2179
+ function TypeScriptEmitter$emit$lambda$lambda_1(this$0, $this_emit) {
2180
+ return function (it) {
2181
+ Companion_getInstance_1();
2182
+ var tmp = emitName(it, this$0);
2183
+ var tmp$ret$2;
2184
+ // Inline function 'kotlin.collections.map' call
2185
+ var tmp1_map = $this_emit.ii_1;
2186
+ var tmp$ret$1;
2187
+ // Inline function 'kotlin.collections.mapTo' call
2188
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_map, 10));
2189
+ var tmp0_iterator = tmp1_map.c();
2190
+ while (tmp0_iterator.d()) {
2191
+ var item = tmp0_iterator.e();
2192
+ var tmp$ret$0;
2193
+ // Inline function 'community.flock.wirespec.compiler.core.emit.TypeScriptEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
2194
+ tmp$ret$0 = this$0.xi(item);
2195
+ tmp0_mapTo.a(tmp$ret$0);
2196
+ }
2197
+ tmp$ret$1 = tmp0_mapTo;
2198
+ tmp$ret$2 = tmp$ret$1;
2199
+ var tmp_0 = joinToString(tmp$ret$2, ',');
2200
+ var tmp$ret$5;
2201
+ // Inline function 'kotlin.collections.map' call
2202
+ var tmp3_map = $this_emit.hi_1;
2203
+ var tmp$ret$4;
2204
+ // Inline function 'kotlin.collections.mapTo' call
2205
+ var tmp2_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp3_map, 10));
2206
+ var tmp0_iterator_0 = tmp3_map.c();
2207
+ while (tmp0_iterator_0.d()) {
2208
+ var item_0 = tmp0_iterator_0.e();
2209
+ var tmp$ret$3;
2210
+ // Inline function 'community.flock.wirespec.compiler.core.emit.TypeScriptEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
2211
+ tmp$ret$3 = this$0.xi(item_0);
2212
+ tmp2_mapTo.a(tmp$ret$3);
2213
+ }
2214
+ tmp$ret$4 = tmp2_mapTo;
2215
+ tmp$ret$5 = tmp$ret$4;
2216
+ var tmp_1 = joinToString(tmp$ret$5, ',');
2217
+ var tmp0_safe_receiver = it.uh_1;
2218
+ var tmp_2;
2219
+ if (tmp0_safe_receiver == null) {
2220
+ tmp_2 = null;
2221
+ } else {
2222
+ var tmp$ret$7;
2223
+ // Inline function 'kotlin.let' call
2224
+ // Inline function 'kotlin.contracts.contract' call
2225
+ var tmp$ret$6;
2226
+ // Inline function 'community.flock.wirespec.compiler.core.emit.TypeScriptEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
2227
+ tmp$ret$6 = '{ type: "' + tmp0_safe_receiver.vh_1 + '", body: ' + this$0.di(tmp0_safe_receiver.wh_1) + ' }';
2228
+ tmp$ret$7 = tmp$ret$6;
2229
+ tmp_2 = tmp$ret$7;
2230
+ }
2231
+ var tmp1_elvis_lhs = tmp_2;
2232
+ return ' ' + 'type ' + tmp + ' = { path: string, method: "' + $this_emit.fi_1 + '", headers: {' + tmp_0 + '}, query: {' + tmp_1 + '}, content: ' + (tmp1_elvis_lhs == null ? 'undefined' : tmp1_elvis_lhs) + ' } ';
2233
+ };
2234
+ }
2235
+ function TypeScriptEmitter$emit$lambda$lambda_2(this$0) {
2236
+ return function (it) {
2237
+ return emitName(it, this$0);
2238
+ };
2239
+ }
2240
+ function TypeScriptEmitter$emit$lambda$lambda_3(this$0) {
2241
+ return function (it) {
2242
+ Companion_getInstance_1();
2243
+ var tmp = emitName_0(it, this$0);
2244
+ var tmp_0 = Companion_getInstance_1().ck(it.mi_1) ? it.mi_1 : 'number';
2245
+ var tmp0_safe_receiver = it.ni_1;
2246
+ var tmp_1;
2247
+ if (tmp0_safe_receiver == null) {
2248
+ tmp_1 = null;
2249
+ } else {
2250
+ var tmp$ret$1;
2251
+ // Inline function 'kotlin.let' call
2252
+ // Inline function 'kotlin.contracts.contract' call
2253
+ var tmp$ret$0;
2254
+ // Inline function 'community.flock.wirespec.compiler.core.emit.TypeScriptEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
2255
+ tmp$ret$0 = '{ type: "' + tmp0_safe_receiver.vh_1 + '", body: ' + this$0.di(tmp0_safe_receiver.wh_1) + ' }';
2256
+ tmp$ret$1 = tmp$ret$0;
2257
+ tmp_1 = tmp$ret$1;
2258
+ }
2259
+ var tmp1_elvis_lhs = tmp_1;
2260
+ return ' ' + 'type ' + tmp + ' = { status: ' + tmp_0 + ', content: ' + (tmp1_elvis_lhs == null ? 'undefined' : tmp1_elvis_lhs) + ' }';
2261
+ };
2262
+ }
2263
+ function TypeScriptEmitter$emit$lambda$lambda_4(this$0) {
2264
+ return function (it) {
2265
+ return emitName_0(it, this$0);
2266
+ };
2267
+ }
2268
+ function TypeScriptEmitter$emit$lambda$lambda$lambda(this$0) {
2269
+ return function (it) {
2270
+ return this$0.xi(it);
2271
+ };
2272
+ }
2273
+ function TypeScriptEmitter$emit$lambda$lambda_5(this$0, $this_emit) {
2274
+ return function (it) {
2275
+ var tmp = Companion_getInstance_1().oj(emitName(it, this$0));
2276
+ var tmp_0 = Companion_getInstance_1().ok($this_emit, it.uh_1);
2277
+ var tmp_1 = joinToString(tmp_0, ',', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda$lambda$lambda(this$0));
2278
+ var tmp_2 = emitPath_1($this_emit.gi_1, this$0);
2279
+ var tmp_3 = emitMap_1($this_emit.hi_1, this$0);
2280
+ var tmp_4 = emitMap_1($this_emit.ii_1, this$0);
2281
+ var tmp0_safe_receiver = it.uh_1;
2282
+ var tmp_5;
2283
+ if (tmp0_safe_receiver == null) {
2284
+ tmp_5 = null;
2285
+ } else {
2286
+ var tmp$ret$1;
2287
+ // Inline function 'kotlin.let' call
2288
+ // Inline function 'kotlin.contracts.contract' call
2289
+ var tmp$ret$0;
2290
+ // Inline function 'community.flock.wirespec.compiler.core.emit.TypeScriptEmitter.emit.<anonymous>.<anonymous>.<anonymous>' call
2291
+ tmp$ret$0 = '{type: "' + tmp0_safe_receiver.vh_1 + '", body}';
2292
+ tmp$ret$1 = tmp$ret$0;
2293
+ tmp_5 = tmp$ret$1;
2294
+ }
2295
+ var tmp1_elvis_lhs = tmp_5;
2296
+ return 'export const ' + tmp + ' = (' + tmp_1 + ') => ({path: `' + tmp_2 + '`, method: "' + $this_emit.fi_1.p4_1 + '", query: {' + tmp_3 + '}, headers: {' + tmp_4 + '}, content: ' + (tmp1_elvis_lhs == null ? 'undefined' : tmp1_elvis_lhs) + '} as const)';
2297
+ };
2298
+ }
2299
+ function TypeScriptEmitter$emit$lambda_7($this_emit, this$0) {
2300
+ return function () {
2301
+ var tmp = toSet($this_emit.ki_1);
2302
+ var tmp_0 = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda$lambda_1(this$0, $this_emit));
2303
+ Companion_getInstance_1();
2304
+ var tmp_1 = toSet($this_emit.ki_1);
2305
+ var tmp_2 = joinToString(tmp_1, ' | ', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda$lambda_2(this$0));
2306
+ var tmp_3 = toSet($this_emit.li_1);
2307
+ var tmp_4 = joinToString(tmp_3, '\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda$lambda_3(this$0));
2308
+ Companion_getInstance_1();
2309
+ var tmp_5 = toSet($this_emit.li_1);
2310
+ var tmp_6 = joinToString(tmp_5, ' | ', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda$lambda_4(this$0));
2311
+ Companion_getInstance_1();
2312
+ Companion_getInstance_1();
2313
+ Companion_getInstance_1();
2314
+ var tmp_7 = Companion_getInstance_1().oj($this_emit.ei_1);
2315
+ Companion_getInstance_1();
2316
+ Companion_getInstance_1();
2317
+ return trimMargin('\n |export namespace ' + $this_emit.ei_1 + ' {\n |' + tmp_0 + '\n |' + ' ' + 'export type Request = ' + tmp_2 + '\n |' + tmp_4 + '\n |' + ' ' + 'export type Response = ' + tmp_6 + '\n |' + ' ' + 'export type Call = {\n |' + ' ' + ' ' + tmp_7 + ':(request: Request) => Promise<Response>\n |' + ' ' + '}\n |' + ' ' + joinToString($this_emit.ki_1, ',\n', VOID, VOID, VOID, VOID, TypeScriptEmitter$emit$lambda$lambda_5(this$0, $this_emit)) + '\n |}\n |\n ');
2318
+ };
2319
+ }
2320
+ function TypeScriptEmitter$emitMap$lambda(this$0) {
2321
+ return function (it) {
2322
+ return '"' + this$0.cj(it.zi_1) + '": ' + this$0.cj(it.zi_1);
2323
+ };
2324
+ }
2325
+ function TypeScriptEmitter$emitPath$lambda(this$0) {
2326
+ return function (it) {
2327
+ return emit_3(it, this$0);
2328
+ };
2329
+ }
2330
+ function TypeScriptEmitter$emit$lambda_8($this_emit) {
2331
+ return function () {
2332
+ var tmp0_subject = $this_emit;
2333
+ var tmp;
2334
+ if (tmp0_subject instanceof Literal) {
2335
+ tmp = $this_emit.pj_1;
2336
+ } else {
2337
+ if (tmp0_subject instanceof Param) {
2338
+ tmp = '${' + $this_emit.si_1.dj_1 + '}';
2339
+ } else {
2340
+ noWhenBranchMatchedException();
2341
+ }
2342
+ }
2343
+ return tmp;
2344
+ };
2345
+ }
2346
+ function TypeScriptEmitter(logger) {
2347
+ logger = logger === VOID ? get_noLogger() : logger;
2348
+ Emitter.call(this, logger);
2349
+ }
2350
+ protoOf(TypeScriptEmitter).qj = function (_this__u8e3s4) {
2351
+ return this.rj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda(_this__u8e3s4, this));
2352
+ };
2353
+ protoOf(TypeScriptEmitter).wi = function (_this__u8e3s4) {
2354
+ return this.sj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_0(_this__u8e3s4, this));
2355
+ };
2356
+ protoOf(TypeScriptEmitter).xi = function (_this__u8e3s4) {
2357
+ return this.tj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_1(this, _this__u8e3s4));
2358
+ };
2359
+ protoOf(TypeScriptEmitter).cj = function (_this__u8e3s4) {
2360
+ return this.uj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_2(_this__u8e3s4));
2361
+ };
2362
+ protoOf(TypeScriptEmitter).di = function (_this__u8e3s4) {
2363
+ return this.th(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_3(_this__u8e3s4));
2364
+ };
2365
+ protoOf(TypeScriptEmitter).vj = function (_this__u8e3s4) {
2366
+ return this.wj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_4(_this__u8e3s4));
2367
+ };
2368
+ protoOf(TypeScriptEmitter).xj = function (_this__u8e3s4) {
2369
+ return this.yj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_5(_this__u8e3s4, this));
2370
+ };
2371
+ protoOf(TypeScriptEmitter).mj = function (_this__u8e3s4) {
2372
+ return this.zj(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_6(_this__u8e3s4));
2373
+ };
2374
+ protoOf(TypeScriptEmitter).ak = function (_this__u8e3s4) {
2375
+ return this.bk(_this__u8e3s4, this.oh_1, TypeScriptEmitter$emit$lambda_7(_this__u8e3s4, this));
2376
+ };
2377
+ function WirespecEmitter$emit$lambda($this_emit, this$0) {
2378
+ return function () {
2379
+ return trimMargin('type ' + $this_emit.ui_1 + ' {\n |' + this$0.wi($this_emit.vi_1) + '\n |}\n |');
2380
+ };
2381
+ }
2382
+ function WirespecEmitter$emit$lambda$lambda(this$0) {
2383
+ return function (it) {
2384
+ return this$0.xi(it);
2385
+ };
2386
+ }
2387
+ function WirespecEmitter$emit$lambda_0($this_emit, this$0) {
2388
+ return function () {
2389
+ return dropLast(joinToString($this_emit.yi_1, '\n', VOID, VOID, VOID, VOID, WirespecEmitter$emit$lambda$lambda(this$0)), 1);
2390
+ };
2391
+ }
2392
+ function WirespecEmitter$emit$lambda_1(this$0, $this_emit) {
2393
+ return function () {
2394
+ Companion_getInstance_1();
2395
+ return ' ' + this$0.cj($this_emit.zi_1) + ($this_emit.bj_1 ? '?' : '') + ': ' + this$0.di($this_emit.aj_1) + ',';
2396
+ };
2397
+ }
2398
+ function WirespecEmitter$emit$lambda_2($this_emit) {
2399
+ return function () {
2400
+ return $this_emit.dj_1;
2401
+ };
2402
+ }
2403
+ function WirespecEmitter$emit$lambda_3($this_emit) {
2404
+ return function () {
2405
+ var tmp$ret$1;
2406
+ // Inline function 'kotlin.let' call
2407
+ var tmp0_subject = $this_emit;
2408
+ var tmp;
2409
+ if (tmp0_subject instanceof Custom) {
2410
+ tmp = $this_emit.gj_1;
2411
+ } else {
2412
+ if (tmp0_subject instanceof Primitive) {
2413
+ var tmp1_subject = $this_emit.ej_1;
2414
+ var tmp0 = tmp1_subject.q4_1;
2415
+ var tmp_0;
2416
+ switch (tmp0) {
2417
+ case 0:
2418
+ tmp_0 = 'String';
2419
+ break;
2420
+ case 1:
2421
+ tmp_0 = 'Integer';
2422
+ break;
2423
+ case 2:
2424
+ tmp_0 = 'Boolean';
2425
+ break;
2426
+ default:
2427
+ noWhenBranchMatchedException();
2428
+ break;
2429
+ }
2430
+ tmp = tmp_0;
2431
+ } else {
2432
+ noWhenBranchMatchedException();
2433
+ }
2434
+ }
2435
+ var tmp0_let = tmp;
2436
+ // Inline function 'kotlin.contracts.contract' call
2437
+ var tmp$ret$0;
2438
+ // Inline function 'community.flock.wirespec.compiler.core.emit.WirespecEmitter.emit.<anonymous>.<anonymous>' call
2439
+ tmp$ret$0 = $this_emit.qi() ? tmp0_let + '[]' : tmp0_let;
2440
+ tmp$ret$1 = tmp$ret$0;
2441
+ return tmp$ret$1;
2442
+ };
2443
+ }
2444
+ function WirespecEmitter$emit$lambda_4($this_emit) {
2445
+ return function () {
2446
+ Companion_getInstance_1();
2447
+ return 'enum ' + $this_emit.ij_1 + ' {\n' + ' ' + joinToString($this_emit.jj_1, ', ') + '\n}\n';
2448
+ };
2449
+ }
2450
+ function WirespecEmitter$emit$lambda_5($this_emit, this$0) {
2451
+ return function () {
2452
+ return 'refined ' + $this_emit.kj_1 + ' ' + this$0.mj($this_emit.lj_1) + '\n';
2453
+ };
2454
+ }
2455
+ function WirespecEmitter$emit$lambda_6($this_emit) {
2456
+ return function () {
2457
+ return '/' + dropLast(drop($this_emit.nj_1, 1), 1) + '/g';
2458
+ };
2459
+ }
2460
+ function WirespecEmitter$emit$lambda_7() {
2461
+ return '// TODO("Not yet implemented")\n';
2462
+ }
2463
+ function WirespecEmitter(logger) {
2464
+ logger = logger === VOID ? get_noLogger() : logger;
2465
+ Emitter.call(this, logger);
2466
+ }
2467
+ protoOf(WirespecEmitter).qj = function (_this__u8e3s4) {
2468
+ return this.rj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda(_this__u8e3s4, this));
2469
+ };
2470
+ protoOf(WirespecEmitter).wi = function (_this__u8e3s4) {
2471
+ return this.sj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_0(_this__u8e3s4, this));
2472
+ };
2473
+ protoOf(WirespecEmitter).xi = function (_this__u8e3s4) {
2474
+ return this.tj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_1(this, _this__u8e3s4));
2475
+ };
2476
+ protoOf(WirespecEmitter).cj = function (_this__u8e3s4) {
2477
+ return this.uj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_2(_this__u8e3s4));
2478
+ };
2479
+ protoOf(WirespecEmitter).di = function (_this__u8e3s4) {
2480
+ return this.th(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_3(_this__u8e3s4));
2481
+ };
2482
+ protoOf(WirespecEmitter).vj = function (_this__u8e3s4) {
2483
+ return this.wj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_4(_this__u8e3s4));
2484
+ };
2485
+ protoOf(WirespecEmitter).xj = function (_this__u8e3s4) {
2486
+ return this.yj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_5(_this__u8e3s4, this));
2487
+ };
2488
+ protoOf(WirespecEmitter).mj = function (_this__u8e3s4) {
2489
+ return this.zj(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_6(_this__u8e3s4));
2490
+ };
2491
+ protoOf(WirespecEmitter).ak = function (_this__u8e3s4) {
2492
+ return this.bk(_this__u8e3s4, this.oh_1, WirespecEmitter$emit$lambda_7);
2493
+ };
2494
+ function get_DEFAULT_PACKAGE_NAME() {
2495
+ return DEFAULT_PACKAGE_NAME;
2496
+ }
2497
+ var DEFAULT_PACKAGE_NAME;
2498
+ function Companion_0() {
2499
+ Companion_instance_0 = this;
2500
+ this.oi_1 = ' ';
2501
+ }
2502
+ protoOf(Companion_0).pi = function (_this__u8e3s4) {
2503
+ var tmp$ret$6;
2504
+ // Inline function 'kotlin.text.replaceFirstChar' call
2505
+ var tmp;
2506
+ var tmp$ret$0;
2507
+ // Inline function 'kotlin.text.isNotEmpty' call
2508
+ tmp$ret$0 = charSequenceLength(_this__u8e3s4) > 0;
2509
+ if (tmp$ret$0) {
2510
+ var tmp$ret$3;
2511
+ // Inline function 'kotlin.text.uppercase' call
2512
+ var tmp2_uppercase = charSequenceGet(_this__u8e3s4, 0);
2513
+ var tmp$ret$2;
2514
+ // Inline function 'kotlin.js.unsafeCast' call
2515
+ var tmp$ret$1;
2516
+ // Inline function 'kotlin.js.asDynamic' call
2517
+ var tmp0_asDynamic = toString_0(tmp2_uppercase);
2518
+ tmp$ret$1 = tmp0_asDynamic;
2519
+ var tmp1_unsafeCast = tmp$ret$1.toUpperCase();
2520
+ tmp$ret$2 = tmp1_unsafeCast;
2521
+ tmp$ret$3 = tmp$ret$2;
2522
+ var tmp_0 = toString(tmp$ret$3);
2523
+ var tmp$ret$5;
2524
+ // Inline function 'kotlin.text.substring' call
2525
+ var tmp$ret$4;
2526
+ // Inline function 'kotlin.js.asDynamic' call
2527
+ tmp$ret$4 = _this__u8e3s4;
2528
+ tmp$ret$5 = tmp$ret$4.substring(1);
2529
+ tmp = tmp_0 + tmp$ret$5;
2530
+ } else {
2531
+ tmp = _this__u8e3s4;
2532
+ }
2533
+ tmp$ret$6 = tmp;
2534
+ return tmp$ret$6;
2535
+ };
2536
+ protoOf(Companion_0).oj = function (_this__u8e3s4) {
2537
+ var tmp$ret$6;
2538
+ // Inline function 'kotlin.text.replaceFirstChar' call
2539
+ var tmp;
2540
+ var tmp$ret$0;
2541
+ // Inline function 'kotlin.text.isNotEmpty' call
2542
+ tmp$ret$0 = charSequenceLength(_this__u8e3s4) > 0;
2543
+ if (tmp$ret$0) {
2544
+ var tmp$ret$3;
2545
+ // Inline function 'kotlin.text.lowercase' call
2546
+ var tmp2_lowercase = charSequenceGet(_this__u8e3s4, 0);
2547
+ var tmp$ret$2;
2548
+ // Inline function 'kotlin.js.unsafeCast' call
2549
+ var tmp$ret$1;
2550
+ // Inline function 'kotlin.js.asDynamic' call
2551
+ var tmp0_asDynamic = toString_0(tmp2_lowercase);
2552
+ tmp$ret$1 = tmp0_asDynamic;
2553
+ var tmp1_unsafeCast = tmp$ret$1.toLowerCase();
2554
+ tmp$ret$2 = tmp1_unsafeCast;
2555
+ tmp$ret$3 = tmp$ret$2;
2556
+ var tmp_0 = toString(tmp$ret$3);
2557
+ var tmp$ret$5;
2558
+ // Inline function 'kotlin.text.substring' call
2559
+ var tmp$ret$4;
2560
+ // Inline function 'kotlin.js.asDynamic' call
2561
+ tmp$ret$4 = _this__u8e3s4;
2562
+ tmp$ret$5 = tmp$ret$4.substring(1);
2563
+ tmp = tmp_0 + tmp$ret$5;
2564
+ } else {
2565
+ tmp = _this__u8e3s4;
2566
+ }
2567
+ tmp$ret$6 = tmp;
2568
+ return tmp$ret$6;
2569
+ };
2570
+ protoOf(Companion_0).hk = function (_this__u8e3s4) {
2571
+ var tmp$ret$0;
2572
+ $l$block_0: {
2573
+ // Inline function 'kotlin.collections.any' call
2574
+ var tmp;
2575
+ if (isInterface(_this__u8e3s4, Collection)) {
2576
+ tmp = _this__u8e3s4.g();
2577
+ } else {
2578
+ tmp = false;
2579
+ }
2580
+ if (tmp) {
2581
+ tmp$ret$0 = false;
2582
+ break $l$block_0;
2583
+ }
2584
+ var tmp0_iterator = _this__u8e3s4.c();
2585
+ while (tmp0_iterator.d()) {
2586
+ var element = tmp0_iterator.e();
2587
+ var tmp$ret$1;
2588
+ // Inline function 'community.flock.wirespec.compiler.core.emit.common.Companion.hasEndpoints.<anonymous>' call
2589
+ tmp$ret$1 = element instanceof Endpoint;
2590
+ if (tmp$ret$1) {
2591
+ tmp$ret$0 = true;
2592
+ break $l$block_0;
2593
+ }
2594
+ }
2595
+ tmp$ret$0 = false;
2596
+ }
2597
+ return tmp$ret$0;
2598
+ };
2599
+ protoOf(Companion_0).ok = function (_this__u8e3s4, content) {
2600
+ var tmp$ret$4;
2601
+ // Inline function 'kotlin.collections.map' call
2602
+ var tmp$ret$1;
2603
+ // Inline function 'kotlin.collections.filterIsInstance' call
2604
+ var tmp1_filterIsInstance = _this__u8e3s4.gi_1;
2605
+ var tmp$ret$0;
2606
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
2607
+ var tmp0_filterIsInstanceTo = ArrayList_init_$Create$();
2608
+ var tmp0_iterator = tmp1_filterIsInstance.c();
2609
+ while (tmp0_iterator.d()) {
2610
+ var element = tmp0_iterator.e();
2611
+ if (element instanceof Param) {
2612
+ tmp0_filterIsInstanceTo.a(element);
2613
+ }
2614
+ }
2615
+ tmp$ret$0 = tmp0_filterIsInstanceTo;
2616
+ tmp$ret$1 = tmp$ret$0;
2617
+ var tmp3_map = tmp$ret$1;
2618
+ var tmp$ret$3;
2619
+ // Inline function 'kotlin.collections.mapTo' call
2620
+ var tmp2_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp3_map, 10));
2621
+ var tmp0_iterator_0 = tmp3_map.c();
2622
+ while (tmp0_iterator_0.d()) {
2623
+ var item = tmp0_iterator_0.e();
2624
+ var tmp$ret$2;
2625
+ // Inline function 'community.flock.wirespec.compiler.core.emit.common.Companion.joinParameters.<anonymous>' call
2626
+ tmp$ret$2 = new Field(item.si_1, item.ti_1, false);
2627
+ tmp2_mapTo.a(tmp$ret$2);
2628
+ }
2629
+ tmp$ret$3 = tmp2_mapTo;
2630
+ tmp$ret$4 = tmp$ret$3;
2631
+ var pathField = tmp$ret$4;
2632
+ var parameters = plus(plus(plus(pathField, _this__u8e3s4.hi_1), _this__u8e3s4.ii_1), _this__u8e3s4.ji_1);
2633
+ var tmp0_safe_receiver = content;
2634
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.wh_1;
2635
+ return filterNotNull(plus_0(parameters, tmp1_safe_receiver == null ? null : toField(tmp1_safe_receiver, 'body', false)));
2636
+ };
2637
+ protoOf(Companion_0).ck = function (_this__u8e3s4) {
2638
+ return !(toIntOrNull(_this__u8e3s4) == null);
2639
+ };
2640
+ var Companion_instance_0;
2641
+ function Companion_getInstance_1() {
2642
+ if (Companion_instance_0 == null)
2643
+ new Companion_0();
2644
+ return Companion_instance_0;
2645
+ }
2646
+ function Emitter$emit$lambda(it) {
2647
+ return it.h3_1;
2648
+ }
2649
+ function Emitter(logger, split) {
2650
+ Companion_getInstance_1();
2651
+ split = split === VOID ? false : split;
2652
+ this.oh_1 = logger;
2653
+ this.ph_1 = split;
2654
+ }
2655
+ protoOf(Emitter).qh = function (ast) {
2656
+ var tmp$ret$4;
2657
+ // Inline function 'kotlin.run' call
2658
+ var tmp$ret$2;
2659
+ // Inline function 'kotlin.collections.map' call
2660
+ var tmp$ret$1;
2661
+ // Inline function 'kotlin.collections.mapTo' call
2662
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(ast, 10));
2663
+ var tmp0_iterator = ast.c();
2664
+ while (tmp0_iterator.d()) {
2665
+ var item = tmp0_iterator.e();
2666
+ var tmp$ret$0;
2667
+ // Inline function 'community.flock.wirespec.compiler.core.emit.common.Emitter.emit.<anonymous>' call
2668
+ this.oh_1.ih('Emitting Node ' + this);
2669
+ var tmp0_subject = item;
2670
+ var tmp;
2671
+ if (tmp0_subject instanceof Type_0) {
2672
+ tmp = to(item.ui_1, this.qj(item));
2673
+ } else {
2674
+ if (tmp0_subject instanceof Endpoint) {
2675
+ tmp = to(item.ei_1, this.ak(item));
2676
+ } else {
2677
+ if (tmp0_subject instanceof Enum_0) {
2678
+ tmp = to(item.ij_1, this.vj(item));
2679
+ } else {
2680
+ if (tmp0_subject instanceof Refined) {
2681
+ tmp = to(item.kj_1, this.xj(item));
2682
+ } else {
2683
+ noWhenBranchMatchedException();
2684
+ }
2685
+ }
2686
+ }
2687
+ }
2688
+ tmp$ret$0 = tmp;
2689
+ tmp0_mapTo.a(tmp$ret$0);
2690
+ }
2691
+ tmp$ret$1 = tmp0_mapTo;
2692
+ tmp$ret$2 = tmp$ret$1;
2693
+ var tmp1_run = tmp$ret$2;
2694
+ // Inline function 'kotlin.contracts.contract' call
2695
+ var tmp$ret$3;
2696
+ // Inline function 'community.flock.wirespec.compiler.core.emit.common.Emitter.emit.<anonymous>' call
2697
+ var tmp_0;
2698
+ if (this.ph_1) {
2699
+ tmp_0 = tmp1_run;
2700
+ } else {
2701
+ tmp_0 = listOf_0(to('NoName', joinToString(tmp1_run, '\n', VOID, VOID, VOID, VOID, Emitter$emit$lambda)));
2702
+ }
2703
+ tmp$ret$3 = tmp_0;
2704
+ tmp$ret$4 = tmp$ret$3;
2705
+ return tmp$ret$4;
2706
+ };
2707
+ function EndpointDefinitionEmitterLogger() {
2708
+ }
2709
+ function EnumDefinitionEmitterLogger() {
2710
+ }
2711
+ function RefinedTypeDefinitionEmitterLogger() {
2712
+ }
2713
+ function TypeDefinitionEmitterLogger() {
2714
+ }
2715
+ function StartingException() {
2716
+ NullTokenException.call(this, 'Starting Token', new Coordinates());
2717
+ captureStack(this, StartingException);
2718
+ }
2719
+ function NextException(coordinates) {
2720
+ NullTokenException.call(this, 'Next Token', coordinates);
2721
+ captureStack(this, NextException);
2722
+ }
2723
+ function WrongTokenException(expected, actual) {
2724
+ ParserException.call(this, actual.uk_1, '' + expected.fc() + ' expected, not: ' + getKClassFromExpression(actual.sk_1).fc() + ' at line ' + actual.uk_1.vk_1 + ' and position ' + (actual.uk_1.wk_1 - actual.tk_1.length | 0));
2725
+ captureStack(this, WrongTokenException);
2726
+ }
2727
+ function NullTokenException(message, coordinates) {
2728
+ ParserException.call(this, coordinates, message + ' cannot be null');
2729
+ captureStack(this, NullTokenException);
2730
+ }
2731
+ function ParserException(coordinates, message) {
2732
+ CompilerException.call(this, message, coordinates);
2733
+ captureStack(this, ParserException);
2734
+ }
2735
+ function CompilerException(message, coordinates) {
2736
+ WirespecException.call(this, message, coordinates);
2737
+ captureStack(this, CompilerException);
2738
+ }
2739
+ function WirespecException(message, coordinates) {
2740
+ RuntimeException_init_$Init$(message, this);
2741
+ captureStack(this, WirespecException);
2742
+ this.yk_1 = coordinates;
2743
+ }
2744
+ function optimize(_this__u8e3s4) {
2745
+ var tmp$ret$2;
2746
+ // Inline function 'kotlin.collections.map' call
2747
+ var tmp$ret$1;
2748
+ // Inline function 'kotlin.collections.mapTo' call
2749
+ var tmp0_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(_this__u8e3s4, 10));
2750
+ var tmp0_iterator = _this__u8e3s4.c();
2751
+ while (tmp0_iterator.d()) {
2752
+ var item = tmp0_iterator.e();
2753
+ var tmp$ret$0;
2754
+ // Inline function 'community.flock.wirespec.compiler.core.optimize.optimize.<anonymous>' call
2755
+ var tmp0_subject = item.sk_1;
2756
+ var tmp;
2757
+ if (tmp0_subject instanceof CustomRegex) {
2758
+ tmp = item.zk(VOID, '"' + dropLast(drop(item.tk_1, 1), 2) + '"');
2759
+ } else {
2760
+ tmp = item;
2761
+ }
2762
+ tmp$ret$0 = tmp;
2763
+ tmp0_mapTo.a(tmp$ret$0);
2764
+ }
2765
+ tmp$ret$1 = tmp0_mapTo;
2766
+ tmp$ret$2 = tmp$ret$1;
2767
+ return tmp$ret$2;
2768
+ }
2769
+ var Type_String_instance;
2770
+ var Type_Integer_instance;
2771
+ var Type_Boolean_instance;
2772
+ var Type_entriesInitialized;
2773
+ function Type_initEntries() {
2774
+ if (Type_entriesInitialized)
2775
+ return Unit_getInstance();
2776
+ Type_entriesInitialized = true;
2777
+ Type_String_instance = new Type('String', 0);
2778
+ Type_Integer_instance = new Type('Integer', 1);
2779
+ Type_Boolean_instance = new Type('Boolean', 2);
2780
+ }
2781
+ function Type(name, ordinal) {
2782
+ Enum.call(this, name, ordinal);
2783
+ }
2784
+ function Type_String_getInstance() {
2785
+ Type_initEntries();
2786
+ return Type_String_instance;
2787
+ }
2788
+ function Type_Integer_getInstance() {
2789
+ Type_initEntries();
2790
+ return Type_Integer_instance;
2791
+ }
2792
+ function Type_Boolean_getInstance() {
2793
+ Type_initEntries();
2794
+ return Type_Boolean_instance;
2795
+ }
2796
+ function Custom(value, isIterable) {
2797
+ this.gj_1 = value;
2798
+ this.hj_1 = isIterable;
2799
+ }
2800
+ protoOf(Custom).qi = function () {
2801
+ return this.hj_1;
2802
+ };
2803
+ protoOf(Custom).toString = function () {
2804
+ return 'Custom(value=' + this.gj_1 + ', isIterable=' + this.hj_1 + ')';
2805
+ };
2806
+ protoOf(Custom).hashCode = function () {
2807
+ var result = getStringHashCode(this.gj_1);
2808
+ result = imul(result, 31) + (this.hj_1 | 0) | 0;
2809
+ return result;
2810
+ };
2811
+ protoOf(Custom).equals = function (other) {
2812
+ if (this === other)
2813
+ return true;
2814
+ if (!(other instanceof Custom))
2815
+ return false;
2816
+ var tmp0_other_with_cast = other instanceof Custom ? other : THROW_CCE();
2817
+ if (!(this.gj_1 === tmp0_other_with_cast.gj_1))
2818
+ return false;
2819
+ if (!(this.hj_1 === tmp0_other_with_cast.hj_1))
2820
+ return false;
2821
+ return true;
2822
+ };
2823
+ function Primitive(type, isIterable) {
2824
+ this.ej_1 = type;
2825
+ this.fj_1 = isIterable;
2826
+ }
2827
+ protoOf(Primitive).qi = function () {
2828
+ return this.fj_1;
2829
+ };
2830
+ protoOf(Primitive).toString = function () {
2831
+ return 'Primitive(type=' + this.ej_1 + ', isIterable=' + this.fj_1 + ')';
2832
+ };
2833
+ protoOf(Primitive).hashCode = function () {
2834
+ var result = this.ej_1.hashCode();
2835
+ result = imul(result, 31) + (this.fj_1 | 0) | 0;
2836
+ return result;
2837
+ };
2838
+ protoOf(Primitive).equals = function (other) {
2839
+ if (this === other)
2840
+ return true;
2841
+ if (!(other instanceof Primitive))
2842
+ return false;
2843
+ var tmp0_other_with_cast = other instanceof Primitive ? other : THROW_CCE();
2844
+ if (!this.ej_1.equals(tmp0_other_with_cast.ej_1))
2845
+ return false;
2846
+ if (!(this.fj_1 === tmp0_other_with_cast.fj_1))
2847
+ return false;
2848
+ return true;
2849
+ };
2850
+ function Identifier(value) {
2851
+ this.dj_1 = value;
2852
+ }
2853
+ protoOf(Identifier).toString = function () {
2854
+ return 'Identifier(value=' + this.dj_1 + ')';
2855
+ };
2856
+ protoOf(Identifier).hashCode = function () {
2857
+ return getStringHashCode(this.dj_1);
2858
+ };
2859
+ protoOf(Identifier).equals = function (other) {
2860
+ if (this === other)
2861
+ return true;
2862
+ if (!(other instanceof Identifier))
2863
+ return false;
2864
+ var tmp0_other_with_cast = other instanceof Identifier ? other : THROW_CCE();
2865
+ if (!(this.dj_1 === tmp0_other_with_cast.dj_1))
2866
+ return false;
2867
+ return true;
2868
+ };
2869
+ function Field(identifier, reference, isNullable) {
2870
+ this.zi_1 = identifier;
2871
+ this.aj_1 = reference;
2872
+ this.bj_1 = isNullable;
2873
+ }
2874
+ protoOf(Field).toString = function () {
2875
+ return 'Field(identifier=' + this.zi_1 + ', reference=' + this.aj_1 + ', isNullable=' + this.bj_1 + ')';
2876
+ };
2877
+ protoOf(Field).hashCode = function () {
2878
+ var result = this.zi_1.hashCode();
2879
+ result = imul(result, 31) + hashCode(this.aj_1) | 0;
2880
+ result = imul(result, 31) + (this.bj_1 | 0) | 0;
2881
+ return result;
2882
+ };
2883
+ protoOf(Field).equals = function (other) {
2884
+ if (this === other)
2885
+ return true;
2886
+ if (!(other instanceof Field))
2887
+ return false;
2888
+ var tmp0_other_with_cast = other instanceof Field ? other : THROW_CCE();
2889
+ if (!this.zi_1.equals(tmp0_other_with_cast.zi_1))
2890
+ return false;
2891
+ if (!equals(this.aj_1, tmp0_other_with_cast.aj_1))
2892
+ return false;
2893
+ if (!(this.bj_1 === tmp0_other_with_cast.bj_1))
2894
+ return false;
2895
+ return true;
2896
+ };
2897
+ function Shape(value) {
2898
+ this.yi_1 = value;
2899
+ }
2900
+ protoOf(Shape).toString = function () {
2901
+ return 'Shape(value=' + this.yi_1 + ')';
2902
+ };
2903
+ protoOf(Shape).hashCode = function () {
2904
+ return hashCode(this.yi_1);
2905
+ };
2906
+ protoOf(Shape).equals = function (other) {
2907
+ if (this === other)
2908
+ return true;
2909
+ if (!(other instanceof Shape))
2910
+ return false;
2911
+ var tmp0_other_with_cast = other instanceof Shape ? other : THROW_CCE();
2912
+ if (!equals(this.yi_1, tmp0_other_with_cast.yi_1))
2913
+ return false;
2914
+ return true;
2915
+ };
2916
+ function Type_0(name, shape) {
2917
+ this.ui_1 = name;
2918
+ this.vi_1 = shape;
2919
+ }
2920
+ protoOf(Type_0).toString = function () {
2921
+ return 'Type(name=' + this.ui_1 + ', shape=' + this.vi_1 + ')';
2922
+ };
2923
+ protoOf(Type_0).hashCode = function () {
2924
+ var result = getStringHashCode(this.ui_1);
2925
+ result = imul(result, 31) + this.vi_1.hashCode() | 0;
2926
+ return result;
2927
+ };
2928
+ protoOf(Type_0).equals = function (other) {
2929
+ if (this === other)
2930
+ return true;
2931
+ if (!(other instanceof Type_0))
2932
+ return false;
2933
+ var tmp0_other_with_cast = other instanceof Type_0 ? other : THROW_CCE();
2934
+ if (!(this.ui_1 === tmp0_other_with_cast.ui_1))
2935
+ return false;
2936
+ if (!this.vi_1.equals(tmp0_other_with_cast.vi_1))
2937
+ return false;
2938
+ return true;
2939
+ };
2940
+ var Method_GET_instance;
2941
+ var Method_POST_instance;
2942
+ var Method_PUT_instance;
2943
+ var Method_DELETE_instance;
2944
+ var Method_OPTIONS_instance;
2945
+ var Method_HEAD_instance;
2946
+ var Method_PATCH_instance;
2947
+ var Method_TRACE_instance;
2948
+ function values() {
2949
+ return [Method_GET_getInstance(), Method_POST_getInstance(), Method_PUT_getInstance(), Method_DELETE_getInstance(), Method_OPTIONS_getInstance(), Method_HEAD_getInstance(), Method_PATCH_getInstance(), Method_TRACE_getInstance()];
2950
+ }
2951
+ var Method_entriesInitialized;
2952
+ function Method_initEntries() {
2953
+ if (Method_entriesInitialized)
2954
+ return Unit_getInstance();
2955
+ Method_entriesInitialized = true;
2956
+ Method_GET_instance = new Method('GET', 0);
2957
+ Method_POST_instance = new Method('POST', 1);
2958
+ Method_PUT_instance = new Method('PUT', 2);
2959
+ Method_DELETE_instance = new Method('DELETE', 3);
2960
+ Method_OPTIONS_instance = new Method('OPTIONS', 4);
2961
+ Method_HEAD_instance = new Method('HEAD', 5);
2962
+ Method_PATCH_instance = new Method('PATCH', 6);
2963
+ Method_TRACE_instance = new Method('TRACE', 7);
2964
+ }
2965
+ function Literal(value) {
2966
+ this.pj_1 = value;
2967
+ }
2968
+ protoOf(Literal).toString = function () {
2969
+ return 'Literal(value=' + this.pj_1 + ')';
2970
+ };
2971
+ protoOf(Literal).hashCode = function () {
2972
+ return getStringHashCode(this.pj_1);
2973
+ };
2974
+ protoOf(Literal).equals = function (other) {
2975
+ if (this === other)
2976
+ return true;
2977
+ if (!(other instanceof Literal))
2978
+ return false;
2979
+ var tmp0_other_with_cast = other instanceof Literal ? other : THROW_CCE();
2980
+ if (!(this.pj_1 === tmp0_other_with_cast.pj_1))
2981
+ return false;
2982
+ return true;
2983
+ };
2984
+ function Param(identifier, reference) {
2985
+ this.si_1 = identifier;
2986
+ this.ti_1 = reference;
2987
+ }
2988
+ protoOf(Param).toString = function () {
2989
+ return 'Param(identifier=' + this.si_1 + ', reference=' + this.ti_1 + ')';
2990
+ };
2991
+ protoOf(Param).hashCode = function () {
2992
+ var result = this.si_1.hashCode();
2993
+ result = imul(result, 31) + hashCode(this.ti_1) | 0;
2994
+ return result;
2995
+ };
2996
+ protoOf(Param).equals = function (other) {
2997
+ if (this === other)
2998
+ return true;
2999
+ if (!(other instanceof Param))
3000
+ return false;
3001
+ var tmp0_other_with_cast = other instanceof Param ? other : THROW_CCE();
3002
+ if (!this.si_1.equals(tmp0_other_with_cast.si_1))
3003
+ return false;
3004
+ if (!equals(this.ti_1, tmp0_other_with_cast.ti_1))
3005
+ return false;
3006
+ return true;
3007
+ };
3008
+ function Method(name, ordinal) {
3009
+ Enum.call(this, name, ordinal);
3010
+ }
3011
+ function Request(content) {
3012
+ this.uh_1 = content;
3013
+ }
3014
+ protoOf(Request).toString = function () {
3015
+ return 'Request(content=' + this.uh_1 + ')';
3016
+ };
3017
+ protoOf(Request).hashCode = function () {
3018
+ return this.uh_1 == null ? 0 : this.uh_1.hashCode();
3019
+ };
3020
+ protoOf(Request).equals = function (other) {
3021
+ if (this === other)
3022
+ return true;
3023
+ if (!(other instanceof Request))
3024
+ return false;
3025
+ var tmp0_other_with_cast = other instanceof Request ? other : THROW_CCE();
3026
+ if (!equals(this.uh_1, tmp0_other_with_cast.uh_1))
3027
+ return false;
3028
+ return true;
3029
+ };
3030
+ function Response(status, content) {
3031
+ this.mi_1 = status;
3032
+ this.ni_1 = content;
3033
+ }
3034
+ protoOf(Response).toString = function () {
3035
+ return 'Response(status=' + this.mi_1 + ', content=' + this.ni_1 + ')';
3036
+ };
3037
+ protoOf(Response).hashCode = function () {
3038
+ var result = getStringHashCode(this.mi_1);
3039
+ result = imul(result, 31) + (this.ni_1 == null ? 0 : this.ni_1.hashCode()) | 0;
3040
+ return result;
3041
+ };
3042
+ protoOf(Response).equals = function (other) {
3043
+ if (this === other)
3044
+ return true;
3045
+ if (!(other instanceof Response))
3046
+ return false;
3047
+ var tmp0_other_with_cast = other instanceof Response ? other : THROW_CCE();
3048
+ if (!(this.mi_1 === tmp0_other_with_cast.mi_1))
3049
+ return false;
3050
+ if (!equals(this.ni_1, tmp0_other_with_cast.ni_1))
3051
+ return false;
3052
+ return true;
3053
+ };
3054
+ function Content(type, reference, isNullable) {
3055
+ this.vh_1 = type;
3056
+ this.wh_1 = reference;
3057
+ this.xh_1 = isNullable;
3058
+ }
3059
+ protoOf(Content).toString = function () {
3060
+ return 'Content(type=' + this.vh_1 + ', reference=' + this.wh_1 + ', isNullable=' + this.xh_1 + ')';
3061
+ };
3062
+ protoOf(Content).hashCode = function () {
3063
+ var result = getStringHashCode(this.vh_1);
3064
+ result = imul(result, 31) + hashCode(this.wh_1) | 0;
3065
+ result = imul(result, 31) + (this.xh_1 | 0) | 0;
3066
+ return result;
3067
+ };
3068
+ protoOf(Content).equals = function (other) {
3069
+ if (this === other)
3070
+ return true;
3071
+ if (!(other instanceof Content))
3072
+ return false;
3073
+ var tmp0_other_with_cast = other instanceof Content ? other : THROW_CCE();
3074
+ if (!(this.vh_1 === tmp0_other_with_cast.vh_1))
3075
+ return false;
3076
+ if (!equals(this.wh_1, tmp0_other_with_cast.wh_1))
3077
+ return false;
3078
+ if (!(this.xh_1 === tmp0_other_with_cast.xh_1))
3079
+ return false;
3080
+ return true;
3081
+ };
3082
+ function Method_GET_getInstance() {
3083
+ Method_initEntries();
3084
+ return Method_GET_instance;
3085
+ }
3086
+ function Method_POST_getInstance() {
3087
+ Method_initEntries();
3088
+ return Method_POST_instance;
3089
+ }
3090
+ function Method_PUT_getInstance() {
3091
+ Method_initEntries();
3092
+ return Method_PUT_instance;
3093
+ }
3094
+ function Method_DELETE_getInstance() {
3095
+ Method_initEntries();
3096
+ return Method_DELETE_instance;
3097
+ }
3098
+ function Method_OPTIONS_getInstance() {
3099
+ Method_initEntries();
3100
+ return Method_OPTIONS_instance;
3101
+ }
3102
+ function Method_HEAD_getInstance() {
3103
+ Method_initEntries();
3104
+ return Method_HEAD_instance;
3105
+ }
3106
+ function Method_PATCH_getInstance() {
3107
+ Method_initEntries();
3108
+ return Method_PATCH_instance;
3109
+ }
3110
+ function Method_TRACE_getInstance() {
3111
+ Method_initEntries();
3112
+ return Method_TRACE_instance;
3113
+ }
3114
+ function Endpoint(name, method, path, query, headers, cookies, requests, responses) {
3115
+ this.ei_1 = name;
3116
+ this.fi_1 = method;
3117
+ this.gi_1 = path;
3118
+ this.hi_1 = query;
3119
+ this.ii_1 = headers;
3120
+ this.ji_1 = cookies;
3121
+ this.ki_1 = requests;
3122
+ this.li_1 = responses;
3123
+ }
3124
+ protoOf(Endpoint).toString = function () {
3125
+ return 'Endpoint(name=' + this.ei_1 + ', method=' + this.fi_1 + ', path=' + this.gi_1 + ', query=' + this.hi_1 + ', headers=' + this.ii_1 + ', cookies=' + this.ji_1 + ', requests=' + this.ki_1 + ', responses=' + this.li_1 + ')';
3126
+ };
3127
+ protoOf(Endpoint).hashCode = function () {
3128
+ var result = getStringHashCode(this.ei_1);
3129
+ result = imul(result, 31) + this.fi_1.hashCode() | 0;
3130
+ result = imul(result, 31) + hashCode(this.gi_1) | 0;
3131
+ result = imul(result, 31) + hashCode(this.hi_1) | 0;
3132
+ result = imul(result, 31) + hashCode(this.ii_1) | 0;
3133
+ result = imul(result, 31) + hashCode(this.ji_1) | 0;
3134
+ result = imul(result, 31) + hashCode(this.ki_1) | 0;
3135
+ result = imul(result, 31) + hashCode(this.li_1) | 0;
3136
+ return result;
3137
+ };
3138
+ protoOf(Endpoint).equals = function (other) {
3139
+ if (this === other)
3140
+ return true;
3141
+ if (!(other instanceof Endpoint))
3142
+ return false;
3143
+ var tmp0_other_with_cast = other instanceof Endpoint ? other : THROW_CCE();
3144
+ if (!(this.ei_1 === tmp0_other_with_cast.ei_1))
3145
+ return false;
3146
+ if (!this.fi_1.equals(tmp0_other_with_cast.fi_1))
3147
+ return false;
3148
+ if (!equals(this.gi_1, tmp0_other_with_cast.gi_1))
3149
+ return false;
3150
+ if (!equals(this.hi_1, tmp0_other_with_cast.hi_1))
3151
+ return false;
3152
+ if (!equals(this.ii_1, tmp0_other_with_cast.ii_1))
3153
+ return false;
3154
+ if (!equals(this.ji_1, tmp0_other_with_cast.ji_1))
3155
+ return false;
3156
+ if (!equals(this.ki_1, tmp0_other_with_cast.ki_1))
3157
+ return false;
3158
+ if (!equals(this.li_1, tmp0_other_with_cast.li_1))
3159
+ return false;
3160
+ return true;
3161
+ };
3162
+ function Enum_0(name, entries) {
3163
+ this.ij_1 = name;
3164
+ this.jj_1 = entries;
3165
+ }
3166
+ protoOf(Enum_0).toString = function () {
3167
+ return 'Enum(name=' + this.ij_1 + ', entries=' + this.jj_1 + ')';
3168
+ };
3169
+ protoOf(Enum_0).hashCode = function () {
3170
+ var result = getStringHashCode(this.ij_1);
3171
+ result = imul(result, 31) + hashCode(this.jj_1) | 0;
3172
+ return result;
3173
+ };
3174
+ protoOf(Enum_0).equals = function (other) {
3175
+ if (this === other)
3176
+ return true;
3177
+ if (!(other instanceof Enum_0))
3178
+ return false;
3179
+ var tmp0_other_with_cast = other instanceof Enum_0 ? other : THROW_CCE();
3180
+ if (!(this.ij_1 === tmp0_other_with_cast.ij_1))
3181
+ return false;
3182
+ if (!equals(this.jj_1, tmp0_other_with_cast.jj_1))
3183
+ return false;
3184
+ return true;
3185
+ };
3186
+ function Validator(value) {
3187
+ this.nj_1 = value;
3188
+ }
3189
+ protoOf(Validator).toString = function () {
3190
+ return 'Validator(value=' + this.nj_1 + ')';
3191
+ };
3192
+ protoOf(Validator).hashCode = function () {
3193
+ return getStringHashCode(this.nj_1);
3194
+ };
3195
+ protoOf(Validator).equals = function (other) {
3196
+ if (this === other)
3197
+ return true;
3198
+ if (!(other instanceof Validator))
3199
+ return false;
3200
+ var tmp0_other_with_cast = other instanceof Validator ? other : THROW_CCE();
3201
+ if (!(this.nj_1 === tmp0_other_with_cast.nj_1))
3202
+ return false;
3203
+ return true;
3204
+ };
3205
+ function Refined(name, validator) {
3206
+ this.kj_1 = name;
3207
+ this.lj_1 = validator;
3208
+ }
3209
+ protoOf(Refined).toString = function () {
3210
+ return 'Refined(name=' + this.kj_1 + ', validator=' + this.lj_1 + ')';
3211
+ };
3212
+ protoOf(Refined).hashCode = function () {
3213
+ var result = getStringHashCode(this.kj_1);
3214
+ result = imul(result, 31) + this.lj_1.hashCode() | 0;
3215
+ return result;
3216
+ };
3217
+ protoOf(Refined).equals = function (other) {
3218
+ if (this === other)
3219
+ return true;
3220
+ if (!(other instanceof Refined))
3221
+ return false;
3222
+ var tmp0_other_with_cast = other instanceof Refined ? other : THROW_CCE();
3223
+ if (!(this.kj_1 === tmp0_other_with_cast.kj_1))
3224
+ return false;
3225
+ if (!this.lj_1.equals(tmp0_other_with_cast.lj_1))
3226
+ return false;
3227
+ return true;
3228
+ };
3229
+ function parse(_this__u8e3s4, $this) {
3230
+ var tmp$ret$11;
3231
+ // Inline function 'arrow.core.raise.either' call
3232
+ var tmp$ret$10;
3233
+ // Inline function 'arrow.core.raise.fold' call
3234
+ // Inline function 'kotlin.contracts.contract' call
3235
+ var tmp$ret$9;
3236
+ // Inline function 'arrow.core.raise.fold' call
3237
+ // Inline function 'kotlin.contracts.contract' call
3238
+ var raise = new DefaultRaise(false);
3239
+ var tmp;
3240
+ try {
3241
+ var tmp$ret$6;
3242
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3243
+ var tmp$ret$5;
3244
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parse.<anonymous>' call
3245
+ var tmp$ret$4;
3246
+ // Inline function 'kotlin.collections.map' call
3247
+ var tmp$ret$1;
3248
+ // Inline function 'kotlin.apply' call
3249
+ var tmp$ret$0;
3250
+ // Inline function 'kotlin.collections.mutableListOf' call
3251
+ tmp$ret$0 = ArrayList_init_$Create$();
3252
+ var tmp0_apply = tmp$ret$0;
3253
+ // Inline function 'kotlin.contracts.contract' call
3254
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parse.<anonymous>.<anonymous>' call
3255
+ while (_this__u8e3s4.d()) {
3256
+ tmp0_apply.a(parseDefinition(_this__u8e3s4, $this));
3257
+ }
3258
+ tmp$ret$1 = tmp0_apply;
3259
+ var tmp2_map = tmp$ret$1;
3260
+ var tmp$ret$3;
3261
+ // Inline function 'kotlin.collections.mapTo' call
3262
+ var tmp1_mapTo = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp2_map, 10));
3263
+ var tmp0_iterator = tmp2_map.c();
3264
+ while (tmp0_iterator.d()) {
3265
+ var item = tmp0_iterator.e();
3266
+ var tmp$ret$2;
3267
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parse.<anonymous>.<anonymous>' call
3268
+ tmp$ret$2 = raise.ch(item);
3269
+ tmp1_mapTo.a(tmp$ret$2);
3270
+ }
3271
+ tmp$ret$3 = tmp1_mapTo;
3272
+ tmp$ret$4 = tmp$ret$3;
3273
+ tmp$ret$5 = tmp$ret$4;
3274
+ tmp$ret$6 = tmp$ret$5;
3275
+ var res = tmp$ret$6;
3276
+ raise.zg();
3277
+ var tmp$ret$7;
3278
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3279
+ tmp$ret$7 = new Right(res);
3280
+ tmp = tmp$ret$7;
3281
+ } catch ($p) {
3282
+ var tmp_0;
3283
+ if ($p instanceof CancellationException) {
3284
+ var e = $p;
3285
+ raise.zg();
3286
+ var tmp$ret$8;
3287
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3288
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3289
+ tmp$ret$8 = new Left(tmp1__anonymous__uwfjfc);
3290
+ tmp_0 = tmp$ret$8;
3291
+ } else {
3292
+ if ($p instanceof Error) {
3293
+ var e_0 = $p;
3294
+ raise.zg();
3295
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3296
+ throw tmp0__anonymous__q1qw7t;
3297
+ } else {
3298
+ throw $p;
3299
+ }
3300
+ }
3301
+ tmp = tmp_0;
3302
+ }
3303
+ tmp$ret$9 = tmp;
3304
+ tmp$ret$10 = tmp$ret$9;
3305
+ tmp$ret$11 = tmp$ret$10;
3306
+ return tmp$ret$11;
3307
+ }
3308
+ function parseDefinition(_this__u8e3s4, $this) {
3309
+ var tmp$ret$8;
3310
+ // Inline function 'arrow.core.raise.either' call
3311
+ var tmp$ret$7;
3312
+ // Inline function 'arrow.core.raise.fold' call
3313
+ // Inline function 'kotlin.contracts.contract' call
3314
+ var tmp$ret$6;
3315
+ // Inline function 'arrow.core.raise.fold' call
3316
+ // Inline function 'kotlin.contracts.contract' call
3317
+ var raise = new DefaultRaise(false);
3318
+ var tmp;
3319
+ try {
3320
+ var tmp$ret$3;
3321
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3322
+ var tmp$ret$2;
3323
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseDefinition.<anonymous>' call
3324
+ log(_this__u8e3s4.cl_1, $this);
3325
+ var tmp0_subject = _this__u8e3s4.cl_1.sk_1;
3326
+ var tmp_0;
3327
+ if (tmp0_subject instanceof WsTypeDef) {
3328
+ tmp_0 = raise.ch(parseTypeDeclaration(_this__u8e3s4, $this));
3329
+ } else {
3330
+ if (tmp0_subject instanceof WsEnumTypeDef) {
3331
+ tmp_0 = raise.ch(parseEnumTypeDeclaration(_this__u8e3s4, $this));
3332
+ } else {
3333
+ if (tmp0_subject instanceof WsRefinedTypeDef) {
3334
+ tmp_0 = raise.ch(parseRefinedTypeDeclaration(_this__u8e3s4, $this));
3335
+ } else {
3336
+ var tmp$ret$1;
3337
+ // Inline function 'arrow.core.nel' call
3338
+ var tmp$ret$0;
3339
+ // Inline function 'kotlin.also' call
3340
+ var tmp0_also = new WrongTokenException(getKClass(WsTypeDef), _this__u8e3s4.cl_1);
3341
+ // Inline function 'kotlin.contracts.contract' call
3342
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseDefinition.<anonymous>.<anonymous>' call
3343
+ _this__u8e3s4.el();
3344
+ tmp$ret$0 = tmp0_also;
3345
+ var tmp1_nel = tmp$ret$0;
3346
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3347
+ raise.bh(tmp$ret$1);
3348
+ }
3349
+ }
3350
+ }
3351
+ tmp$ret$2 = tmp_0;
3352
+ tmp$ret$3 = tmp$ret$2;
3353
+ var res = tmp$ret$3;
3354
+ raise.zg();
3355
+ var tmp$ret$4;
3356
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3357
+ tmp$ret$4 = new Right(res);
3358
+ tmp = tmp$ret$4;
3359
+ } catch ($p) {
3360
+ var tmp_1;
3361
+ if ($p instanceof CancellationException) {
3362
+ var e = $p;
3363
+ raise.zg();
3364
+ var tmp$ret$5;
3365
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3366
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3367
+ tmp$ret$5 = new Left(tmp1__anonymous__uwfjfc);
3368
+ tmp_1 = tmp$ret$5;
3369
+ } else {
3370
+ if ($p instanceof Error) {
3371
+ var e_0 = $p;
3372
+ raise.zg();
3373
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3374
+ throw tmp0__anonymous__q1qw7t;
3375
+ } else {
3376
+ throw $p;
3377
+ }
3378
+ }
3379
+ tmp = tmp_1;
3380
+ }
3381
+ tmp$ret$6 = tmp;
3382
+ tmp$ret$7 = tmp$ret$6;
3383
+ tmp$ret$8 = tmp$ret$7;
3384
+ return tmp$ret$8;
3385
+ }
3386
+ function parseTypeDeclaration(_this__u8e3s4, $this) {
3387
+ var tmp$ret$8;
3388
+ // Inline function 'arrow.core.raise.either' call
3389
+ var tmp$ret$7;
3390
+ // Inline function 'arrow.core.raise.fold' call
3391
+ // Inline function 'kotlin.contracts.contract' call
3392
+ var tmp$ret$6;
3393
+ // Inline function 'arrow.core.raise.fold' call
3394
+ // Inline function 'kotlin.contracts.contract' call
3395
+ var raise = new DefaultRaise(false);
3396
+ var tmp;
3397
+ try {
3398
+ var tmp$ret$3;
3399
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3400
+ var tmp$ret$2;
3401
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeDeclaration.<anonymous>' call
3402
+ _this__u8e3s4.el();
3403
+ log(_this__u8e3s4.cl_1, $this);
3404
+ var tmp0_subject = _this__u8e3s4.cl_1.sk_1;
3405
+ var tmp_0;
3406
+ if (tmp0_subject instanceof CustomType) {
3407
+ tmp_0 = raise.ch(parseTypeDefinition(_this__u8e3s4, $this, _this__u8e3s4.cl_1.tk_1));
3408
+ } else {
3409
+ var tmp$ret$1;
3410
+ // Inline function 'arrow.core.nel' call
3411
+ var tmp$ret$0;
3412
+ // Inline function 'kotlin.also' call
3413
+ var tmp0_also = new WrongTokenException(getKClass(CustomType), _this__u8e3s4.cl_1);
3414
+ // Inline function 'kotlin.contracts.contract' call
3415
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeDeclaration.<anonymous>.<anonymous>' call
3416
+ _this__u8e3s4.el();
3417
+ tmp$ret$0 = tmp0_also;
3418
+ var tmp1_nel = tmp$ret$0;
3419
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3420
+ raise.bh(tmp$ret$1);
3421
+ }
3422
+ tmp$ret$2 = tmp_0;
3423
+ tmp$ret$3 = tmp$ret$2;
3424
+ var res = tmp$ret$3;
3425
+ raise.zg();
3426
+ var tmp$ret$4;
3427
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3428
+ tmp$ret$4 = new Right(res);
3429
+ tmp = tmp$ret$4;
3430
+ } catch ($p) {
3431
+ var tmp_1;
3432
+ if ($p instanceof CancellationException) {
3433
+ var e = $p;
3434
+ raise.zg();
3435
+ var tmp$ret$5;
3436
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3437
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3438
+ tmp$ret$5 = new Left(tmp1__anonymous__uwfjfc);
3439
+ tmp_1 = tmp$ret$5;
3440
+ } else {
3441
+ if ($p instanceof Error) {
3442
+ var e_0 = $p;
3443
+ raise.zg();
3444
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3445
+ throw tmp0__anonymous__q1qw7t;
3446
+ } else {
3447
+ throw $p;
3448
+ }
3449
+ }
3450
+ tmp = tmp_1;
3451
+ }
3452
+ tmp$ret$6 = tmp;
3453
+ tmp$ret$7 = tmp$ret$6;
3454
+ tmp$ret$8 = tmp$ret$7;
3455
+ return tmp$ret$8;
3456
+ }
3457
+ function parseTypeDefinition(_this__u8e3s4, $this, typeName) {
3458
+ var tmp$ret$11;
3459
+ // Inline function 'arrow.core.raise.either' call
3460
+ var tmp$ret$10;
3461
+ // Inline function 'arrow.core.raise.fold' call
3462
+ // Inline function 'kotlin.contracts.contract' call
3463
+ var tmp$ret$9;
3464
+ // Inline function 'arrow.core.raise.fold' call
3465
+ // Inline function 'kotlin.contracts.contract' call
3466
+ var raise = new DefaultRaise(false);
3467
+ var tmp;
3468
+ try {
3469
+ var tmp$ret$6;
3470
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3471
+ var tmp$ret$5;
3472
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeDefinition.<anonymous>' call
3473
+ _this__u8e3s4.el();
3474
+ log(_this__u8e3s4.cl_1, $this);
3475
+ var tmp$ret$4;
3476
+ // Inline function 'kotlin.also' call
3477
+ var tmp0_subject = _this__u8e3s4.cl_1.sk_1;
3478
+ var tmp_0;
3479
+ if (tmp0_subject instanceof LeftCurly) {
3480
+ tmp_0 = new Type_0(typeName, raise.ch(parseTypeShape(_this__u8e3s4, $this)));
3481
+ } else {
3482
+ var tmp$ret$1;
3483
+ // Inline function 'arrow.core.nel' call
3484
+ var tmp$ret$0;
3485
+ // Inline function 'kotlin.also' call
3486
+ var tmp0_also = new WrongTokenException(getKClass(LeftCurly), _this__u8e3s4.cl_1);
3487
+ // Inline function 'kotlin.contracts.contract' call
3488
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeDefinition.<anonymous>.<anonymous>' call
3489
+ _this__u8e3s4.el();
3490
+ tmp$ret$0 = tmp0_also;
3491
+ var tmp1_nel = tmp$ret$0;
3492
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3493
+ raise.bh(tmp$ret$1);
3494
+ }
3495
+ var tmp2_also = tmp_0;
3496
+ // Inline function 'kotlin.contracts.contract' call
3497
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeDefinition.<anonymous>.<anonymous>' call
3498
+ var tmp0_subject_0 = _this__u8e3s4.cl_1.sk_1;
3499
+ if (tmp0_subject_0 instanceof RightCurly) {
3500
+ _this__u8e3s4.el();
3501
+ } else {
3502
+ var tmp$ret$3;
3503
+ // Inline function 'arrow.core.nel' call
3504
+ var tmp$ret$2;
3505
+ // Inline function 'kotlin.also' call
3506
+ var tmp0_also_0 = new WrongTokenException(getKClass(RightCurly), _this__u8e3s4.cl_1);
3507
+ // Inline function 'kotlin.contracts.contract' call
3508
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeDefinition.<anonymous>.<anonymous>.<anonymous>' call
3509
+ _this__u8e3s4.el();
3510
+ tmp$ret$2 = tmp0_also_0;
3511
+ var tmp1_nel_0 = tmp$ret$2;
3512
+ tmp$ret$3 = nonEmptyListOf(tmp1_nel_0, []);
3513
+ raise.bh(tmp$ret$3);
3514
+ }
3515
+ tmp$ret$4 = tmp2_also;
3516
+ tmp$ret$5 = tmp$ret$4;
3517
+ tmp$ret$6 = tmp$ret$5;
3518
+ var res = tmp$ret$6;
3519
+ raise.zg();
3520
+ var tmp$ret$7;
3521
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3522
+ tmp$ret$7 = new Right(res);
3523
+ tmp = tmp$ret$7;
3524
+ } catch ($p) {
3525
+ var tmp_1;
3526
+ if ($p instanceof CancellationException) {
3527
+ var e = $p;
3528
+ raise.zg();
3529
+ var tmp$ret$8;
3530
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3531
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3532
+ tmp$ret$8 = new Left(tmp1__anonymous__uwfjfc);
3533
+ tmp_1 = tmp$ret$8;
3534
+ } else {
3535
+ if ($p instanceof Error) {
3536
+ var e_0 = $p;
3537
+ raise.zg();
3538
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3539
+ throw tmp0__anonymous__q1qw7t;
3540
+ } else {
3541
+ throw $p;
3542
+ }
3543
+ }
3544
+ tmp = tmp_1;
3545
+ }
3546
+ tmp$ret$9 = tmp;
3547
+ tmp$ret$10 = tmp$ret$9;
3548
+ tmp$ret$11 = tmp$ret$10;
3549
+ return tmp$ret$11;
3550
+ }
3551
+ function parseTypeShape(_this__u8e3s4, $this) {
3552
+ var tmp$ret$13;
3553
+ // Inline function 'arrow.core.raise.either' call
3554
+ var tmp$ret$12;
3555
+ // Inline function 'arrow.core.raise.fold' call
3556
+ // Inline function 'kotlin.contracts.contract' call
3557
+ var tmp$ret$11;
3558
+ // Inline function 'arrow.core.raise.fold' call
3559
+ // Inline function 'kotlin.contracts.contract' call
3560
+ var raise = new DefaultRaise(false);
3561
+ var tmp;
3562
+ try {
3563
+ var tmp$ret$8;
3564
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3565
+ var tmp$ret$7;
3566
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeShape.<anonymous>' call
3567
+ _this__u8e3s4.el();
3568
+ log(_this__u8e3s4.cl_1, $this);
3569
+ var tmp$ret$6;
3570
+ // Inline function 'kotlin.let' call
3571
+ var tmp0_subject = _this__u8e3s4.cl_1.sk_1;
3572
+ var tmp_0;
3573
+ if (tmp0_subject instanceof CustomValue) {
3574
+ var tmp$ret$3;
3575
+ // Inline function 'kotlin.apply' call
3576
+ var tmp$ret$0;
3577
+ // Inline function 'kotlin.collections.mutableListOf' call
3578
+ tmp$ret$0 = ArrayList_init_$Create$();
3579
+ var tmp0_apply = tmp$ret$0;
3580
+ // Inline function 'kotlin.contracts.contract' call
3581
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeShape.<anonymous>.<anonymous>' call
3582
+ tmp0_apply.a(raise.ch(parseField(_this__u8e3s4, $this, new Identifier(_this__u8e3s4.cl_1.tk_1))));
3583
+ while (equals(_this__u8e3s4.cl_1.sk_1, Comma_getInstance())) {
3584
+ _this__u8e3s4.el();
3585
+ var tmp0_subject_0 = _this__u8e3s4.cl_1.sk_1;
3586
+ if (tmp0_subject_0 instanceof CustomValue) {
3587
+ tmp0_apply.a(raise.ch(parseField(_this__u8e3s4, $this, new Identifier(_this__u8e3s4.cl_1.tk_1))));
3588
+ } else {
3589
+ var tmp$ret$2;
3590
+ // Inline function 'arrow.core.nel' call
3591
+ var tmp$ret$1;
3592
+ // Inline function 'kotlin.also' call
3593
+ var tmp0_also = new WrongTokenException(getKClass(CustomValue), _this__u8e3s4.cl_1);
3594
+ // Inline function 'kotlin.contracts.contract' call
3595
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeShape.<anonymous>.<anonymous>.<anonymous>' call
3596
+ _this__u8e3s4.el();
3597
+ tmp$ret$1 = tmp0_also;
3598
+ var tmp1_nel = tmp$ret$1;
3599
+ tmp$ret$2 = nonEmptyListOf(tmp1_nel, []);
3600
+ raise.bh(tmp$ret$2);
3601
+ }
3602
+ }
3603
+ tmp$ret$3 = tmp0_apply;
3604
+ tmp_0 = tmp$ret$3;
3605
+ } else {
3606
+ var tmp$ret$5;
3607
+ // Inline function 'arrow.core.nel' call
3608
+ var tmp$ret$4;
3609
+ // Inline function 'kotlin.also' call
3610
+ var tmp1_also = new WrongTokenException(getKClass(CustomValue), _this__u8e3s4.cl_1);
3611
+ // Inline function 'kotlin.contracts.contract' call
3612
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseTypeShape.<anonymous>.<anonymous>' call
3613
+ _this__u8e3s4.el();
3614
+ tmp$ret$4 = tmp1_also;
3615
+ var tmp2_nel = tmp$ret$4;
3616
+ tmp$ret$5 = nonEmptyListOf(tmp2_nel, []);
3617
+ raise.bh(tmp$ret$5);
3618
+ }
3619
+ var tmp3_let = tmp_0;
3620
+ // Inline function 'kotlin.contracts.contract' call
3621
+ tmp$ret$6 = new Shape(tmp3_let);
3622
+ tmp$ret$7 = tmp$ret$6;
3623
+ tmp$ret$8 = tmp$ret$7;
3624
+ var res = tmp$ret$8;
3625
+ raise.zg();
3626
+ var tmp$ret$9;
3627
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3628
+ tmp$ret$9 = new Right(res);
3629
+ tmp = tmp$ret$9;
3630
+ } catch ($p) {
3631
+ var tmp_1;
3632
+ if ($p instanceof CancellationException) {
3633
+ var e = $p;
3634
+ raise.zg();
3635
+ var tmp$ret$10;
3636
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3637
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3638
+ tmp$ret$10 = new Left(tmp1__anonymous__uwfjfc);
3639
+ tmp_1 = tmp$ret$10;
3640
+ } else {
3641
+ if ($p instanceof Error) {
3642
+ var e_0 = $p;
3643
+ raise.zg();
3644
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3645
+ throw tmp0__anonymous__q1qw7t;
3646
+ } else {
3647
+ throw $p;
3648
+ }
3649
+ }
3650
+ tmp = tmp_1;
3651
+ }
3652
+ tmp$ret$11 = tmp;
3653
+ tmp$ret$12 = tmp$ret$11;
3654
+ tmp$ret$13 = tmp$ret$12;
3655
+ return tmp$ret$13;
3656
+ }
3657
+ function parseField(_this__u8e3s4, $this, identifier) {
3658
+ var tmp$ret$11;
3659
+ // Inline function 'arrow.core.raise.either' call
3660
+ var tmp$ret$10;
3661
+ // Inline function 'arrow.core.raise.fold' call
3662
+ // Inline function 'kotlin.contracts.contract' call
3663
+ var tmp$ret$9;
3664
+ // Inline function 'arrow.core.raise.fold' call
3665
+ // Inline function 'kotlin.contracts.contract' call
3666
+ var raise = new DefaultRaise(false);
3667
+ var tmp;
3668
+ try {
3669
+ var tmp$ret$6;
3670
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3671
+ var tmp$ret$5;
3672
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseField.<anonymous>' call
3673
+ _this__u8e3s4.el();
3674
+ log(_this__u8e3s4.cl_1, $this);
3675
+ var tmp0_subject = _this__u8e3s4.cl_1.sk_1;
3676
+ if (tmp0_subject instanceof Colon) {
3677
+ _this__u8e3s4.el();
3678
+ } else {
3679
+ var tmp$ret$1;
3680
+ // Inline function 'arrow.core.nel' call
3681
+ var tmp$ret$0;
3682
+ // Inline function 'kotlin.also' call
3683
+ var tmp0_also = new WrongTokenException(getKClass(Colon), _this__u8e3s4.cl_1);
3684
+ // Inline function 'kotlin.contracts.contract' call
3685
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseField.<anonymous>.<anonymous>' call
3686
+ _this__u8e3s4.el();
3687
+ tmp$ret$0 = tmp0_also;
3688
+ var tmp1_nel = tmp$ret$0;
3689
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3690
+ raise.bh(tmp$ret$1);
3691
+ }
3692
+ var type = _this__u8e3s4.cl_1.sk_1;
3693
+ var tmp_0;
3694
+ if (isInterface(type, WsType)) {
3695
+ var tmp_1 = parseFieldValue(_this__u8e3s4, $this, type, _this__u8e3s4.cl_1.tk_1);
3696
+ var tmp$ret$2;
3697
+ // Inline function 'kotlin.also' call
3698
+ var tmp_2 = _this__u8e3s4.cl_1.sk_1;
3699
+ var tmp2_also = tmp_2 instanceof QuestionMark;
3700
+ // Inline function 'kotlin.contracts.contract' call
3701
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseField.<anonymous>.<anonymous>' call
3702
+ if (tmp2_also) {
3703
+ _this__u8e3s4.el();
3704
+ }
3705
+ tmp$ret$2 = tmp2_also;
3706
+ tmp_0 = new Field(identifier, tmp_1, tmp$ret$2);
3707
+ } else {
3708
+ var tmp$ret$4;
3709
+ // Inline function 'arrow.core.nel' call
3710
+ var tmp$ret$3;
3711
+ // Inline function 'kotlin.also' call
3712
+ var tmp3_also = new WrongTokenException(getKClass(CustomType), _this__u8e3s4.cl_1);
3713
+ // Inline function 'kotlin.contracts.contract' call
3714
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseField.<anonymous>.<anonymous>' call
3715
+ _this__u8e3s4.el();
3716
+ tmp$ret$3 = tmp3_also;
3717
+ var tmp4_nel = tmp$ret$3;
3718
+ tmp$ret$4 = nonEmptyListOf(tmp4_nel, []);
3719
+ raise.bh(tmp$ret$4);
3720
+ }
3721
+ tmp$ret$5 = tmp_0;
3722
+ tmp$ret$6 = tmp$ret$5;
3723
+ var res = tmp$ret$6;
3724
+ raise.zg();
3725
+ var tmp$ret$7;
3726
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3727
+ tmp$ret$7 = new Right(res);
3728
+ tmp = tmp$ret$7;
3729
+ } catch ($p) {
3730
+ var tmp_3;
3731
+ if ($p instanceof CancellationException) {
3732
+ var e = $p;
3733
+ raise.zg();
3734
+ var tmp$ret$8;
3735
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3736
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3737
+ tmp$ret$8 = new Left(tmp1__anonymous__uwfjfc);
3738
+ tmp_3 = tmp$ret$8;
3739
+ } else {
3740
+ if ($p instanceof Error) {
3741
+ var e_0 = $p;
3742
+ raise.zg();
3743
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3744
+ throw tmp0__anonymous__q1qw7t;
3745
+ } else {
3746
+ throw $p;
3747
+ }
3748
+ }
3749
+ tmp = tmp_3;
3750
+ }
3751
+ tmp$ret$9 = tmp;
3752
+ tmp$ret$10 = tmp$ret$9;
3753
+ tmp$ret$11 = tmp$ret$10;
3754
+ return tmp$ret$11;
3755
+ }
3756
+ function parseFieldValue(_this__u8e3s4, $this, wsType, value) {
3757
+ var tmp$ret$2;
3758
+ // Inline function 'kotlin.run' call
3759
+ // Inline function 'kotlin.contracts.contract' call
3760
+ var tmp$ret$1;
3761
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseFieldValue.<anonymous>' call
3762
+ _this__u8e3s4.el();
3763
+ log(_this__u8e3s4.cl_1, $this);
3764
+ var tmp$ret$0;
3765
+ // Inline function 'kotlin.also' call
3766
+ var tmp = _this__u8e3s4.cl_1.sk_1;
3767
+ var tmp0_also = tmp instanceof Brackets;
3768
+ // Inline function 'kotlin.contracts.contract' call
3769
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseFieldValue.<anonymous>.<anonymous>' call
3770
+ if (tmp0_also) {
3771
+ _this__u8e3s4.el();
3772
+ }
3773
+ tmp$ret$0 = tmp0_also;
3774
+ var isIterable = tmp$ret$0;
3775
+ var tmp0_subject = wsType;
3776
+ var tmp_0;
3777
+ if (tmp0_subject instanceof WsString) {
3778
+ tmp_0 = new Primitive(Type_String_getInstance(), isIterable);
3779
+ } else {
3780
+ if (tmp0_subject instanceof WsInteger) {
3781
+ tmp_0 = new Primitive(Type_Integer_getInstance(), isIterable);
3782
+ } else {
3783
+ if (tmp0_subject instanceof WsBoolean) {
3784
+ tmp_0 = new Primitive(Type_Boolean_getInstance(), isIterable);
3785
+ } else {
3786
+ if (tmp0_subject instanceof CustomType) {
3787
+ tmp_0 = new Custom(value, isIterable);
3788
+ } else {
3789
+ noWhenBranchMatchedException();
3790
+ }
3791
+ }
3792
+ }
3793
+ }
3794
+ tmp$ret$1 = tmp_0;
3795
+ tmp$ret$2 = tmp$ret$1;
3796
+ return tmp$ret$2;
3797
+ }
3798
+ function parseEnumTypeDeclaration(_this__u8e3s4, $this) {
3799
+ var tmp$ret$8;
3800
+ // Inline function 'arrow.core.raise.either' call
3801
+ var tmp$ret$7;
3802
+ // Inline function 'arrow.core.raise.fold' call
3803
+ // Inline function 'kotlin.contracts.contract' call
3804
+ var tmp$ret$6;
3805
+ // Inline function 'arrow.core.raise.fold' call
3806
+ // Inline function 'kotlin.contracts.contract' call
3807
+ var raise = new DefaultRaise(false);
3808
+ var tmp;
3809
+ try {
3810
+ var tmp$ret$3;
3811
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3812
+ var tmp$ret$2;
3813
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeDeclaration.<anonymous>' call
3814
+ _this__u8e3s4.el();
3815
+ log(_this__u8e3s4.cl_1, $this);
3816
+ var tmp0_subject = _this__u8e3s4.cl_1.sk_1;
3817
+ var tmp_0;
3818
+ if (tmp0_subject instanceof CustomType) {
3819
+ tmp_0 = raise.ch(parseEnumTypeDefinition(_this__u8e3s4, $this, _this__u8e3s4.cl_1.tk_1));
3820
+ } else {
3821
+ var tmp$ret$1;
3822
+ // Inline function 'arrow.core.nel' call
3823
+ var tmp$ret$0;
3824
+ // Inline function 'kotlin.also' call
3825
+ var tmp0_also = new WrongTokenException(getKClass(CustomType), _this__u8e3s4.cl_1);
3826
+ // Inline function 'kotlin.contracts.contract' call
3827
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeDeclaration.<anonymous>.<anonymous>' call
3828
+ _this__u8e3s4.el();
3829
+ tmp$ret$0 = tmp0_also;
3830
+ var tmp1_nel = tmp$ret$0;
3831
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3832
+ raise.bh(tmp$ret$1);
3833
+ }
3834
+ tmp$ret$2 = tmp_0;
3835
+ tmp$ret$3 = tmp$ret$2;
3836
+ var res = tmp$ret$3;
3837
+ raise.zg();
3838
+ var tmp$ret$4;
3839
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3840
+ tmp$ret$4 = new Right(res);
3841
+ tmp = tmp$ret$4;
3842
+ } catch ($p) {
3843
+ var tmp_1;
3844
+ if ($p instanceof CancellationException) {
3845
+ var e = $p;
3846
+ raise.zg();
3847
+ var tmp$ret$5;
3848
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3849
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3850
+ tmp$ret$5 = new Left(tmp1__anonymous__uwfjfc);
3851
+ tmp_1 = tmp$ret$5;
3852
+ } else {
3853
+ if ($p instanceof Error) {
3854
+ var e_0 = $p;
3855
+ raise.zg();
3856
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3857
+ throw tmp0__anonymous__q1qw7t;
3858
+ } else {
3859
+ throw $p;
3860
+ }
3861
+ }
3862
+ tmp = tmp_1;
3863
+ }
3864
+ tmp$ret$6 = tmp;
3865
+ tmp$ret$7 = tmp$ret$6;
3866
+ tmp$ret$8 = tmp$ret$7;
3867
+ return tmp$ret$8;
3868
+ }
3869
+ function parseEnumTypeDefinition(_this__u8e3s4, $this, typeName) {
3870
+ var tmp$ret$11;
3871
+ // Inline function 'arrow.core.raise.either' call
3872
+ var tmp$ret$10;
3873
+ // Inline function 'arrow.core.raise.fold' call
3874
+ // Inline function 'kotlin.contracts.contract' call
3875
+ var tmp$ret$9;
3876
+ // Inline function 'arrow.core.raise.fold' call
3877
+ // Inline function 'kotlin.contracts.contract' call
3878
+ var raise = new DefaultRaise(false);
3879
+ var tmp;
3880
+ try {
3881
+ var tmp$ret$6;
3882
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3883
+ var tmp$ret$5;
3884
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeDefinition.<anonymous>' call
3885
+ _this__u8e3s4.el();
3886
+ log(_this__u8e3s4.cl_1, $this);
3887
+ var tmp$ret$4;
3888
+ // Inline function 'kotlin.also' call
3889
+ var tmp0_subject = _this__u8e3s4.cl_1.sk_1;
3890
+ var tmp_0;
3891
+ if (tmp0_subject instanceof LeftCurly) {
3892
+ tmp_0 = new Enum_0(typeName, raise.ch(parseEnumTypeEntries(_this__u8e3s4, $this)));
3893
+ } else {
3894
+ var tmp$ret$1;
3895
+ // Inline function 'arrow.core.nel' call
3896
+ var tmp$ret$0;
3897
+ // Inline function 'kotlin.also' call
3898
+ var tmp0_also = new WrongTokenException(getKClass(LeftCurly), _this__u8e3s4.cl_1);
3899
+ // Inline function 'kotlin.contracts.contract' call
3900
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeDefinition.<anonymous>.<anonymous>' call
3901
+ _this__u8e3s4.el();
3902
+ tmp$ret$0 = tmp0_also;
3903
+ var tmp1_nel = tmp$ret$0;
3904
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
3905
+ raise.bh(tmp$ret$1);
3906
+ }
3907
+ var tmp2_also = tmp_0;
3908
+ // Inline function 'kotlin.contracts.contract' call
3909
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeDefinition.<anonymous>.<anonymous>' call
3910
+ var tmp0_subject_0 = _this__u8e3s4.cl_1.sk_1;
3911
+ if (tmp0_subject_0 instanceof RightCurly) {
3912
+ _this__u8e3s4.el();
3913
+ } else {
3914
+ var tmp$ret$3;
3915
+ // Inline function 'arrow.core.nel' call
3916
+ var tmp$ret$2;
3917
+ // Inline function 'kotlin.also' call
3918
+ var tmp0_also_0 = new WrongTokenException(getKClass(RightCurly), _this__u8e3s4.cl_1);
3919
+ // Inline function 'kotlin.contracts.contract' call
3920
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeDefinition.<anonymous>.<anonymous>.<anonymous>' call
3921
+ _this__u8e3s4.el();
3922
+ tmp$ret$2 = tmp0_also_0;
3923
+ var tmp1_nel_0 = tmp$ret$2;
3924
+ tmp$ret$3 = nonEmptyListOf(tmp1_nel_0, []);
3925
+ raise.bh(tmp$ret$3);
3926
+ }
3927
+ tmp$ret$4 = tmp2_also;
3928
+ tmp$ret$5 = tmp$ret$4;
3929
+ tmp$ret$6 = tmp$ret$5;
3930
+ var res = tmp$ret$6;
3931
+ raise.zg();
3932
+ var tmp$ret$7;
3933
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3934
+ tmp$ret$7 = new Right(res);
3935
+ tmp = tmp$ret$7;
3936
+ } catch ($p) {
3937
+ var tmp_1;
3938
+ if ($p instanceof CancellationException) {
3939
+ var e = $p;
3940
+ raise.zg();
3941
+ var tmp$ret$8;
3942
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3943
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
3944
+ tmp$ret$8 = new Left(tmp1__anonymous__uwfjfc);
3945
+ tmp_1 = tmp$ret$8;
3946
+ } else {
3947
+ if ($p instanceof Error) {
3948
+ var e_0 = $p;
3949
+ raise.zg();
3950
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
3951
+ throw tmp0__anonymous__q1qw7t;
3952
+ } else {
3953
+ throw $p;
3954
+ }
3955
+ }
3956
+ tmp = tmp_1;
3957
+ }
3958
+ tmp$ret$9 = tmp;
3959
+ tmp$ret$10 = tmp$ret$9;
3960
+ tmp$ret$11 = tmp$ret$10;
3961
+ return tmp$ret$11;
3962
+ }
3963
+ function parseEnumTypeEntries(_this__u8e3s4, $this) {
3964
+ var tmp$ret$13;
3965
+ // Inline function 'arrow.core.raise.either' call
3966
+ var tmp$ret$12;
3967
+ // Inline function 'arrow.core.raise.fold' call
3968
+ // Inline function 'kotlin.contracts.contract' call
3969
+ var tmp$ret$11;
3970
+ // Inline function 'arrow.core.raise.fold' call
3971
+ // Inline function 'kotlin.contracts.contract' call
3972
+ var raise = new DefaultRaise(false);
3973
+ var tmp;
3974
+ try {
3975
+ var tmp$ret$8;
3976
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
3977
+ var tmp$ret$7;
3978
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeEntries.<anonymous>' call
3979
+ _this__u8e3s4.el();
3980
+ log(_this__u8e3s4.cl_1, $this);
3981
+ var tmp0_subject = _this__u8e3s4.cl_1.sk_1;
3982
+ var tmp_0;
3983
+ if (tmp0_subject instanceof CustomType) {
3984
+ var tmp$ret$4;
3985
+ // Inline function 'kotlin.apply' call
3986
+ var tmp$ret$0;
3987
+ // Inline function 'kotlin.collections.mutableListOf' call
3988
+ tmp$ret$0 = ArrayList_init_$Create$();
3989
+ var tmp0_apply = tmp$ret$0;
3990
+ // Inline function 'kotlin.contracts.contract' call
3991
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeEntries.<anonymous>.<anonymous>' call
3992
+ tmp0_apply.a(_this__u8e3s4.cl_1.tk_1);
3993
+ _this__u8e3s4.el();
3994
+ while (equals(_this__u8e3s4.cl_1.sk_1, Comma_getInstance())) {
3995
+ _this__u8e3s4.el();
3996
+ var tmp0_subject_0 = _this__u8e3s4.cl_1.sk_1;
3997
+ if (tmp0_subject_0 instanceof CustomType) {
3998
+ var tmp$ret$1;
3999
+ // Inline function 'kotlin.also' call
4000
+ var tmp0_also = tmp0_apply.a(_this__u8e3s4.cl_1.tk_1);
4001
+ // Inline function 'kotlin.contracts.contract' call
4002
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeEntries.<anonymous>.<anonymous>.<anonymous>' call
4003
+ _this__u8e3s4.el();
4004
+ tmp$ret$1 = tmp0_also;
4005
+ } else {
4006
+ var tmp$ret$3;
4007
+ // Inline function 'arrow.core.nel' call
4008
+ var tmp$ret$2;
4009
+ // Inline function 'kotlin.also' call
4010
+ var tmp1_also = new WrongTokenException(getKClass(CustomType), _this__u8e3s4.cl_1);
4011
+ // Inline function 'kotlin.contracts.contract' call
4012
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeEntries.<anonymous>.<anonymous>.<anonymous>' call
4013
+ _this__u8e3s4.el();
4014
+ tmp$ret$2 = tmp1_also;
4015
+ var tmp2_nel = tmp$ret$2;
4016
+ tmp$ret$3 = nonEmptyListOf(tmp2_nel, []);
4017
+ raise.bh(tmp$ret$3);
4018
+ }
4019
+ }
4020
+ tmp$ret$4 = tmp0_apply;
4021
+ tmp_0 = tmp$ret$4;
4022
+ } else {
4023
+ var tmp$ret$6;
4024
+ // Inline function 'arrow.core.nel' call
4025
+ var tmp$ret$5;
4026
+ // Inline function 'kotlin.also' call
4027
+ var tmp1_also_0 = new WrongTokenException(getKClass(CustomType), _this__u8e3s4.cl_1);
4028
+ // Inline function 'kotlin.contracts.contract' call
4029
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseEnumTypeEntries.<anonymous>.<anonymous>' call
4030
+ _this__u8e3s4.el();
4031
+ tmp$ret$5 = tmp1_also_0;
4032
+ var tmp2_nel_0 = tmp$ret$5;
4033
+ tmp$ret$6 = nonEmptyListOf(tmp2_nel_0, []);
4034
+ raise.bh(tmp$ret$6);
4035
+ }
4036
+ tmp$ret$7 = toSet(tmp_0);
4037
+ tmp$ret$8 = tmp$ret$7;
4038
+ var res = tmp$ret$8;
4039
+ raise.zg();
4040
+ var tmp$ret$9;
4041
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
4042
+ tmp$ret$9 = new Right(res);
4043
+ tmp = tmp$ret$9;
4044
+ } catch ($p) {
4045
+ var tmp_1;
4046
+ if ($p instanceof CancellationException) {
4047
+ var e = $p;
4048
+ raise.zg();
4049
+ var tmp$ret$10;
4050
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
4051
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
4052
+ tmp$ret$10 = new Left(tmp1__anonymous__uwfjfc);
4053
+ tmp_1 = tmp$ret$10;
4054
+ } else {
4055
+ if ($p instanceof Error) {
4056
+ var e_0 = $p;
4057
+ raise.zg();
4058
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
4059
+ throw tmp0__anonymous__q1qw7t;
4060
+ } else {
4061
+ throw $p;
4062
+ }
4063
+ }
4064
+ tmp = tmp_1;
4065
+ }
4066
+ tmp$ret$11 = tmp;
4067
+ tmp$ret$12 = tmp$ret$11;
4068
+ tmp$ret$13 = tmp$ret$12;
4069
+ return tmp$ret$13;
4070
+ }
4071
+ function parseRefinedTypeDeclaration(_this__u8e3s4, $this) {
4072
+ var tmp$ret$8;
4073
+ // Inline function 'arrow.core.raise.either' call
4074
+ var tmp$ret$7;
4075
+ // Inline function 'arrow.core.raise.fold' call
4076
+ // Inline function 'kotlin.contracts.contract' call
4077
+ var tmp$ret$6;
4078
+ // Inline function 'arrow.core.raise.fold' call
4079
+ // Inline function 'kotlin.contracts.contract' call
4080
+ var raise = new DefaultRaise(false);
4081
+ var tmp;
4082
+ try {
4083
+ var tmp$ret$3;
4084
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
4085
+ var tmp$ret$2;
4086
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseRefinedTypeDeclaration.<anonymous>' call
4087
+ _this__u8e3s4.el();
4088
+ log(_this__u8e3s4.cl_1, $this);
4089
+ var tmp0_subject = _this__u8e3s4.cl_1.sk_1;
4090
+ var tmp_0;
4091
+ if (tmp0_subject instanceof CustomType) {
4092
+ tmp_0 = raise.ch(parseCustomRegex(_this__u8e3s4, $this, _this__u8e3s4.cl_1.tk_1));
4093
+ } else {
4094
+ var tmp$ret$1;
4095
+ // Inline function 'arrow.core.nel' call
4096
+ var tmp$ret$0;
4097
+ // Inline function 'kotlin.also' call
4098
+ var tmp0_also = new WrongTokenException(getKClass(CustomType), _this__u8e3s4.cl_1);
4099
+ // Inline function 'kotlin.contracts.contract' call
4100
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseRefinedTypeDeclaration.<anonymous>.<anonymous>' call
4101
+ _this__u8e3s4.el();
4102
+ tmp$ret$0 = tmp0_also;
4103
+ var tmp1_nel = tmp$ret$0;
4104
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
4105
+ raise.bh(tmp$ret$1);
4106
+ }
4107
+ tmp$ret$2 = tmp_0;
4108
+ tmp$ret$3 = tmp$ret$2;
4109
+ var res = tmp$ret$3;
4110
+ raise.zg();
4111
+ var tmp$ret$4;
4112
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
4113
+ tmp$ret$4 = new Right(res);
4114
+ tmp = tmp$ret$4;
4115
+ } catch ($p) {
4116
+ var tmp_1;
4117
+ if ($p instanceof CancellationException) {
4118
+ var e = $p;
4119
+ raise.zg();
4120
+ var tmp$ret$5;
4121
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
4122
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
4123
+ tmp$ret$5 = new Left(tmp1__anonymous__uwfjfc);
4124
+ tmp_1 = tmp$ret$5;
4125
+ } else {
4126
+ if ($p instanceof Error) {
4127
+ var e_0 = $p;
4128
+ raise.zg();
4129
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
4130
+ throw tmp0__anonymous__q1qw7t;
4131
+ } else {
4132
+ throw $p;
4133
+ }
4134
+ }
4135
+ tmp = tmp_1;
4136
+ }
4137
+ tmp$ret$6 = tmp;
4138
+ tmp$ret$7 = tmp$ret$6;
4139
+ tmp$ret$8 = tmp$ret$7;
4140
+ return tmp$ret$8;
4141
+ }
4142
+ function parseCustomRegex(_this__u8e3s4, $this, typeName) {
4143
+ var tmp$ret$9;
4144
+ // Inline function 'arrow.core.raise.either' call
4145
+ var tmp$ret$8;
4146
+ // Inline function 'arrow.core.raise.fold' call
4147
+ // Inline function 'kotlin.contracts.contract' call
4148
+ var tmp$ret$7;
4149
+ // Inline function 'arrow.core.raise.fold' call
4150
+ // Inline function 'kotlin.contracts.contract' call
4151
+ var raise = new DefaultRaise(false);
4152
+ var tmp;
4153
+ try {
4154
+ var tmp$ret$4;
4155
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
4156
+ var tmp$ret$3;
4157
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseCustomRegex.<anonymous>' call
4158
+ _this__u8e3s4.el();
4159
+ log(_this__u8e3s4.cl_1, $this);
4160
+ var tmp$ret$2;
4161
+ // Inline function 'kotlin.also' call
4162
+ var tmp0_subject = _this__u8e3s4.cl_1.sk_1;
4163
+ var tmp_0;
4164
+ if (tmp0_subject instanceof CustomRegex) {
4165
+ tmp_0 = new Refined(typeName, new Validator(_this__u8e3s4.cl_1.tk_1));
4166
+ } else {
4167
+ var tmp$ret$1;
4168
+ // Inline function 'arrow.core.nel' call
4169
+ var tmp$ret$0;
4170
+ // Inline function 'kotlin.also' call
4171
+ var tmp0_also = new WrongTokenException(getKClass(CustomRegex), _this__u8e3s4.cl_1);
4172
+ // Inline function 'kotlin.contracts.contract' call
4173
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseCustomRegex.<anonymous>.<anonymous>' call
4174
+ _this__u8e3s4.el();
4175
+ tmp$ret$0 = tmp0_also;
4176
+ var tmp1_nel = tmp$ret$0;
4177
+ tmp$ret$1 = nonEmptyListOf(tmp1_nel, []);
4178
+ raise.bh(tmp$ret$1);
4179
+ }
4180
+ var tmp2_also = tmp_0;
4181
+ // Inline function 'kotlin.contracts.contract' call
4182
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parseCustomRegex.<anonymous>.<anonymous>' call
4183
+ _this__u8e3s4.el();
4184
+ tmp$ret$2 = tmp2_also;
4185
+ tmp$ret$3 = tmp$ret$2;
4186
+ tmp$ret$4 = tmp$ret$3;
4187
+ var res = tmp$ret$4;
4188
+ raise.zg();
4189
+ var tmp$ret$5;
4190
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
4191
+ tmp$ret$5 = new Right(res);
4192
+ tmp = tmp$ret$5;
4193
+ } catch ($p) {
4194
+ var tmp_1;
4195
+ if ($p instanceof CancellationException) {
4196
+ var e = $p;
4197
+ raise.zg();
4198
+ var tmp$ret$6;
4199
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
4200
+ var tmp1__anonymous__uwfjfc = raisedOrRethrow(e, raise);
4201
+ tmp$ret$6 = new Left(tmp1__anonymous__uwfjfc);
4202
+ tmp_1 = tmp$ret$6;
4203
+ } else {
4204
+ if ($p instanceof Error) {
4205
+ var e_0 = $p;
4206
+ raise.zg();
4207
+ var tmp0__anonymous__q1qw7t = nonFatalOrThrow(e_0);
4208
+ throw tmp0__anonymous__q1qw7t;
4209
+ } else {
4210
+ throw $p;
4211
+ }
4212
+ }
4213
+ tmp = tmp_1;
4214
+ }
4215
+ tmp$ret$7 = tmp;
4216
+ tmp$ret$8 = tmp$ret$7;
4217
+ tmp$ret$9 = tmp$ret$8;
4218
+ return tmp$ret$9;
4219
+ }
4220
+ function log(_this__u8e3s4, $this) {
4221
+ return $this.mh_1.ih('Parsing ' + _this__u8e3s4.sk_1 + ' at line ' + _this__u8e3s4.uk_1.vk_1 + ' position ' + _this__u8e3s4.uk_1.wk_1);
4222
+ }
4223
+ function Parser(logger) {
4224
+ this.mh_1 = logger;
4225
+ }
4226
+ protoOf(Parser).nh = function (tokens) {
4227
+ var tmp$ret$2;
4228
+ // Inline function 'kotlin.collections.filterNot' call
4229
+ var tmp$ret$1;
4230
+ // Inline function 'kotlin.collections.filterNotTo' call
4231
+ var tmp0_filterNotTo = ArrayList_init_$Create$();
4232
+ var tmp0_iterator = tokens.c();
4233
+ while (tmp0_iterator.d()) {
4234
+ var element = tmp0_iterator.e();
4235
+ var tmp$ret$0;
4236
+ // Inline function 'community.flock.wirespec.compiler.core.parse.Parser.parse.<anonymous>' call
4237
+ var tmp = element.sk_1;
4238
+ tmp$ret$0 = isInterface(tmp, WhiteSpace);
4239
+ if (!tmp$ret$0) {
4240
+ tmp0_filterNotTo.a(element);
4241
+ }
4242
+ }
4243
+ tmp$ret$1 = tmp0_filterNotTo;
4244
+ tmp$ret$2 = tmp$ret$1;
4245
+ return parse(toProvider(tmp$ret$2, this.mh_1), this);
4246
+ };
4247
+ function printTokens($this, previousToken) {
4248
+ var tmp$ret$6;
4249
+ // Inline function 'kotlin.run' call
4250
+ // Inline function 'kotlin.contracts.contract' call
4251
+ var tmp0_safe_receiver = previousToken;
4252
+ var tmp;
4253
+ if (tmp0_safe_receiver == null) {
4254
+ tmp = null;
4255
+ } else {
4256
+ var tmp$ret$1;
4257
+ // Inline function 'kotlin.run' call
4258
+ // Inline function 'kotlin.contracts.contract' call
4259
+ var tmp$ret$0;
4260
+ // Inline function 'community.flock.wirespec.compiler.core.parse.TokenProvider.printTokens.<anonymous>.<anonymous>' call
4261
+ tmp$ret$0 = "Eating: '" + tmp0_safe_receiver.tk_1 + "', ";
4262
+ tmp$ret$1 = tmp$ret$0;
4263
+ tmp = tmp$ret$1;
4264
+ }
4265
+ var tmp1_elvis_lhs = tmp;
4266
+ var prev = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
4267
+ var tmp$ret$3;
4268
+ // Inline function 'kotlin.run' call
4269
+ var tmp0_run = $this.cl_1;
4270
+ // Inline function 'kotlin.contracts.contract' call
4271
+ var tmp$ret$2;
4272
+ // Inline function 'community.flock.wirespec.compiler.core.parse.TokenProvider.printTokens.<anonymous>.<anonymous>' call
4273
+ tmp$ret$2 = "Current: '" + tmp0_run.tk_1 + "'";
4274
+ tmp$ret$3 = tmp$ret$2;
4275
+ var curr = tmp$ret$3;
4276
+ var tmp2_safe_receiver = $this.dl_1;
4277
+ var tmp_0;
4278
+ if (tmp2_safe_receiver == null) {
4279
+ tmp_0 = null;
4280
+ } else {
4281
+ var tmp$ret$5;
4282
+ // Inline function 'kotlin.run' call
4283
+ // Inline function 'kotlin.contracts.contract' call
4284
+ var tmp$ret$4;
4285
+ // Inline function 'community.flock.wirespec.compiler.core.parse.TokenProvider.printTokens.<anonymous>.<anonymous>' call
4286
+ tmp$ret$4 = ", Next: '" + tmp2_safe_receiver.tk_1 + "'";
4287
+ tmp$ret$5 = tmp$ret$4;
4288
+ tmp_0 = tmp$ret$5;
4289
+ }
4290
+ var tmp3_elvis_lhs = tmp_0;
4291
+ var next = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
4292
+ $this.al_1.ih(prev + curr + next);
4293
+ tmp$ret$6 = Unit_getInstance();
4294
+ return tmp$ret$6;
4295
+ }
4296
+ function printTokens$default($this, previousToken, $super) {
4297
+ previousToken = previousToken === VOID ? null : previousToken;
4298
+ return printTokens($this, previousToken);
4299
+ }
4300
+ function nextToken($this) {
4301
+ var tmp$ret$4;
4302
+ // Inline function 'kotlin.Result.getOrNull' call
4303
+ var tmp$ret$3;
4304
+ // Inline function 'kotlin.runCatching' call
4305
+ var tmp;
4306
+ try {
4307
+ var tmp$ret$1;
4308
+ // Inline function 'kotlin.Companion.success' call
4309
+ var tmp0_success = Companion_getInstance();
4310
+ var tmp$ret$0;
4311
+ // Inline function 'community.flock.wirespec.compiler.core.parse.TokenProvider.nextToken.<anonymous>' call
4312
+ tmp$ret$0 = $this.bl_1.e();
4313
+ var tmp1_success = tmp$ret$0;
4314
+ tmp$ret$1 = _Result___init__impl__xyqfz8(tmp1_success);
4315
+ tmp = tmp$ret$1;
4316
+ } catch ($p) {
4317
+ var tmp_0;
4318
+ if ($p instanceof Error) {
4319
+ var e = $p;
4320
+ var tmp$ret$2;
4321
+ // Inline function 'kotlin.Companion.failure' call
4322
+ var tmp2_failure = Companion_getInstance();
4323
+ tmp$ret$2 = _Result___init__impl__xyqfz8(createFailure(e));
4324
+ tmp_0 = tmp$ret$2;
4325
+ } else {
4326
+ throw $p;
4327
+ }
4328
+ tmp = tmp_0;
4329
+ }
4330
+ tmp$ret$3 = tmp;
4331
+ var tmp3_getOrNull = tmp$ret$3;
4332
+ var tmp_1;
4333
+ if (_Result___get_isFailure__impl__jpiriv(tmp3_getOrNull)) {
4334
+ tmp_1 = null;
4335
+ } else {
4336
+ var tmp_2 = _Result___get_value__impl__bjfvqg(tmp3_getOrNull);
4337
+ tmp_1 = (tmp_2 == null ? true : isObject(tmp_2)) ? tmp_2 : THROW_CCE();
4338
+ }
4339
+ tmp$ret$4 = tmp_1;
4340
+ return tmp$ret$4;
4341
+ }
4342
+ function TokenProvider(logger, tokenIterator) {
4343
+ this.al_1 = logger;
4344
+ this.bl_1 = tokenIterator;
4345
+ var tmp = this;
4346
+ var tmp0_elvis_lhs = nextToken(this);
4347
+ var tmp_0;
4348
+ if (tmp0_elvis_lhs == null) {
4349
+ throw new StartingException();
4350
+ } else {
4351
+ tmp_0 = tmp0_elvis_lhs;
4352
+ }
4353
+ tmp.cl_1 = tmp_0;
4354
+ this.dl_1 = nextToken(this);
4355
+ printTokens$default(this);
4356
+ }
4357
+ protoOf(TokenProvider).d = function () {
4358
+ return !(this.dl_1 == null);
4359
+ };
4360
+ protoOf(TokenProvider).el = function () {
4361
+ var previousToken = this.cl_1;
4362
+ var tmp = this;
4363
+ var tmp0_elvis_lhs = this.dl_1;
4364
+ var tmp_0;
4365
+ if (tmp0_elvis_lhs == null) {
4366
+ throw new NextException(previousToken.uk_1);
4367
+ } else {
4368
+ tmp_0 = tmp0_elvis_lhs;
4369
+ }
4370
+ tmp.cl_1 = tmp_0;
4371
+ this.dl_1 = nextToken(this);
4372
+ printTokens(this, previousToken);
4373
+ };
4374
+ function toProvider(_this__u8e3s4, logger) {
4375
+ return new TokenProvider(logger, _this__u8e3s4.c());
4376
+ }
4377
+ function IdxAndLength(idx, length) {
4378
+ idx = idx === VOID ? 0 : idx;
4379
+ length = length === VOID ? 0 : length;
4380
+ this.fl_1 = idx;
4381
+ this.gl_1 = length;
4382
+ }
4383
+ protoOf(IdxAndLength).toString = function () {
4384
+ return 'IdxAndLength(idx=' + this.fl_1 + ', length=' + this.gl_1 + ')';
4385
+ };
4386
+ protoOf(IdxAndLength).hashCode = function () {
4387
+ var result = this.fl_1;
4388
+ result = imul(result, 31) + this.gl_1 | 0;
4389
+ return result;
4390
+ };
4391
+ protoOf(IdxAndLength).equals = function (other) {
4392
+ if (this === other)
4393
+ return true;
4394
+ if (!(other instanceof IdxAndLength))
4395
+ return false;
4396
+ var tmp0_other_with_cast = other instanceof IdxAndLength ? other : THROW_CCE();
4397
+ if (!(this.fl_1 === tmp0_other_with_cast.fl_1))
4398
+ return false;
4399
+ if (!(this.gl_1 === tmp0_other_with_cast.gl_1))
4400
+ return false;
4401
+ return true;
4402
+ };
4403
+ function Coordinates(line, position, idxAndLength) {
4404
+ line = line === VOID ? 1 : line;
4405
+ position = position === VOID ? 1 : position;
4406
+ idxAndLength = idxAndLength === VOID ? new IdxAndLength() : idxAndLength;
4407
+ this.vk_1 = line;
4408
+ this.wk_1 = position;
4409
+ this.xk_1 = idxAndLength;
4410
+ }
4411
+ protoOf(Coordinates).hl = function (line, position, idxAndLength) {
4412
+ return new Coordinates(line, position, idxAndLength);
4413
+ };
4414
+ protoOf(Coordinates).il = function (line, position, idxAndLength, $super) {
4415
+ line = line === VOID ? this.vk_1 : line;
4416
+ position = position === VOID ? this.wk_1 : position;
4417
+ idxAndLength = idxAndLength === VOID ? this.xk_1 : idxAndLength;
4418
+ return $super === VOID ? this.hl(line, position, idxAndLength) : $super.hl.call(this, line, position, idxAndLength);
4419
+ };
4420
+ protoOf(Coordinates).toString = function () {
4421
+ return 'Coordinates(line=' + this.vk_1 + ', position=' + this.wk_1 + ', idxAndLength=' + this.xk_1 + ')';
4422
+ };
4423
+ protoOf(Coordinates).hashCode = function () {
4424
+ var result = this.vk_1;
4425
+ result = imul(result, 31) + this.wk_1 | 0;
4426
+ result = imul(result, 31) + this.xk_1.hashCode() | 0;
4427
+ return result;
4428
+ };
4429
+ protoOf(Coordinates).equals = function (other) {
4430
+ if (this === other)
4431
+ return true;
4432
+ if (!(other instanceof Coordinates))
4433
+ return false;
4434
+ var tmp0_other_with_cast = other instanceof Coordinates ? other : THROW_CCE();
4435
+ if (!(this.vk_1 === tmp0_other_with_cast.vk_1))
4436
+ return false;
4437
+ if (!(this.wk_1 === tmp0_other_with_cast.wk_1))
4438
+ return false;
4439
+ if (!this.xk_1.equals(tmp0_other_with_cast.xk_1))
4440
+ return false;
4441
+ return true;
4442
+ };
4443
+ function Token(type, value, coordinates) {
4444
+ this.sk_1 = type;
4445
+ this.tk_1 = value;
4446
+ this.uk_1 = coordinates;
4447
+ }
4448
+ protoOf(Token).jl = function (type, value, coordinates) {
4449
+ return new Token(type, value, coordinates);
4450
+ };
4451
+ protoOf(Token).zk = function (type, value, coordinates, $super) {
4452
+ type = type === VOID ? this.sk_1 : type;
4453
+ value = value === VOID ? this.tk_1 : value;
4454
+ coordinates = coordinates === VOID ? this.uk_1 : coordinates;
4455
+ return $super === VOID ? this.jl(type, value, coordinates) : $super.jl.call(this, type, value, coordinates);
4456
+ };
4457
+ protoOf(Token).toString = function () {
4458
+ return 'Token(type=' + this.sk_1 + ', value=' + this.tk_1 + ', coordinates=' + this.uk_1 + ')';
4459
+ };
4460
+ protoOf(Token).hashCode = function () {
4461
+ var result = hashCode(this.sk_1);
4462
+ result = imul(result, 31) + getStringHashCode(this.tk_1) | 0;
4463
+ result = imul(result, 31) + this.uk_1.hashCode() | 0;
4464
+ return result;
4465
+ };
4466
+ protoOf(Token).equals = function (other) {
4467
+ if (this === other)
4468
+ return true;
4469
+ if (!(other instanceof Token))
4470
+ return false;
4471
+ var tmp0_other_with_cast = other instanceof Token ? other : THROW_CCE();
4472
+ if (!equals(this.sk_1, tmp0_other_with_cast.sk_1))
4473
+ return false;
4474
+ if (!(this.tk_1 === tmp0_other_with_cast.tk_1))
4475
+ return false;
4476
+ if (!this.uk_1.equals(tmp0_other_with_cast.uk_1))
4477
+ return false;
4478
+ return true;
4479
+ };
4480
+ function plus_1(_this__u8e3s4, length) {
4481
+ return new IdxAndLength(_this__u8e3s4.fl_1 + length | 0, length);
4482
+ }
4483
+ function plus_2(_this__u8e3s4, length) {
4484
+ return _this__u8e3s4.il(VOID, _this__u8e3s4.wk_1 + length | 0, plus_1(_this__u8e3s4.xk_1, length));
4485
+ }
4486
+ function tokenize(_this__u8e3s4, source) {
4487
+ var tmp$ret$1;
4488
+ // Inline function 'kotlin.let' call
4489
+ var tmp0_let = tokenize_0(_this__u8e3s4, source, emptyList());
4490
+ // Inline function 'kotlin.contracts.contract' call
4491
+ var tmp$ret$0;
4492
+ // Inline function 'community.flock.wirespec.compiler.core.tokenize.tokenize.<anonymous>' call
4493
+ var tmp = EndOfProgram_getInstance();
4494
+ EndOfProgram_getInstance();
4495
+ var tmp_0 = lastCoordinates(tmp0_let);
4496
+ var tmp_1 = EndOfProgram_getInstance();
4497
+ EndOfProgram_getInstance();
4498
+ tmp$ret$0 = plus_0(tmp0_let, new Token(tmp, 'EOP', nextCoordinates(tmp_0, tmp_1, 'EOP')));
4499
+ tmp$ret$1 = tmp$ret$0;
4500
+ return tmp$ret$1;
4501
+ }
4502
+ function nextCoordinates(_this__u8e3s4, type, value) {
4503
+ var tmp0_subject = type;
4504
+ var tmp;
4505
+ if (tmp0_subject instanceof NewLine) {
4506
+ tmp = new Coordinates(_this__u8e3s4.vk_1 + 1 | 0, VOID, plus_1(_this__u8e3s4.xk_1, value.length));
4507
+ } else {
4508
+ tmp = plus_2(_this__u8e3s4, value.length);
4509
+ }
4510
+ return tmp;
4511
+ }
4512
+ function lastCoordinates(_this__u8e3s4) {
4513
+ var tmp0_safe_receiver = lastOrNull(_this__u8e3s4);
4514
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.uk_1;
4515
+ return tmp1_elvis_lhs == null ? new Coordinates() : tmp1_elvis_lhs;
4516
+ }
4517
+ function tokenize_0(_this__u8e3s4, source, tokens) {
4518
+ var $this = _this__u8e3s4;
4519
+ var source_0 = source;
4520
+ var tokens_0 = tokens;
4521
+ $l$1: do {
4522
+ $l$0: do {
4523
+ var token = findToken($this, lastCoordinates(tokens_0), source_0);
4524
+ var newSource = removePrefix(source_0, token.tk_1);
4525
+ var newTokens = plus_0(tokens_0, token);
4526
+ var tmp;
4527
+ var tmp$ret$0;
4528
+ // Inline function 'kotlin.text.isEmpty' call
4529
+ tmp$ret$0 = charSequenceLength(newSource) === 0;
4530
+ if (tmp$ret$0) {
4531
+ tmp = newTokens;
4532
+ } else {
4533
+ var tmp0 = $this;
4534
+ var tmp1 = newSource;
4535
+ var tmp2 = newTokens;
4536
+ $this = tmp0;
4537
+ source_0 = tmp1;
4538
+ tokens_0 = tmp2;
4539
+ continue $l$0;
4540
+ }
4541
+ return tmp;
4542
+ }
4543
+ while (false);
4544
+ }
4545
+ while (true);
4546
+ }
4547
+ function findToken(_this__u8e3s4, previousTokenCoordinates, source) {
4548
+ var tmp$ret$2;
4549
+ // Inline function 'kotlin.collections.firstNotNullOf' call
4550
+ var tmp0_firstNotNullOf = _this__u8e3s4.sh();
4551
+ var tmp$ret$1;
4552
+ $l$block: {
4553
+ // Inline function 'kotlin.collections.firstNotNullOfOrNull' call
4554
+ var tmp0_iterator = tmp0_firstNotNullOf.c();
4555
+ while (tmp0_iterator.d()) {
4556
+ var element = tmp0_iterator.e();
4557
+ var tmp$ret$0;
4558
+ // Inline function 'community.flock.wirespec.compiler.core.tokenize.findToken.<anonymous>' call
4559
+ var regex = element.i3();
4560
+ var tokenType = element.j3();
4561
+ var tmp0_safe_receiver = regex.ae(source);
4562
+ tmp$ret$0 = tmp0_safe_receiver == null ? null : toToken(tmp0_safe_receiver, tokenType, previousTokenCoordinates);
4563
+ var result = tmp$ret$0;
4564
+ if (!(result == null)) {
4565
+ tmp$ret$1 = result;
4566
+ break $l$block;
4567
+ }
4568
+ }
4569
+ tmp$ret$1 = null;
4570
+ }
4571
+ var tmp0_elvis_lhs = tmp$ret$1;
4572
+ var tmp;
4573
+ if (tmp0_elvis_lhs == null) {
4574
+ throw NoSuchElementException_init_$Create$('No element of the collection was transformed to a non-null value.');
4575
+ } else {
4576
+ tmp = tmp0_elvis_lhs;
4577
+ }
4578
+ tmp$ret$2 = tmp;
4579
+ return tmp$ret$2;
4580
+ }
4581
+ function toToken(_this__u8e3s4, type, previousTokenCoordinates) {
4582
+ return new Token(type, _this__u8e3s4.w(), nextCoordinates(previousTokenCoordinates, type, _this__u8e3s4.w()));
4583
+ }
4584
+ function TokenType() {
4585
+ }
4586
+ function WsTypeDef() {
4587
+ WsTypeDef_instance = this;
4588
+ }
4589
+ var WsTypeDef_instance;
4590
+ function WsTypeDef_getInstance() {
4591
+ if (WsTypeDef_instance == null)
4592
+ new WsTypeDef();
4593
+ return WsTypeDef_instance;
4594
+ }
4595
+ function WsEnumTypeDef() {
4596
+ WsEnumTypeDef_instance = this;
4597
+ }
4598
+ var WsEnumTypeDef_instance;
4599
+ function WsEnumTypeDef_getInstance() {
4600
+ if (WsEnumTypeDef_instance == null)
4601
+ new WsEnumTypeDef();
4602
+ return WsEnumTypeDef_instance;
4603
+ }
4604
+ function WsRefinedTypeDef() {
4605
+ WsRefinedTypeDef_instance = this;
4606
+ }
4607
+ var WsRefinedTypeDef_instance;
4608
+ function WsRefinedTypeDef_getInstance() {
4609
+ if (WsRefinedTypeDef_instance == null)
4610
+ new WsRefinedTypeDef();
4611
+ return WsRefinedTypeDef_instance;
4612
+ }
4613
+ function WhiteSpaceExceptNewLine() {
4614
+ WhiteSpaceExceptNewLine_instance = this;
4615
+ }
4616
+ var WhiteSpaceExceptNewLine_instance;
4617
+ function WhiteSpaceExceptNewLine_getInstance() {
4618
+ if (WhiteSpaceExceptNewLine_instance == null)
4619
+ new WhiteSpaceExceptNewLine();
4620
+ return WhiteSpaceExceptNewLine_instance;
4621
+ }
4622
+ function NewLine() {
4623
+ NewLine_instance = this;
4624
+ }
4625
+ var NewLine_instance;
4626
+ function NewLine_getInstance() {
4627
+ if (NewLine_instance == null)
4628
+ new NewLine();
4629
+ return NewLine_instance;
4630
+ }
4631
+ function LeftCurly() {
4632
+ LeftCurly_instance = this;
4633
+ }
4634
+ var LeftCurly_instance;
4635
+ function LeftCurly_getInstance() {
4636
+ if (LeftCurly_instance == null)
4637
+ new LeftCurly();
4638
+ return LeftCurly_instance;
4639
+ }
4640
+ function Colon() {
4641
+ Colon_instance = this;
4642
+ }
4643
+ var Colon_instance;
4644
+ function Colon_getInstance() {
4645
+ if (Colon_instance == null)
4646
+ new Colon();
4647
+ return Colon_instance;
4648
+ }
4649
+ function Comma() {
4650
+ Comma_instance = this;
4651
+ }
4652
+ var Comma_instance;
4653
+ function Comma_getInstance() {
4654
+ if (Comma_instance == null)
4655
+ new Comma();
4656
+ return Comma_instance;
4657
+ }
4658
+ function QuestionMark() {
4659
+ QuestionMark_instance = this;
4660
+ }
4661
+ var QuestionMark_instance;
4662
+ function QuestionMark_getInstance() {
4663
+ if (QuestionMark_instance == null)
4664
+ new QuestionMark();
4665
+ return QuestionMark_instance;
4666
+ }
4667
+ function Brackets() {
4668
+ Brackets_instance = this;
4669
+ }
4670
+ var Brackets_instance;
4671
+ function Brackets_getInstance() {
4672
+ if (Brackets_instance == null)
4673
+ new Brackets();
4674
+ return Brackets_instance;
4675
+ }
4676
+ function WsString() {
4677
+ WsString_instance = this;
4678
+ }
4679
+ var WsString_instance;
4680
+ function WsString_getInstance() {
4681
+ if (WsString_instance == null)
4682
+ new WsString();
4683
+ return WsString_instance;
4684
+ }
4685
+ function WsInteger() {
4686
+ WsInteger_instance = this;
4687
+ }
4688
+ var WsInteger_instance;
4689
+ function WsInteger_getInstance() {
4690
+ if (WsInteger_instance == null)
4691
+ new WsInteger();
4692
+ return WsInteger_instance;
4693
+ }
4694
+ function WsBoolean() {
4695
+ WsBoolean_instance = this;
4696
+ }
4697
+ var WsBoolean_instance;
4698
+ function WsBoolean_getInstance() {
4699
+ if (WsBoolean_instance == null)
4700
+ new WsBoolean();
4701
+ return WsBoolean_instance;
4702
+ }
4703
+ function RightCurly() {
4704
+ RightCurly_instance = this;
4705
+ }
4706
+ var RightCurly_instance;
4707
+ function RightCurly_getInstance() {
4708
+ if (RightCurly_instance == null)
4709
+ new RightCurly();
4710
+ return RightCurly_instance;
4711
+ }
4712
+ function CustomValue() {
4713
+ CustomValue_instance = this;
4714
+ }
4715
+ var CustomValue_instance;
4716
+ function CustomValue_getInstance() {
4717
+ if (CustomValue_instance == null)
4718
+ new CustomValue();
4719
+ return CustomValue_instance;
4720
+ }
4721
+ function CustomType() {
4722
+ CustomType_instance = this;
4723
+ }
4724
+ var CustomType_instance;
4725
+ function CustomType_getInstance() {
4726
+ if (CustomType_instance == null)
4727
+ new CustomType();
4728
+ return CustomType_instance;
4729
+ }
4730
+ function CustomRegex() {
4731
+ CustomRegex_instance = this;
4732
+ }
4733
+ var CustomRegex_instance;
4734
+ function CustomRegex_getInstance() {
4735
+ if (CustomRegex_instance == null)
4736
+ new CustomRegex();
4737
+ return CustomRegex_instance;
4738
+ }
4739
+ function Invalid() {
4740
+ Invalid_instance = this;
4741
+ }
4742
+ var Invalid_instance;
4743
+ function Invalid_getInstance() {
4744
+ if (Invalid_instance == null)
4745
+ new Invalid();
4746
+ return Invalid_instance;
4747
+ }
4748
+ function EndOfProgram() {
4749
+ EndOfProgram_instance = this;
4750
+ this.ll_1 = 'EOP';
4751
+ }
4752
+ var EndOfProgram_instance;
4753
+ function EndOfProgram_getInstance() {
4754
+ if (EndOfProgram_instance == null)
4755
+ new EndOfProgram();
4756
+ return EndOfProgram_instance;
4757
+ }
4758
+ function WhiteSpace() {
4759
+ }
4760
+ function WsType() {
4761
+ }
4762
+ function validate(_this__u8e3s4) {
4763
+ return _this__u8e3s4;
4764
+ }
4765
+ function get_noLogger() {
4766
+ _init_properties_Logger_kt__mpqsw();
4767
+ return noLogger;
4768
+ }
4769
+ var noLogger;
4770
+ function Logger(enableLogging) {
4771
+ this.hh_1 = enableLogging;
4772
+ }
4773
+ protoOf(Logger).ih = function (s) {
4774
+ var tmp;
4775
+ if (this.hh_1) {
4776
+ println(s);
4777
+ tmp = Unit_getInstance();
4778
+ } else {
4779
+ tmp = Unit_getInstance();
4780
+ }
4781
+ return tmp;
4782
+ };
4783
+ protoOf(Logger).rk = function (s, block) {
4784
+ var tmp$ret$1;
4785
+ // Inline function 'kotlin.run' call
4786
+ // Inline function 'kotlin.contracts.contract' call
4787
+ var tmp$ret$0;
4788
+ // Inline function 'community.flock.wirespec.compiler.utils.Logger.log.<anonymous>' call
4789
+ this.ih(s);
4790
+ tmp$ret$0 = block();
4791
+ tmp$ret$1 = tmp$ret$0;
4792
+ return tmp$ret$1;
4793
+ };
4794
+ function noLogger$1() {
4795
+ Logger.call(this, false);
4796
+ }
4797
+ var properties_initialized_Logger_kt_6n8a9a;
4798
+ function _init_properties_Logger_kt__mpqsw() {
4799
+ if (properties_initialized_Logger_kt_6n8a9a) {
4800
+ } else {
4801
+ properties_initialized_Logger_kt_6n8a9a = true;
4802
+ noLogger = new noLogger$1();
4803
+ }
4804
+ }
4805
+ //region block: post-declaration
4806
+ protoOf(JavaEmitter).rj = withLogging;
4807
+ protoOf(JavaEmitter).sj = withLogging_0;
4808
+ protoOf(JavaEmitter).tj = withLogging_1;
4809
+ protoOf(JavaEmitter).uj = withLogging_2;
4810
+ protoOf(JavaEmitter).th = withLogging_3;
4811
+ protoOf(JavaEmitter).wj = withLogging_4;
4812
+ protoOf(JavaEmitter).yj = withLogging_5;
4813
+ protoOf(JavaEmitter).zj = withLogging_6;
4814
+ protoOf(JavaEmitter).bk = withLogging_7;
4815
+ protoOf(JavaEmitter).ri = withLogging_8;
4816
+ protoOf(KotlinEmitter).rj = withLogging;
4817
+ protoOf(KotlinEmitter).sj = withLogging_0;
4818
+ protoOf(KotlinEmitter).tj = withLogging_1;
4819
+ protoOf(KotlinEmitter).uj = withLogging_2;
4820
+ protoOf(KotlinEmitter).th = withLogging_3;
4821
+ protoOf(KotlinEmitter).wj = withLogging_4;
4822
+ protoOf(KotlinEmitter).yj = withLogging_5;
4823
+ protoOf(KotlinEmitter).zj = withLogging_6;
4824
+ protoOf(KotlinEmitter).bk = withLogging_7;
4825
+ protoOf(KotlinEmitter).ri = withLogging_8;
4826
+ protoOf(ScalaEmitter).rj = withLogging;
4827
+ protoOf(ScalaEmitter).sj = withLogging_0;
4828
+ protoOf(ScalaEmitter).tj = withLogging_1;
4829
+ protoOf(ScalaEmitter).uj = withLogging_2;
4830
+ protoOf(ScalaEmitter).th = withLogging_3;
4831
+ protoOf(ScalaEmitter).wj = withLogging_4;
4832
+ protoOf(ScalaEmitter).yj = withLogging_5;
4833
+ protoOf(ScalaEmitter).zj = withLogging_6;
4834
+ protoOf(ScalaEmitter).bk = withLogging_7;
4835
+ protoOf(TypeScriptEmitter).rj = withLogging;
4836
+ protoOf(TypeScriptEmitter).sj = withLogging_0;
4837
+ protoOf(TypeScriptEmitter).tj = withLogging_1;
4838
+ protoOf(TypeScriptEmitter).uj = withLogging_2;
4839
+ protoOf(TypeScriptEmitter).th = withLogging_3;
4840
+ protoOf(TypeScriptEmitter).wj = withLogging_4;
4841
+ protoOf(TypeScriptEmitter).yj = withLogging_5;
4842
+ protoOf(TypeScriptEmitter).zj = withLogging_6;
4843
+ protoOf(TypeScriptEmitter).bk = withLogging_7;
4844
+ protoOf(TypeScriptEmitter).ri = withLogging_8;
4845
+ protoOf(WirespecEmitter).rj = withLogging;
4846
+ protoOf(WirespecEmitter).sj = withLogging_0;
4847
+ protoOf(WirespecEmitter).tj = withLogging_1;
4848
+ protoOf(WirespecEmitter).uj = withLogging_2;
4849
+ protoOf(WirespecEmitter).th = withLogging_3;
4850
+ protoOf(WirespecEmitter).wj = withLogging_4;
4851
+ protoOf(WirespecEmitter).yj = withLogging_5;
4852
+ protoOf(WirespecEmitter).zj = withLogging_6;
4853
+ protoOf(WirespecEmitter).bk = withLogging_7;
4854
+ protoOf(WsTypeDef).kl = name;
4855
+ protoOf(WsEnumTypeDef).kl = name;
4856
+ protoOf(WsRefinedTypeDef).kl = name;
4857
+ protoOf(WhiteSpaceExceptNewLine).kl = name;
4858
+ protoOf(NewLine).kl = name;
4859
+ protoOf(LeftCurly).kl = name;
4860
+ protoOf(Colon).kl = name;
4861
+ protoOf(Comma).kl = name;
4862
+ protoOf(QuestionMark).kl = name;
4863
+ protoOf(Brackets).kl = name;
4864
+ protoOf(WsString).kl = name;
4865
+ protoOf(WsInteger).kl = name;
4866
+ protoOf(WsBoolean).kl = name;
4867
+ protoOf(RightCurly).kl = name;
4868
+ protoOf(CustomValue).kl = name;
4869
+ protoOf(CustomType).kl = name;
4870
+ protoOf(CustomRegex).kl = name;
4871
+ protoOf(Invalid).kl = name;
4872
+ protoOf(EndOfProgram).kl = name;
4873
+ //endregion
4874
+ //region block: init
4875
+ DEFAULT_PACKAGE_NAME = 'community.flock.wirespec.generated';
4876
+ //endregion
4877
+ //region block: exports
4878
+ _.$_$ = _.$_$ || {};
4879
+ _.$_$.a = get_DEFAULT_PACKAGE_NAME;
4880
+ _.$_$.b = JavaEmitter;
4881
+ _.$_$.c = KotlinEmitter;
4882
+ _.$_$.d = ScalaEmitter;
4883
+ _.$_$.e = TypeScriptEmitter;
4884
+ _.$_$.f = WirespecEmitter;
4885
+ _.$_$.g = Content;
4886
+ _.$_$.h = values;
4887
+ _.$_$.i = Request;
4888
+ _.$_$.j = Response;
4889
+ _.$_$.k = Literal;
4890
+ _.$_$.l = Param;
4891
+ _.$_$.m = Endpoint;
4892
+ _.$_$.n = Parser;
4893
+ _.$_$.o = Identifier;
4894
+ _.$_$.p = Custom;
4895
+ _.$_$.q = Primitive;
4896
+ _.$_$.r = Field;
4897
+ _.$_$.s = Shape;
4898
+ _.$_$.t = Type_0;
4899
+ _.$_$.u = tokenize;
4900
+ _.$_$.v = compile;
4901
+ _.$_$.w = Logger;
4902
+ _.$_$.x = Type_Boolean_getInstance;
4903
+ _.$_$.y = Type_Integer_getInstance;
4904
+ _.$_$.z = Type_String_getInstance;
4905
+ _.$_$.a1 = Wirespec_getInstance;
4906
+ //endregion
4907
+ return _;
4908
+ }));
4909
+
4910
+ //# sourceMappingURL=wirespec-core.js.map