@flock/wirespec 0.22.4 → 0.22.5

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 (43) hide show
  1. package/arrow-arrow-core.mjs +5 -0
  2. package/arrow-arrow-core.mjs.map +1 -1
  3. package/clikt-clikt-mordant.mjs +79 -79
  4. package/clikt-clikt.mjs +1335 -1335
  5. package/colormath-root-colormath.mjs +433 -433
  6. package/kotlin-kotlin-stdlib.mjs +114 -50
  7. package/kotlin-kotlin-stdlib.mjs.map +1 -1
  8. package/kotlin-openapi-bindings.mjs +10209 -10209
  9. package/kotlin-rgxgen.mjs +1760 -1760
  10. package/kotlinx-io-kotlinx-io-core.mjs +404 -404
  11. package/kotlinx-serialization-kotlinx-serialization-core.mjs +1802 -1802
  12. package/kotlinx-serialization-kotlinx-serialization-json.mjs +1503 -1503
  13. package/mordant-mordant.mjs +1202 -1202
  14. package/package.json +1 -1
  15. package/wirespec-src-compiler-core.mjs +2897 -2620
  16. package/wirespec-src-compiler-core.mjs.map +1 -1
  17. package/wirespec-src-compiler-emitters-java.mjs +106 -106
  18. package/wirespec-src-compiler-emitters-kotlin.mjs +136 -116
  19. package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
  20. package/wirespec-src-compiler-emitters-python.mjs +84 -84
  21. package/wirespec-src-compiler-emitters-rust.mjs +209 -209
  22. package/wirespec-src-compiler-emitters-scala.mjs +85 -85
  23. package/wirespec-src-compiler-emitters-typescript.mjs +108 -108
  24. package/wirespec-src-compiler-emitters-wirespec.mjs +78 -78
  25. package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
  26. package/wirespec-src-compiler-lib.mjs +194 -194
  27. package/wirespec-src-converter-asyncapi.mjs +532 -532
  28. package/wirespec-src-converter-avro.mjs +566 -510
  29. package/wirespec-src-converter-avro.mjs.map +1 -1
  30. package/wirespec-src-converter-common.mjs +11 -11
  31. package/wirespec-src-converter-graphql.mjs +936 -936
  32. package/wirespec-src-converter-openapi.mjs +435 -435
  33. package/wirespec-src-ide-lsp.mjs +1358 -1358
  34. package/wirespec-src-plugin-arguments.mjs +413 -214
  35. package/wirespec-src-plugin-arguments.mjs.map +1 -1
  36. package/wirespec-src-plugin-cli.mjs +135 -99
  37. package/wirespec-src-plugin-cli.mjs.map +1 -1
  38. package/wirespec-src-plugin-extensions.mjs +4357 -0
  39. package/wirespec-src-plugin-extensions.mjs.map +1 -0
  40. package/wirespec-src-plugin-npm.d.mts +43 -1
  41. package/wirespec-src-plugin-npm.mjs +230 -54
  42. package/wirespec-src-plugin-npm.mjs.map +1 -1
  43. package/wirespec-src-tools-generator.mjs +13 -13
@@ -0,0 +1,4357 @@
1
+ import {
2
+ toString1pkumu07cwy4m as toString,
3
+ IllegalStateException_init_$Create$1h4bcfod21ri0 as IllegalStateException_init_$Create$,
4
+ ArrayList_init_$Create$37gc04va6yfo2 as ArrayList_init_$Create$,
5
+ Unit_instancev9v8hjid95df as Unit_instance,
6
+ plus310ted5e4i90h as plus,
7
+ protoOf180f3jzyo7rfj as protoOf,
8
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
9
+ noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
10
+ split2bvyvnrlcifjv as split,
11
+ collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
12
+ ArrayList_init_$Create$2byt5m5yn22yy as ArrayList_init_$Create$_0,
13
+ checkIndexOverflow3frtmheghr0th as checkIndexOverflow,
14
+ joinToString1cxrrlmo0chqs as joinToString,
15
+ asSequence3lsvgkvyzox0q as asSequence,
16
+ filter184huxd00uyfg as filter,
17
+ joinToStringooja5rkatz3u as joinToString_0,
18
+ firstOrNulltrxqttxfxqju as firstOrNull,
19
+ isDigit3mimrri4wkzop as isDigit,
20
+ Char19o2r8palgjof as Char,
21
+ trimMarginhyd3fsmh8iev as trimMargin,
22
+ NotImplementedErrorfzlkpv14xxr8 as NotImplementedError,
23
+ isLetterOrDigit2kuxd9e198haf as isLetterOrDigit,
24
+ _Char___init__impl__6a9atx2gndcvjvc5pke as _Char___init__impl__6a9atx,
25
+ listOfvhqybd2zx248 as listOf,
26
+ equals2au1ep9vhcato as equals,
27
+ emptyList1g2z5xcrvp2zy as emptyList,
28
+ to2cs3ny02qtbcb as to,
29
+ replace3le3ie7l9k8aq as replace,
30
+ Collection1k04j3hzsbod0 as Collection,
31
+ isInterface3d6p8outrmvmk as isInterface,
32
+ mutableListOf6oorvk2mtdmp as mutableListOf,
33
+ VOID3gxj6tk5isa35 as VOID,
34
+ LinkedHashSet_init_$Create$t7gzf3ihb6pk as LinkedHashSet_init_$Create$,
35
+ getKClass3t8tygqu4lcxf as getKClass,
36
+ arrayOf1akklvh2at202 as arrayOf,
37
+ createKType31ecntyyaay3k as createKType,
38
+ THROW_CCE2g6jy02ryeudk as THROW_CCE,
39
+ mapCapacity1h45rc3eh9p2l as mapCapacity,
40
+ coerceAtLeast2bkz8m9ik7hep as coerceAtLeast,
41
+ LinkedHashMap_init_$Create$1gzy1x4a46gd4 as LinkedHashMap_init_$Create$,
42
+ setOf45ia9pnfhe90 as setOf,
43
+ listOf1jh22dvmctj1r as listOf_0,
44
+ addAll1k27qatfgp3k5 as addAll,
45
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
46
+ asSequence2phdjljfh9jhx as asSequence_0,
47
+ flatMap1gb3cjy1dqv3d as flatMap,
48
+ Sequence1quqbxersk0bb as Sequence,
49
+ mapsbvh18eqox7a as map,
50
+ toSet2morh2kqexfa2 as toSet,
51
+ Enum3alwj03lh1n41 as Enum,
52
+ plus20p0vtfmu0596 as plus_0,
53
+ isCharSequence1ju9jr1w86plq as isCharSequence,
54
+ trim11nh7r46at6sx as trim,
55
+ charArrayOf27f4r3dozbrk1 as charArrayOf,
56
+ trim6jpmwojjgb3l as trim_0,
57
+ mapOf2zpbbmyqk8xpf as mapOf,
58
+ mapOf1xd03cq9cnmy8 as mapOf_0,
59
+ emptySetcxexqki71qfa as emptySet,
60
+ getStringHashCode26igk1bx568vk as getStringHashCode,
61
+ hashCodeq5arwsb9dgti as hashCode,
62
+ trimEnd17pt8cbotbalj as trimEnd,
63
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject,
64
+ charSequenceLength3278n89t01tmv as charSequenceLength,
65
+ charCodeAt1yspne1d8erbm as charCodeAt,
66
+ uppercaseChar6lahngw3wvwg as uppercaseChar,
67
+ substring3saq8ornu0luv as substring,
68
+ toString22rbkbhdb5cl2 as toString_0,
69
+ StringBuilder_init_$Create$3ds9zx2kx9u4d as StringBuilder_init_$Create$,
70
+ toSet2orjxp16sotqu as toSet_0,
71
+ getBooleanHashCode1bbj3u6b3v0a7 as getBooleanHashCode,
72
+ listOfNotNull1v4ggfackvuny as listOfNotNull,
73
+ KtMap140uvy3s5zad8 as KtMap,
74
+ toString30pk9tzaqopn as toString_1,
75
+ firstOrNull1982767dljvdy as firstOrNull_0,
76
+ charSequenceGet1vxk1y5n17t1z as charSequenceGet,
77
+ HashSet_init_$Create$2w31ptb4ree5i as HashSet_init_$Create$,
78
+ distinct10qe1scfdvu5k as distinct,
79
+ plus18eogev54fmsa as plus_1,
80
+ trimStart5ewg8zf6cs5u as trimStart,
81
+ startsWith26w8qjqapeeq6 as startsWith,
82
+ getValue48kllevslyh6 as getValue,
83
+ } from './kotlin-kotlin-stdlib.mjs';
84
+ import {
85
+ NonEmptyList3ak25ihy2gcvs as NonEmptyList,
86
+ toNonEmptyListOrNull2ovnnazjb3msz as toNonEmptyListOrNull,
87
+ escaped3qm4ls9c1n1xp as escaped,
88
+ _NonEmptyList___get_all__impl__pmf5092xnz0i2teaa6d as _NonEmptyList___get_all__impl__pmf509,
89
+ _NonEmptyList___init__impl__fxd0xprpnd63likgzm as _NonEmptyList___init__impl__fxd0xp,
90
+ NonEmptyList__toList_impl_t5xcy266xhxpenbpfx as NonEmptyList__toList_impl_t5xcy2,
91
+ NonEmptyList__plus_impl_xqmb918nwrkd75m2j6 as NonEmptyList__plus_impl_xqmb9,
92
+ } from './arrow-arrow-core.mjs';
93
+ import {
94
+ JavaGenerator_getInstance1vn8n4kivtqjx as JavaGenerator_getInstance,
95
+ FieldIdentifier34k7iphndcnl0 as FieldIdentifier,
96
+ DefinitionIdentifiervfasqdb33qef as DefinitionIdentifier,
97
+ Companion_instance27ueeez2qu1l as Companion_instance,
98
+ Bytes3eoc50vgt1uem as Bytes,
99
+ Boolean1fpfi8m5jt3fg as Boolean_0,
100
+ Number1mui0heypwdhp as Number_0,
101
+ Integer39lqx4uc63u28 as Integer,
102
+ String1czvr8pxnm6on as String_0,
103
+ Primitive1i8my14jkp3nk as Primitive,
104
+ Custom1lu6o8txpimqz as Custom,
105
+ Anyv7qdq63z63rc as Any,
106
+ Unit2z95clvxm08vr as Unit,
107
+ Iterable29qbzfup67wqp as Iterable,
108
+ Dict3g7w5wia7rncj as Dict,
109
+ Bytes_instance1cqd1xiwjq94x as Bytes_instance,
110
+ Enum3l2iuc342kle6 as Enum_0,
111
+ get_fields1vhfmr41isbcc as get_fields,
112
+ Type12n1gx16iqtcu as Type,
113
+ addBackticks1di5q03fw4yhx as addBackticks,
114
+ KotlinGenerator_getInstance2e31cf8vh2zcv as KotlinGenerator_getInstance,
115
+ Name_init_$Create$19g584jeznbgc as Name_init_$Create$,
116
+ file2ll80wvxq4yo9 as file,
117
+ Companion_getInstance34fvro4h6bumb as Companion_getInstance,
118
+ RawExpressionfqemfbo6j6cq as RawExpression,
119
+ Expressiontyri3lwschqs as Expression,
120
+ ConstructorStatement1edouznvc71xv as ConstructorStatement,
121
+ VariableReferencesji1q1tq3ygo as VariableReference,
122
+ Structakfq94wrq695 as Struct,
123
+ Uniontffpdks00nyc as Union,
124
+ Field26remk4nlwax4 as Field,
125
+ RawElement3huqlgf21e29z as RawElement,
126
+ File12q75sqvz964e as File,
127
+ fieldList2mdp34yzu6ln6 as fieldList,
128
+ Custom_init_$Create$kfegfgqdjj1p as Custom_init_$Create$,
129
+ Namespacex2gpe17ntoag as Namespace,
130
+ NullableEmpty_instance3dvt16jxiwxjj as NullableEmpty_instance,
131
+ ReturnStatement2onvxq5s96j3a as ReturnStatement,
132
+ Function1wme41sk2huri as Function,
133
+ NullableOfflpxqp5wf7qq as NullableOf,
134
+ Nullable3he31tqc4yy1q as Nullable,
135
+ Visibility_PUBLIC_getInstance32vt79oefqy1j as Visibility_PUBLIC_getInstance,
136
+ Name1ijtblv1phm3y as Name,
137
+ Parameter37d5p43ul6u79 as Parameter,
138
+ FunctionCall1a3g4e6bcljl6 as FunctionCall,
139
+ FieldCall2nusnrnm7uuow as FieldCall,
140
+ convert32i7359nc4b5g as convert,
141
+ Unit_instance25jwel3twibm6 as Unit_instance_0,
142
+ Visibility_INTERNAL_getInstance22ckk1xt7us4h as Visibility_INTERNAL_getInstance,
143
+ String_instance2j5u8j0qc6lge as String_instance,
144
+ Companion_instance21vwhhqsaytqt as Companion_instance_0,
145
+ Function6mdi096lkwmv as Function_0,
146
+ escapeKotlinIdentifier3izquqyuy1mot as escapeKotlinIdentifier,
147
+ VariableReference_init_$Create$dglcn81435zt as VariableReference_init_$Create$,
148
+ Boolean_instance2uah59h3vb1ch as Boolean_instance,
149
+ Visibility_PRIVATE_getInstance26717aoqlr0nv as Visibility_PRIVATE_getInstance,
150
+ Dict27tp4weviyg4b as Dict_0,
151
+ Array2vay9bq78aua1 as Array_0,
152
+ Paramvfwnys2w6aj1 as Param,
153
+ struct1gzvysjt73bn4 as struct,
154
+ Package1a6hdgk3p4frd as Package,
155
+ raw1mm1rmqheq474 as raw,
156
+ Refined1lkzc0dg6wey7 as Refined,
157
+ Endpoint1jsq06yr3xdhp as Endpoint,
158
+ Channel2fhxi4a4pwb64 as Channel,
159
+ Enumoqsp4e7al89r as Enum_1,
160
+ HasName33ghsv8lnn7sd as HasName,
161
+ Unionccsavx6nrdr2 as Union_0,
162
+ forEachElement2kk527cjhfon1 as forEachElement,
163
+ TransformScope3fhztkr2eyk36 as TransformScope,
164
+ TransformerBuilder26pbjl5nmg6wa as TransformerBuilder,
165
+ transformhd96z3w1u5uc as transform,
166
+ Element3p1xrn21d2w4b as Element,
167
+ Main3fexakddcxfff as Main,
168
+ Interface2g99rmjjt5ne as Interface,
169
+ transformChildren14suh59vxsgt as transformChildren,
170
+ Literal331hu9r04vptz as Literal,
171
+ Model1nx3had6rojzt as Model,
172
+ } from './wirespec-src-compiler-core.mjs';
173
+ import {
174
+ AvroJsonEmitter_getInstanceqxb8ioshyd02 as AvroJsonEmitter_getInstance,
175
+ Typel89stdvlxo83 as Type_0,
176
+ TypeList_init_$Create$1bhvhw1us1a8l as TypeList_init_$Create$,
177
+ UnionType3n98xd02zrhnq as UnionType,
178
+ MapTypevzpmekpvqxab as MapType,
179
+ SimpleTypenolspnvnvo3r as SimpleType,
180
+ LogicalType1elm7nlw6tr66 as LogicalType,
181
+ EnumType3tyyyxtu65wva as EnumType,
182
+ ArrayTypexditgxyp5c9c as ArrayType,
183
+ RecordType2zxu8wkaapzdc as RecordType,
184
+ } from './wirespec-src-converter-avro.mjs';
185
+ import { Default_getInstancejyc493d440j2 as Default_getInstance } from './kotlinx-serialization-kotlinx-serialization-json.mjs';
186
+ import {
187
+ serializer1i4e9ym37oxmo as serializer,
188
+ KSerializerzf77vz1967fq as KSerializer,
189
+ } from './kotlinx-serialization-kotlinx-serialization-core.mjs';
190
+ //region block: imports
191
+ var imul = Math.imul;
192
+ //endregion
193
+ //region block: pre-declaration
194
+ initMetadataForClass(AvroExtension, 'AvroExtension');
195
+ initMetadataForClass(JavaAvroSource, 'JavaAvroSource');
196
+ initMetadataForClass(KotlinAvroSource, 'KotlinAvroSource');
197
+ initMetadataForCompanion(Companion);
198
+ initMetadataForClass(JacksonExtension, 'JacksonExtension', JacksonExtension);
199
+ initMetadataForClass(Target, 'Target', VOID, Enum);
200
+ initMetadataForClass(Model_0, 'Model');
201
+ initMetadataForCompanion(Companion_0);
202
+ initMetadataForClass(JvmBuilderExtension, 'JvmBuilderExtension');
203
+ initMetadataForCompanion(Companion_1);
204
+ initMetadataForClass(ChannelShape, 'ChannelShape');
205
+ initMetadataForObject(ChannelDslFile, 'ChannelDslFile');
206
+ initMetadataForClass(Slot, 'Slot');
207
+ initMetadataForObject(EndpointDslFile, 'EndpointDslFile');
208
+ initMetadataForClass(Primitive_0, 'Primitive');
209
+ initMetadataForClass(NestedObject, 'NestedObject');
210
+ initMetadataForClass(NestedList, 'NestedList');
211
+ initMetadataForClass(NamedTypedField, 'NamedTypedField');
212
+ initMetadataForClass(ResponseVariantShape, 'ResponseVariantShape');
213
+ initMetadataForClass(BodyKind, 'BodyKind', VOID, Enum);
214
+ initMetadataForCompanion(Companion_2);
215
+ initMetadataForClass(EndpointShape, 'EndpointShape');
216
+ initMetadataForObject(RecordBuilder, 'RecordBuilder');
217
+ initMetadataForObject(TypeDslFile, 'TypeDslFile');
218
+ initMetadataForCompanion(Companion_3);
219
+ initMetadataForClass(TypeShape, 'TypeShape');
220
+ initMetadataForClass(KotestDslExtension, 'KotestDslExtension');
221
+ initMetadataForCompanion(Companion_4);
222
+ initMetadataForClass(KotlinxSerializationExtension, 'KotlinxSerializationExtension', KotlinxSerializationExtension);
223
+ initMetadataForClass(SpringMappingAnnotationsExtension, 'SpringMappingAnnotationsExtension');
224
+ initMetadataForClass(SpringNativeHintsExtension, 'SpringNativeHintsExtension');
225
+ //endregion
226
+ function get_AVRO_PRIMITIVES() {
227
+ _init_properties_AvroExtension_kt__50nkjp();
228
+ return AVRO_PRIMITIVES;
229
+ }
230
+ var AVRO_PRIMITIVES;
231
+ function AvroExtension(packageName, language) {
232
+ var tmp = this;
233
+ var tmp_0;
234
+ switch (language.e3_1) {
235
+ case 0:
236
+ tmp_0 = new JavaAvroSource(packageName);
237
+ break;
238
+ case 1:
239
+ tmp_0 = new KotlinAvroSource(packageName);
240
+ break;
241
+ default:
242
+ // Inline function 'kotlin.error' call
243
+
244
+ var message = 'AvroExtension supports Java and Kotlin targets only, got ' + toString(language);
245
+ throw IllegalStateException_init_$Create$(toString(message));
246
+ }
247
+ tmp.d32_1 = tmp_0;
248
+ }
249
+ protoOf(AvroExtension).b1b = function (ir, ast) {
250
+ // Inline function 'kotlin.collections.buildList' call
251
+ // Inline function 'kotlin.collections.buildListInternal' call
252
+ // Inline function 'kotlin.apply' call
253
+ var this_0 = ArrayList_init_$Create$();
254
+ // Inline function 'kotlin.collections.forEach' call
255
+ var _iterator__ex2g4s = (new NonEmptyList(ast.ep_1)).t();
256
+ while (_iterator__ex2g4s.u()) {
257
+ var element = _iterator__ex2g4s.v();
258
+ // Inline function 'kotlin.collections.forEach' call
259
+ var _iterator__ex2g4s_0 = (new NonEmptyList(element.gp_1)).t();
260
+ while (_iterator__ex2g4s_0.u()) {
261
+ var element_0 = _iterator__ex2g4s_0.v();
262
+ this_0.g1(this.d32_1.e32(element_0, element));
263
+ }
264
+ }
265
+ var avroFiles = this_0.q5();
266
+ var base = new NonEmptyList(ir);
267
+ var tmp0_elvis_lhs = toNonEmptyListOrNull(plus(base, avroFiles));
268
+ var tmp;
269
+ var tmp_0 = tmp0_elvis_lhs;
270
+ if ((tmp_0 == null ? null : new NonEmptyList(tmp_0)) == null) {
271
+ tmp = ir;
272
+ } else {
273
+ tmp = tmp0_elvis_lhs;
274
+ }
275
+ return tmp;
276
+ };
277
+ function emit($this, identifier) {
278
+ var tmp;
279
+ if (identifier instanceof DefinitionIdentifier) {
280
+ tmp = sanitizeSymbol($this, identifier.o1());
281
+ } else {
282
+ if (identifier instanceof FieldIdentifier) {
283
+ // Inline function 'kotlin.let' call
284
+ var it = sanitizeSymbol($this, identifier.o1());
285
+ tmp = JavaGenerator_getInstance().j1b_1.i1(it) ? '_' + it : it;
286
+ } else {
287
+ noWhenBranchMatchedException();
288
+ }
289
+ }
290
+ return tmp;
291
+ }
292
+ function sanitizeSymbol($this, $receiver) {
293
+ // Inline function 'kotlin.collections.mapIndexed' call
294
+ var this_0 = split($receiver, ['.', ' ', '-']);
295
+ // Inline function 'kotlin.collections.mapIndexedTo' call
296
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
297
+ var index = 0;
298
+ var _iterator__ex2g4s = this_0.t();
299
+ while (_iterator__ex2g4s.u()) {
300
+ var item = _iterator__ex2g4s.v();
301
+ var _unary__edvuaz = index;
302
+ index = _unary__edvuaz + 1 | 0;
303
+ var tmp$ret$2 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance.yr(item) : item;
304
+ destination.x(tmp$ret$2);
305
+ }
306
+ var tmp = asSequence(joinToString(destination, ''));
307
+ // Inline function 'kotlin.let' call
308
+ var it = joinToString_0(filter(tmp, JavaAvroSource$sanitizeSymbol$lambda), '');
309
+ var tmp_0;
310
+ var tmp0_safe_receiver = firstOrNull(it);
311
+ var tmp_1;
312
+ var tmp_2 = tmp0_safe_receiver;
313
+ if ((tmp_2 == null ? null : new Char(tmp_2)) == null) {
314
+ tmp_1 = null;
315
+ } else {
316
+ tmp_1 = isDigit(tmp0_safe_receiver);
317
+ }
318
+ if (tmp_1 === true) {
319
+ tmp_0 = '_' + it;
320
+ } else {
321
+ tmp_0 = it;
322
+ }
323
+ return tmp_0;
324
+ }
325
+ function emit_0($this, $receiver) {
326
+ // Inline function 'kotlin.let' call
327
+ var it = emitType($this, $receiver);
328
+ return $receiver.ot() ? 'java.util.Optional<' + it + '>' : it;
329
+ }
330
+ function emitType($this, $receiver) {
331
+ var tmp;
332
+ if ($receiver instanceof Dict) {
333
+ tmp = 'java.util.Map<String, ' + emit_0($this, $receiver.bq_1) + '>';
334
+ } else {
335
+ if ($receiver instanceof Iterable) {
336
+ tmp = 'java.util.List<' + emit_0($this, $receiver.yp_1) + '>';
337
+ } else {
338
+ if ($receiver instanceof Unit) {
339
+ tmp = 'void';
340
+ } else {
341
+ if ($receiver instanceof Any) {
342
+ tmp = 'Object';
343
+ } else {
344
+ if ($receiver instanceof Custom) {
345
+ tmp = $receiver.n19_1;
346
+ } else {
347
+ if ($receiver instanceof Primitive) {
348
+ var t = $receiver.p19_1;
349
+ var tmp_0;
350
+ if (t instanceof String_0) {
351
+ tmp_0 = 'String';
352
+ } else {
353
+ if (t instanceof Integer) {
354
+ var tmp_1;
355
+ switch (t.x19_1.e3_1) {
356
+ case 0:
357
+ tmp_1 = 'Integer';
358
+ break;
359
+ case 1:
360
+ tmp_1 = 'Long';
361
+ break;
362
+ default:
363
+ noWhenBranchMatchedException();
364
+ break;
365
+ }
366
+ tmp_0 = tmp_1;
367
+ } else {
368
+ if (t instanceof Number_0) {
369
+ var tmp_2;
370
+ switch (t.s19_1.e3_1) {
371
+ case 0:
372
+ tmp_2 = 'Float';
373
+ break;
374
+ case 1:
375
+ tmp_2 = 'Double';
376
+ break;
377
+ default:
378
+ noWhenBranchMatchedException();
379
+ break;
380
+ }
381
+ tmp_0 = tmp_2;
382
+ } else {
383
+ if (t instanceof Boolean_0) {
384
+ tmp_0 = 'Boolean';
385
+ } else {
386
+ if (t instanceof Bytes) {
387
+ tmp_0 = 'byte[]';
388
+ } else {
389
+ noWhenBranchMatchedException();
390
+ }
391
+ }
392
+ }
393
+ }
394
+ }
395
+ tmp = tmp_0;
396
+ } else {
397
+ noWhenBranchMatchedException();
398
+ }
399
+ }
400
+ }
401
+ }
402
+ }
403
+ }
404
+ return tmp;
405
+ }
406
+ function emitRoot($this, $receiver) {
407
+ var tmp;
408
+ if ($receiver instanceof Dict) {
409
+ tmp = emitRoot($this, $receiver.bq_1);
410
+ } else {
411
+ if ($receiver instanceof Iterable) {
412
+ tmp = emitRoot($this, $receiver.yp_1);
413
+ } else {
414
+ if ($receiver instanceof Unit) {
415
+ tmp = 'void';
416
+ } else {
417
+ tmp = emitType($this, $receiver);
418
+ }
419
+ }
420
+ }
421
+ return tmp;
422
+ }
423
+ function schemaField($this, definition, module_0) {
424
+ return trimMargin('\n |public static final org.apache.avro.Schema SCHEMA =\n | new org.apache.avro.Schema.Parser().parse("' + schema($this.f32_1, definition, module_0) + '");\n |\n ');
425
+ }
426
+ function toValue($this, field) {
427
+ var reference = field.pp_1;
428
+ var tmp;
429
+ if (reference instanceof Iterable) {
430
+ tmp = 'data.' + emit($this, field.op_1) + '().stream().map(it -> ' + avroClass(reference.yp_1.o1()) + '.to(it)).toList()';
431
+ } else {
432
+ if (reference instanceof Custom) {
433
+ tmp = avroClass(emit_0($this, field.pp_1)) + '.to(data.' + emit($this, field.op_1) + '())';
434
+ } else {
435
+ if (reference instanceof Primitive) {
436
+ var tmp_0;
437
+ if (reference.p19_1 instanceof Bytes) {
438
+ tmp_0 = 'java.nio.ByteBuffer.wrap(data.' + emit($this, field.op_1) + '())';
439
+ } else {
440
+ tmp_0 = 'data.' + emit($this, field.op_1) + '()' + (reference.q19_1 ? '.orElse(null)' : '');
441
+ }
442
+ tmp = tmp_0;
443
+ } else {
444
+ // Inline function 'kotlin.TODO' call
445
+ throw new NotImplementedError();
446
+ }
447
+ }
448
+ }
449
+ return tmp;
450
+ }
451
+ function fromValue($this, module_0) {
452
+ return JavaAvroSource$fromValue$lambda($this, module_0);
453
+ }
454
+ function JavaAvroSource$sanitizeSymbol$lambda(it) {
455
+ return isLetterOrDigit(it.k1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).i1(it);
456
+ }
457
+ function JavaAvroSource$fromValue$lambda(this$0, $module) {
458
+ return function (index, field) {
459
+ var reference = field.pp_1;
460
+ var tmp;
461
+ if (reference instanceof Iterable) {
462
+ tmp = '((java.util.List<org.apache.avro.generic.GenericData.Record>) record.get(' + index + ')).stream().map(it -> ' + avroClass(emitRoot(this$0, reference.yp_1)) + '.from(it)).toList()';
463
+ } else {
464
+ if (reference instanceof Custom) {
465
+ tmp = reference.o19_1 ? '(' + emit_0(this$0, reference) + ') java.util.Optional.ofNullable((' + emitRoot(this$0, field.pp_1) + ') record.get(' + index + '))' : isEnum(reference, $module) ? avroClass(emit_0(this$0, field.pp_1)) + '.from((org.apache.avro.generic.GenericData.EnumSymbol) record.get(' + index + '))' : avroClass(emit_0(this$0, field.pp_1)) + '.from((org.apache.avro.generic.GenericData.Record) record.get(' + index + '))';
466
+ } else {
467
+ if (reference instanceof Primitive) {
468
+ tmp = reference.q19_1 ? '(' + emit_0(this$0, reference) + ') java.util.Optional.ofNullable((' + emitRoot(this$0, field.pp_1) + ') record.get(' + index + '))' : equals(reference.p19_1, Bytes_instance) ? '(' + emit_0(this$0, reference) + ') ((java.nio.ByteBuffer) record.get(' + index + ')).array()' : equals(reference.p19_1, new String_0(null)) ? '(' + emit_0(this$0, reference) + ') record.get(' + index + ').toString()' : '(' + emit_0(this$0, reference) + ') record.get(' + index + ')';
469
+ } else {
470
+ tmp = '(' + emit_0(this$0, reference) + ') record.get(' + index + ')';
471
+ }
472
+ }
473
+ }
474
+ return tmp;
475
+ };
476
+ }
477
+ function JavaAvroSource(packageName) {
478
+ this.f32_1 = packageName;
479
+ }
480
+ protoOf(JavaAvroSource).e32 = function (definition, module_0) {
481
+ var tmp;
482
+ if (definition instanceof Type) {
483
+ var tmp_0 = emit(this, definition.kp_1);
484
+ var tmp_1 = schemaField(this, definition, module_0);
485
+ // Inline function 'kotlin.collections.mapIndexed' call
486
+ var this_0 = get_fields(definition.lp_1);
487
+ // Inline function 'kotlin.collections.mapIndexedTo' call
488
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
489
+ var index = 0;
490
+ var _iterator__ex2g4s = this_0.t();
491
+ while (_iterator__ex2g4s.u()) {
492
+ var item = _iterator__ex2g4s.v();
493
+ var _unary__edvuaz = index;
494
+ index = _unary__edvuaz + 1 | 0;
495
+ var index_0 = checkIndexOverflow(_unary__edvuaz);
496
+ var tmp$ret$2 = to(emit(this, item.op_1), fromValue(this, module_0)(index_0, item));
497
+ destination.x(tmp$ret$2);
498
+ }
499
+ var tmp_2 = destination;
500
+ // Inline function 'kotlin.collections.mapIndexed' call
501
+ var this_1 = get_fields(definition.lp_1);
502
+ // Inline function 'kotlin.collections.mapIndexedTo' call
503
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
504
+ var index_1 = 0;
505
+ var _iterator__ex2g4s_0 = this_1.t();
506
+ while (_iterator__ex2g4s_0.u()) {
507
+ var item_0 = _iterator__ex2g4s_0.v();
508
+ var _unary__edvuaz_0 = index_1;
509
+ index_1 = _unary__edvuaz_0 + 1 | 0;
510
+ var tmp$ret$5 = 'record.put(' + checkIndexOverflow(_unary__edvuaz_0) + ', ' + toValue(this, item_0) + ')';
511
+ destination_0.x(tmp$ret$5);
512
+ }
513
+ tmp = listOf(typeAvroFile(this.f32_1, tmp_0, tmp_1, 'new org.apache.avro.generic.GenericData.Record(SCHEMA)', tmp_2, destination_0));
514
+ } else {
515
+ if (definition instanceof Enum_0) {
516
+ tmp = listOf(enumAvroFile(this.f32_1, emit(this, definition.qs_1), schemaField(this, definition, module_0), emit(this, definition.qs_1) + '.valueOf(record.toString())', 'new org.apache.avro.generic.GenericData.EnumSymbol(SCHEMA, data.name())'));
517
+ } else {
518
+ tmp = emptyList();
519
+ }
520
+ }
521
+ return tmp;
522
+ };
523
+ function emit_1($this, identifier) {
524
+ var tmp;
525
+ if (identifier instanceof DefinitionIdentifier) {
526
+ tmp = sanitize($this, identifier);
527
+ } else {
528
+ if (identifier instanceof FieldIdentifier) {
529
+ // Inline function 'kotlin.let' call
530
+ var it = sanitize($this, identifier);
531
+ tmp = KotlinGenerator_getInstance().l1b_1.i1(it) ? addBackticks(it) : it;
532
+ } else {
533
+ noWhenBranchMatchedException();
534
+ }
535
+ }
536
+ return tmp;
537
+ }
538
+ function sanitize($this, $receiver) {
539
+ // Inline function 'kotlin.collections.mapIndexed' call
540
+ var this_0 = split($receiver.o1(), ['.', ' ']);
541
+ // Inline function 'kotlin.collections.mapIndexedTo' call
542
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
543
+ var index = 0;
544
+ var _iterator__ex2g4s = this_0.t();
545
+ while (_iterator__ex2g4s.u()) {
546
+ var item = _iterator__ex2g4s.v();
547
+ var _unary__edvuaz = index;
548
+ index = _unary__edvuaz + 1 | 0;
549
+ var tmp$ret$2 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance.yr(item) : item;
550
+ destination.x(tmp$ret$2);
551
+ }
552
+ var tmp = asSequence(joinToString(destination, ''));
553
+ // Inline function 'kotlin.let' call
554
+ var it = joinToString_0(filter(tmp, KotlinAvroSource$sanitize$lambda), '');
555
+ var tmp_0;
556
+ var tmp0_safe_receiver = firstOrNull(it);
557
+ var tmp_1;
558
+ var tmp_2 = tmp0_safe_receiver;
559
+ if ((tmp_2 == null ? null : new Char(tmp_2)) == null) {
560
+ tmp_1 = null;
561
+ } else {
562
+ tmp_1 = isDigit(tmp0_safe_receiver);
563
+ }
564
+ if (tmp_1 === true) {
565
+ tmp_0 = '_' + it;
566
+ } else {
567
+ tmp_0 = it;
568
+ }
569
+ return tmp_0;
570
+ }
571
+ function emit_2($this, $receiver) {
572
+ var tmp;
573
+ if ($receiver instanceof Dict) {
574
+ tmp = 'Map<String, ' + emit_2($this, $receiver.bq_1) + '>';
575
+ } else {
576
+ if ($receiver instanceof Iterable) {
577
+ tmp = 'List<' + emit_2($this, $receiver.yp_1) + '>';
578
+ } else {
579
+ if ($receiver instanceof Unit) {
580
+ tmp = 'Unit';
581
+ } else {
582
+ if ($receiver instanceof Any) {
583
+ tmp = 'Any';
584
+ } else {
585
+ if ($receiver instanceof Custom) {
586
+ tmp = $receiver.n19_1;
587
+ } else {
588
+ if ($receiver instanceof Primitive) {
589
+ var t = $receiver.p19_1;
590
+ var tmp_0;
591
+ if (t instanceof String_0) {
592
+ tmp_0 = 'String';
593
+ } else {
594
+ if (t instanceof Integer) {
595
+ var tmp_1;
596
+ switch (t.x19_1.e3_1) {
597
+ case 0:
598
+ tmp_1 = 'Int';
599
+ break;
600
+ case 1:
601
+ tmp_1 = 'Long';
602
+ break;
603
+ default:
604
+ noWhenBranchMatchedException();
605
+ break;
606
+ }
607
+ tmp_0 = tmp_1;
608
+ } else {
609
+ if (t instanceof Number_0) {
610
+ var tmp_2;
611
+ switch (t.s19_1.e3_1) {
612
+ case 0:
613
+ tmp_2 = 'Float';
614
+ break;
615
+ case 1:
616
+ tmp_2 = 'Double';
617
+ break;
618
+ default:
619
+ noWhenBranchMatchedException();
620
+ break;
621
+ }
622
+ tmp_0 = tmp_2;
623
+ } else {
624
+ if (t instanceof Boolean_0) {
625
+ tmp_0 = 'Boolean';
626
+ } else {
627
+ if (t instanceof Bytes) {
628
+ tmp_0 = 'ByteArray';
629
+ } else {
630
+ noWhenBranchMatchedException();
631
+ }
632
+ }
633
+ }
634
+ }
635
+ }
636
+ tmp = tmp_0;
637
+ } else {
638
+ noWhenBranchMatchedException();
639
+ }
640
+ }
641
+ }
642
+ }
643
+ }
644
+ }
645
+ // Inline function 'kotlin.let' call
646
+ var it = tmp;
647
+ return $receiver.ot() ? it + '?' : it;
648
+ }
649
+ function avroObject($this, reference) {
650
+ return avroClass(emit_2($this, reference.p1a(false)));
651
+ }
652
+ function schemaField_0($this, definition, module_0, explicitType) {
653
+ var declaration = explicitType ? 'val SCHEMA: org.apache.avro.Schema' : 'val SCHEMA';
654
+ return declaration + ' = org.apache.avro.Schema.Parser().parse("' + schema($this.g32_1, definition, module_0) + '")';
655
+ }
656
+ function toValue_0($this, field) {
657
+ var value = 'data.' + emit_1($this, field.op_1);
658
+ var access = field.pp_1.ot() ? value + '?' : value;
659
+ var reference = field.pp_1;
660
+ var tmp;
661
+ if (reference instanceof Iterable) {
662
+ var tmp_0;
663
+ if (reference.yp_1 instanceof Custom) {
664
+ tmp_0 = access + '.map{' + avroObject($this, reference.yp_1) + '.to(it)}';
665
+ } else {
666
+ tmp_0 = value;
667
+ }
668
+ tmp = tmp_0;
669
+ } else {
670
+ if (reference instanceof Dict) {
671
+ var tmp_1;
672
+ if (reference.bq_1 instanceof Custom) {
673
+ tmp_1 = access + '.mapValues{' + avroObject($this, reference.bq_1) + '.to(it.value)}';
674
+ } else {
675
+ tmp_1 = value;
676
+ }
677
+ tmp = tmp_1;
678
+ } else {
679
+ if (reference instanceof Custom) {
680
+ tmp = field.pp_1.ot() ? access + '.let{' + avroObject($this, reference) + '.to(it)}' : avroObject($this, reference) + '.to(' + value + ')';
681
+ } else {
682
+ if (reference instanceof Primitive) {
683
+ tmp = equals(reference.p19_1, Bytes_instance) && reference.q19_1 ? access + '.let{java.nio.ByteBuffer.wrap(it)}' : equals(reference.p19_1, Bytes_instance) ? 'java.nio.ByteBuffer.wrap(' + value + ')' : value;
684
+ } else {
685
+ // Inline function 'kotlin.error' call
686
+ var message = 'Cannot emit Avro: ' + toString(reference);
687
+ throw IllegalStateException_init_$Create$(toString(message));
688
+ }
689
+ }
690
+ }
691
+ }
692
+ return tmp;
693
+ }
694
+ function fromValue_0($this, module_0) {
695
+ return KotlinAvroSource$fromValue$lambda($this, module_0);
696
+ }
697
+ function element($this, module_0, reference, value) {
698
+ var tmp;
699
+ if (reference instanceof Custom) {
700
+ tmp = isEnum(reference, module_0) ? avroObject($this, reference) + '.from(' + value + ' as org.apache.avro.generic.GenericData.EnumSymbol)' : avroObject($this, reference) + '.from(' + value + ' as org.apache.avro.generic.GenericData.Record)';
701
+ } else {
702
+ if (reference instanceof Primitive) {
703
+ var tmp_0;
704
+ if (reference.p19_1 instanceof String_0) {
705
+ tmp_0 = value + '.toString()';
706
+ } else {
707
+ tmp_0 = value + ' as ' + emit_2($this, reference);
708
+ }
709
+ tmp = tmp_0;
710
+ } else {
711
+ // Inline function 'kotlin.error' call
712
+ var message = 'Cannot emit Avro element: ' + toString(reference);
713
+ throw IllegalStateException_init_$Create$(toString(message));
714
+ }
715
+ }
716
+ return tmp;
717
+ }
718
+ function KotlinAvroSource$sanitize$lambda(it) {
719
+ return isLetterOrDigit(it.k1_1) || listOf(new Char(_Char___init__impl__6a9atx(95))).i1(it);
720
+ }
721
+ function KotlinAvroSource$fromValue$lambda(this$0, $module) {
722
+ return function (index, field) {
723
+ var reference = field.pp_1;
724
+ var get = 'record.get(' + index + ')';
725
+ var orNull = reference.ot() ? '?' : '';
726
+ var tmp;
727
+ if (reference instanceof Iterable) {
728
+ tmp = '(' + get + ' as kotlin.collections.List<*>' + orNull + ')' + orNull + '.map{' + element(this$0, $module, reference.yp_1, 'it') + '}';
729
+ } else {
730
+ if (reference instanceof Dict) {
731
+ tmp = '(' + get + ' as kotlin.collections.Map<*, *>' + orNull + ')' + orNull + '.entries' + orNull + '.associate{it.key.toString() to ' + element(this$0, $module, reference.bq_1, 'it.value') + '}';
732
+ } else {
733
+ if (reference instanceof Custom) {
734
+ var carrier = isEnum(reference, $module) ? 'org.apache.avro.generic.GenericData.EnumSymbol' : 'org.apache.avro.generic.GenericData.Record';
735
+ tmp = reference.o19_1 ? '(' + get + ' as ' + carrier + '?)?.let{' + avroObject(this$0, reference) + '.from(it)}' : element(this$0, $module, reference, get);
736
+ } else {
737
+ if (reference instanceof Primitive) {
738
+ var tmp1_subject = reference.p19_1;
739
+ var tmp_0;
740
+ if (tmp1_subject instanceof Bytes) {
741
+ tmp_0 = '(' + get + ' as java.nio.ByteBuffer' + orNull + ')' + orNull + '.array()';
742
+ } else {
743
+ if (tmp1_subject instanceof String_0) {
744
+ tmp_0 = get + orNull + '.toString() as ' + emit_2(this$0, reference);
745
+ } else {
746
+ tmp_0 = get + ' as ' + emit_2(this$0, reference);
747
+ }
748
+ }
749
+ tmp = tmp_0;
750
+ } else {
751
+ // Inline function 'kotlin.error' call
752
+ var message = 'Cannot emit Avro: ' + toString(reference);
753
+ throw IllegalStateException_init_$Create$(toString(message));
754
+ }
755
+ }
756
+ }
757
+ }
758
+ return tmp;
759
+ };
760
+ }
761
+ function KotlinAvroSource(packageName) {
762
+ this.g32_1 = packageName;
763
+ }
764
+ protoOf(KotlinAvroSource).e32 = function (definition, module_0) {
765
+ var tmp;
766
+ if (definition instanceof Type) {
767
+ var tmp_0 = emit_1(this, definition.kp_1);
768
+ var tmp_1 = schemaField_0(this, definition, module_0, false);
769
+ // Inline function 'kotlin.collections.mapIndexed' call
770
+ var this_0 = get_fields(definition.lp_1);
771
+ // Inline function 'kotlin.collections.mapIndexedTo' call
772
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
773
+ var index = 0;
774
+ var _iterator__ex2g4s = this_0.t();
775
+ while (_iterator__ex2g4s.u()) {
776
+ var item = _iterator__ex2g4s.v();
777
+ var _unary__edvuaz = index;
778
+ index = _unary__edvuaz + 1 | 0;
779
+ var index_0 = checkIndexOverflow(_unary__edvuaz);
780
+ var tmp$ret$2 = to(emit_1(this, item.op_1), fromValue_0(this, module_0)(index_0, item));
781
+ destination.x(tmp$ret$2);
782
+ }
783
+ var tmp_2 = destination;
784
+ // Inline function 'kotlin.collections.mapIndexed' call
785
+ var this_1 = get_fields(definition.lp_1);
786
+ // Inline function 'kotlin.collections.mapIndexedTo' call
787
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
788
+ var index_1 = 0;
789
+ var _iterator__ex2g4s_0 = this_1.t();
790
+ while (_iterator__ex2g4s_0.u()) {
791
+ var item_0 = _iterator__ex2g4s_0.v();
792
+ var _unary__edvuaz_0 = index_1;
793
+ index_1 = _unary__edvuaz_0 + 1 | 0;
794
+ var tmp$ret$5 = 'record.put(' + checkIndexOverflow(_unary__edvuaz_0) + ', ' + toValue_0(this, item_0) + ')';
795
+ destination_0.x(tmp$ret$5);
796
+ }
797
+ tmp = listOf(typeAvroFile(this.g32_1, tmp_0, tmp_1, 'org.apache.avro.generic.GenericData.Record(SCHEMA)', tmp_2, destination_0));
798
+ } else {
799
+ if (definition instanceof Enum_0) {
800
+ tmp = listOf(enumAvroFile(this.g32_1, emit_1(this, definition.qs_1), schemaField_0(this, definition, module_0, true), emit_1(this, definition.qs_1) + '.valueOf(record.toString())', 'org.apache.avro.generic.GenericData.EnumSymbol(SCHEMA, data.name)'));
801
+ } else {
802
+ tmp = emptyList();
803
+ }
804
+ }
805
+ return tmp;
806
+ };
807
+ function typeAvroFile(packageName, typeName, schemaField, recordConstructor, fromArgs, toPuts) {
808
+ _init_properties_AvroExtension_kt__50nkjp();
809
+ var tmp = Name_init_$Create$([packageName.dt() + 'avro/' + typeName + 'Avro']);
810
+ return file(tmp, typeAvroFile$lambda(packageName, typeName, schemaField, fromArgs, recordConstructor, toPuts));
811
+ }
812
+ function enumAvroFile(packageName, enumName, schemaField, fromExpr, toExpr) {
813
+ _init_properties_AvroExtension_kt__50nkjp();
814
+ var tmp = Name_init_$Create$([packageName.dt() + 'avro/' + enumName + 'Avro']);
815
+ return file(tmp, enumAvroFile$lambda(packageName, enumName, schemaField, fromExpr, toExpr));
816
+ }
817
+ function schema(packageName, definition, module_0) {
818
+ _init_properties_AvroExtension_kt__50nkjp();
819
+ var tmp0_safe_receiver = emitAvroSchema(packageName, definition, module_0);
820
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : replace(tmp0_safe_receiver, '\\"<<<<<', '" + ');
821
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : replace(tmp1_safe_receiver, '>>>>>\\"', 'Avro.SCHEMA + "');
822
+ var tmp;
823
+ if (tmp2_elvis_lhs == null) {
824
+ // Inline function 'kotlin.error' call
825
+ var message = 'Cannot emit avro: ' + definition.ds().o1();
826
+ throw IllegalStateException_init_$Create$(toString(message));
827
+ } else {
828
+ tmp = tmp2_elvis_lhs;
829
+ }
830
+ return tmp;
831
+ }
832
+ function avroClass(_this__u8e3s4) {
833
+ _init_properties_AvroExtension_kt__50nkjp();
834
+ return replace(_this__u8e3s4, '.model.', '.avro.') + 'Avro';
835
+ }
836
+ function isEnum(_this__u8e3s4, module_0) {
837
+ _init_properties_AvroExtension_kt__50nkjp();
838
+ // Inline function 'kotlin.collections.filterIsInstance' call
839
+ var tmp0 = new NonEmptyList(module_0.gp_1);
840
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
841
+ var destination = ArrayList_init_$Create$();
842
+ var _iterator__ex2g4s = tmp0.t();
843
+ while (_iterator__ex2g4s.u()) {
844
+ var element = _iterator__ex2g4s.v();
845
+ if (element instanceof Enum_0) {
846
+ destination.x(element);
847
+ }
848
+ }
849
+ var tmp$ret$2;
850
+ $l$block_0: {
851
+ // Inline function 'kotlin.collections.any' call
852
+ var tmp;
853
+ if (isInterface(destination, Collection)) {
854
+ tmp = destination.r();
855
+ } else {
856
+ tmp = false;
857
+ }
858
+ if (tmp) {
859
+ tmp$ret$2 = false;
860
+ break $l$block_0;
861
+ }
862
+ var _iterator__ex2g4s_0 = destination.t();
863
+ while (_iterator__ex2g4s_0.u()) {
864
+ var element_0 = _iterator__ex2g4s_0.v();
865
+ if (element_0.qs_1.o1() === _this__u8e3s4.o1()) {
866
+ tmp$ret$2 = true;
867
+ break $l$block_0;
868
+ }
869
+ }
870
+ tmp$ret$2 = false;
871
+ }
872
+ return tmp$ret$2;
873
+ }
874
+ function emitAvroSchema(packageName, definition, module_0) {
875
+ _init_properties_AvroExtension_kt__50nkjp();
876
+ // Inline function 'kotlin.with' call
877
+ var $this$with = AvroJsonEmitter_getInstance();
878
+ var tmp;
879
+ if (definition instanceof Type) {
880
+ tmp = $this$with.o30(definition, module_0, mutableListOf([definition.kp_1.o1()])).n31(VOID, VOID, packageName.bt_1);
881
+ } else {
882
+ if (definition instanceof Enum_0) {
883
+ tmp = $this$with.l30(definition);
884
+ } else {
885
+ tmp = null;
886
+ }
887
+ }
888
+ var tmp0_safe_receiver = tmp;
889
+ var tmp_0;
890
+ if (tmp0_safe_receiver == null) {
891
+ tmp_0 = null;
892
+ } else {
893
+ // Inline function 'kotlin.collections.mutableSetOf' call
894
+ var tmp$ret$2 = LinkedHashSet_init_$Create$();
895
+ tmp_0 = flatten(tmp0_safe_receiver, tmp$ret$2);
896
+ }
897
+ var tmp1_safe_receiver = tmp_0;
898
+ var tmp_1;
899
+ if (tmp1_safe_receiver == null) {
900
+ tmp_1 = null;
901
+ } else {
902
+ // Inline function 'kotlin.let' call
903
+ // Inline function 'kotlinx.serialization.encodeToString' call
904
+ var this_0 = Default_getInstance();
905
+ // Inline function 'kotlinx.serialization.serializer' call
906
+ var this_1 = this_0.h24();
907
+ // Inline function 'kotlinx.serialization.internal.cast' call
908
+ var this_2 = serializer(this_1, createKType(getKClass(Type_0), arrayOf([]), false));
909
+ var tmp$ret$6 = isInterface(this_2, KSerializer) ? this_2 : THROW_CCE();
910
+ tmp_1 = this_0.m2l(tmp$ret$6, tmp1_safe_receiver);
911
+ }
912
+ var tmp2_safe_receiver = tmp_1;
913
+ return tmp2_safe_receiver == null ? null : escaped(tmp2_safe_receiver);
914
+ }
915
+ function flatten(_this__u8e3s4, defined) {
916
+ _init_properties_AvroExtension_kt__50nkjp();
917
+ var tmp;
918
+ if (_this__u8e3s4 instanceof RecordType) {
919
+ defined.x(_this__u8e3s4.r2z_1);
920
+ // Inline function 'kotlin.collections.map' call
921
+ var this_0 = _this__u8e3s4.t2z_1;
922
+ // Inline function 'kotlin.collections.mapTo' call
923
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
924
+ var _iterator__ex2g4s = this_0.t();
925
+ while (_iterator__ex2g4s.u()) {
926
+ var item = _iterator__ex2g4s.v();
927
+ // Inline function 'kotlin.collections.map' call
928
+ var this_1 = item.y2z_1;
929
+ // Inline function 'kotlin.collections.mapTo' call
930
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
931
+ var _iterator__ex2g4s_0 = this_1.t();
932
+ while (_iterator__ex2g4s_0.u()) {
933
+ var item_0 = _iterator__ex2g4s_0.v();
934
+ var tmp$ret$5 = flatten(item_0, defined);
935
+ destination_0.x(tmp$ret$5);
936
+ }
937
+ var tmp$ret$2 = item.i31(VOID, TypeList_init_$Create$(destination_0));
938
+ destination.x(tmp$ret$2);
939
+ }
940
+ tmp = _this__u8e3s4.n31(VOID, VOID, VOID, destination);
941
+ } else {
942
+ if (_this__u8e3s4 instanceof ArrayType) {
943
+ tmp = _this__u8e3s4.p31(VOID, flatten(_this__u8e3s4.w2z_1, defined));
944
+ } else {
945
+ if (_this__u8e3s4 instanceof EnumType) {
946
+ // Inline function 'kotlin.also' call
947
+ defined.x(_this__u8e3s4.n2z_1);
948
+ tmp = _this__u8e3s4;
949
+ } else {
950
+ if (_this__u8e3s4 instanceof LogicalType) {
951
+ tmp = _this__u8e3s4;
952
+ } else {
953
+ if (_this__u8e3s4 instanceof SimpleType) {
954
+ var tmp_0;
955
+ if (get_AVRO_PRIMITIVES().i1(_this__u8e3s4.d2z_1) || defined.i1(_this__u8e3s4.d2z_1)) {
956
+ tmp_0 = _this__u8e3s4;
957
+ } else {
958
+ defined.x(_this__u8e3s4.d2z_1);
959
+ tmp_0 = _this__u8e3s4.l31('<<<<<' + _this__u8e3s4.d2z_1 + '>>>>>');
960
+ }
961
+ tmp = tmp_0;
962
+ } else {
963
+ if (_this__u8e3s4 instanceof MapType) {
964
+ tmp = _this__u8e3s4.q31(VOID, flatten(_this__u8e3s4.h2z_1, defined));
965
+ } else {
966
+ if (_this__u8e3s4 instanceof UnionType) {
967
+ // Inline function 'kotlin.collections.map' call
968
+ var this_2 = _this__u8e3s4.f2z_1;
969
+ // Inline function 'kotlin.collections.mapTo' call
970
+ var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
971
+ var _iterator__ex2g4s_1 = this_2.t();
972
+ while (_iterator__ex2g4s_1.u()) {
973
+ var item_1 = _iterator__ex2g4s_1.v();
974
+ var tmp$ret$10 = flatten(item_1, defined);
975
+ destination_1.x(tmp$ret$10);
976
+ }
977
+ tmp = _this__u8e3s4.s31(VOID, TypeList_init_$Create$(destination_1));
978
+ } else {
979
+ noWhenBranchMatchedException();
980
+ }
981
+ }
982
+ }
983
+ }
984
+ }
985
+ }
986
+ }
987
+ return tmp;
988
+ }
989
+ function typeAvroFile$lambda$lambda$lambda($typeName, $fromArgs) {
990
+ return function ($this$function) {
991
+ $this$function.m13('record', $this$function.q14('org.apache.avro.generic.GenericData.Record', []));
992
+ $this$function.j13($this$function.q14($typeName, []));
993
+ var tmp = $this$function.q14($typeName, []);
994
+ // Inline function 'kotlin.collections.associate' call
995
+ var this_0 = $fromArgs;
996
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
997
+ // Inline function 'kotlin.collections.associateTo' call
998
+ var destination = LinkedHashMap_init_$Create$(capacity);
999
+ var _iterator__ex2g4s = this_0.t();
1000
+ while (_iterator__ex2g4s.u()) {
1001
+ var element = _iterator__ex2g4s.v();
1002
+ var name = element.ze();
1003
+ var value = element.af();
1004
+ var tmp_0 = Companion_getInstance().wt(name);
1005
+ var tmp_1 = new RawExpression(value);
1006
+ // Inline function 'kotlin.collections.plusAssign' call
1007
+ var pair = to(tmp_0, isInterface(tmp_1, Expression) ? tmp_1 : THROW_CCE());
1008
+ destination.v2(pair.ff_1, pair.gf_1);
1009
+ }
1010
+ $this$function.p13(new ConstructorStatement(tmp, destination));
1011
+ return Unit_instance;
1012
+ };
1013
+ }
1014
+ function typeAvroFile$lambda$lambda$lambda_0($typeName, $recordConstructor, $toPuts) {
1015
+ return function ($this$function) {
1016
+ $this$function.m13('data', $this$function.q14($typeName, []));
1017
+ $this$function.j13($this$function.q14('org.apache.avro.generic.GenericData.Record', []));
1018
+ $this$function.q13('record', new RawExpression($recordConstructor));
1019
+ // Inline function 'kotlin.collections.forEach' call
1020
+ var _iterator__ex2g4s = $toPuts.t();
1021
+ while (_iterator__ex2g4s.u()) {
1022
+ var element = _iterator__ex2g4s.v();
1023
+ $this$function.i14(element);
1024
+ }
1025
+ $this$function.p13(new VariableReference(Companion_getInstance().wt('record')));
1026
+ return Unit_instance;
1027
+ };
1028
+ }
1029
+ function typeAvroFile$lambda$lambda($schemaField, $typeName, $fromArgs, $recordConstructor, $toPuts) {
1030
+ return function ($this$namespace) {
1031
+ $this$namespace.i14($schemaField);
1032
+ $this$namespace.w15('from', true, VOID, typeAvroFile$lambda$lambda$lambda($typeName, $fromArgs));
1033
+ $this$namespace.w15('to', true, VOID, typeAvroFile$lambda$lambda$lambda_0($typeName, $recordConstructor, $toPuts));
1034
+ return Unit_instance;
1035
+ };
1036
+ }
1037
+ function typeAvroFile$lambda($packageName, $typeName, $schemaField, $fromArgs, $recordConstructor, $toPuts) {
1038
+ return function ($this$file) {
1039
+ $this$file.e17($packageName.bt_1 + '.avro');
1040
+ $this$file.s15($packageName.bt_1 + '.model', $typeName);
1041
+ var tmp = $typeName + 'Avro';
1042
+ $this$file.e16(tmp, VOID, typeAvroFile$lambda$lambda($schemaField, $typeName, $fromArgs, $recordConstructor, $toPuts));
1043
+ return Unit_instance;
1044
+ };
1045
+ }
1046
+ function enumAvroFile$lambda$lambda$lambda($enumName, $fromExpr) {
1047
+ return function ($this$function) {
1048
+ $this$function.m13('record', $this$function.q14('org.apache.avro.generic.GenericData.EnumSymbol', []));
1049
+ $this$function.j13($this$function.q14($enumName, []));
1050
+ $this$function.p13(new RawExpression($fromExpr));
1051
+ return Unit_instance;
1052
+ };
1053
+ }
1054
+ function enumAvroFile$lambda$lambda$lambda_0($enumName, $toExpr) {
1055
+ return function ($this$function) {
1056
+ $this$function.m13('data', $this$function.q14($enumName, []));
1057
+ $this$function.j13($this$function.q14('org.apache.avro.generic.GenericData.EnumSymbol', []));
1058
+ $this$function.p13(new RawExpression($toExpr));
1059
+ return Unit_instance;
1060
+ };
1061
+ }
1062
+ function enumAvroFile$lambda$lambda($schemaField, $enumName, $fromExpr, $toExpr) {
1063
+ return function ($this$namespace) {
1064
+ $this$namespace.i14($schemaField);
1065
+ $this$namespace.w15('from', true, VOID, enumAvroFile$lambda$lambda$lambda($enumName, $fromExpr));
1066
+ $this$namespace.w15('to', true, VOID, enumAvroFile$lambda$lambda$lambda_0($enumName, $toExpr));
1067
+ return Unit_instance;
1068
+ };
1069
+ }
1070
+ function enumAvroFile$lambda($packageName, $enumName, $schemaField, $fromExpr, $toExpr) {
1071
+ return function ($this$file) {
1072
+ $this$file.e17($packageName.bt_1 + '.avro');
1073
+ $this$file.s15($packageName.bt_1 + '.model', $enumName);
1074
+ var tmp = $enumName + 'Avro';
1075
+ $this$file.e16(tmp, VOID, enumAvroFile$lambda$lambda($schemaField, $enumName, $fromExpr, $toExpr));
1076
+ return Unit_instance;
1077
+ };
1078
+ }
1079
+ var properties_initialized_AvroExtension_kt_gftbwd;
1080
+ function _init_properties_AvroExtension_kt__50nkjp() {
1081
+ if (!properties_initialized_AvroExtension_kt_gftbwd) {
1082
+ properties_initialized_AvroExtension_kt_gftbwd = true;
1083
+ AVRO_PRIMITIVES = setOf(['boolean', 'int', 'long', 'float', 'double', 'bytes', 'string', 'null']);
1084
+ }
1085
+ }
1086
+ function annotate($this, $receiver, recordNames, unionMemberNames) {
1087
+ // Inline function 'kotlin.collections.flatMap' call
1088
+ var tmp0 = $receiver.iv_1;
1089
+ // Inline function 'kotlin.collections.flatMapTo' call
1090
+ var destination = ArrayList_init_$Create$();
1091
+ var _iterator__ex2g4s = tmp0.t();
1092
+ while (_iterator__ex2g4s.u()) {
1093
+ var element = _iterator__ex2g4s.v();
1094
+ var tmp;
1095
+ if (element instanceof Union) {
1096
+ tmp = listOf_0([Companion_getInstance_0().i32_1, element]);
1097
+ } else {
1098
+ if (element instanceof Struct) {
1099
+ var pascal = element.hx_1.zt();
1100
+ tmp = !recordNames.i1(pascal) ? listOf(element) : unionMemberNames.i1(pascal) ? listOf_0([Companion_getInstance_0().j32(pascal), annotateFields($this, element)]) : listOf(annotateFields($this, element));
1101
+ } else {
1102
+ tmp = listOf(element);
1103
+ }
1104
+ }
1105
+ var list = tmp;
1106
+ addAll(destination, list);
1107
+ }
1108
+ return $receiver.lv(VOID, destination);
1109
+ }
1110
+ function annotateFields($this, $receiver) {
1111
+ // Inline function 'kotlin.collections.flatMap' call
1112
+ var tmp0 = $receiver.ix_1;
1113
+ // Inline function 'kotlin.collections.flatMapTo' call
1114
+ var destination = ArrayList_init_$Create$();
1115
+ var _iterator__ex2g4s = tmp0.t();
1116
+ while (_iterator__ex2g4s.u()) {
1117
+ var element = _iterator__ex2g4s.v();
1118
+ var tmp;
1119
+ if (element instanceof Field) {
1120
+ tmp = listOf_0([Companion_getInstance_0().k32(element.cw_1.xt()), element]);
1121
+ } else {
1122
+ tmp = listOf(element);
1123
+ }
1124
+ var list = tmp;
1125
+ addAll(destination, list);
1126
+ }
1127
+ return $receiver.sx(VOID, destination);
1128
+ }
1129
+ function Companion() {
1130
+ Companion_instance_1 = this;
1131
+ this.h32_1 = 'com.fasterxml.jackson.annotation';
1132
+ this.i32_1 = new RawElement('@com.fasterxml.jackson.annotation.JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.PROPERTY, property = "type")\n');
1133
+ }
1134
+ protoOf(Companion).k32 = function (name) {
1135
+ return new RawElement('@com.fasterxml.jackson.annotation.JsonProperty("' + name + '")');
1136
+ };
1137
+ protoOf(Companion).j32 = function (name) {
1138
+ return new RawElement('@com.fasterxml.jackson.annotation.JsonTypeName("' + name + '")\n');
1139
+ };
1140
+ var Companion_instance_1;
1141
+ function Companion_getInstance_0() {
1142
+ if (Companion_instance_1 == null)
1143
+ new Companion();
1144
+ return Companion_instance_1;
1145
+ }
1146
+ function JacksonExtension$extend$lambda(it) {
1147
+ return new NonEmptyList(it.gp_1);
1148
+ }
1149
+ function JacksonExtension$extend$lambda_0(it) {
1150
+ return it instanceof Type;
1151
+ }
1152
+ function JacksonExtension$extend$lambda_1(it) {
1153
+ return it.kp_1.o1();
1154
+ }
1155
+ function Name$Companion$of$ref(p0) {
1156
+ var l = function (_this__u8e3s4) {
1157
+ return p0.wt(_this__u8e3s4);
1158
+ };
1159
+ l.callableName = 'of';
1160
+ return l;
1161
+ }
1162
+ function JacksonExtension$extend$lambda_2(it) {
1163
+ return it.zt();
1164
+ }
1165
+ function JacksonExtension$extend$lambda_3(it) {
1166
+ return it instanceof File;
1167
+ }
1168
+ function JacksonExtension$extend$lambda_4(it) {
1169
+ return it.iv_1;
1170
+ }
1171
+ function JacksonExtension$extend$lambda_5(it) {
1172
+ return it instanceof Union;
1173
+ }
1174
+ function JacksonExtension$extend$lambda_6(it) {
1175
+ return it.pw_1;
1176
+ }
1177
+ function JacksonExtension$extend$lambda_7(it) {
1178
+ return it.qu_1.zt();
1179
+ }
1180
+ function JacksonExtension() {
1181
+ Companion_getInstance_0();
1182
+ }
1183
+ protoOf(JacksonExtension).b1b = function (ir, ast) {
1184
+ var tmp = asSequence_0(new NonEmptyList(ast.ep_1));
1185
+ // Inline function 'kotlin.sequences.filterIsInstance' call
1186
+ var this_0 = flatMap(tmp, JacksonExtension$extend$lambda);
1187
+ var tmp_0 = filter(this_0, JacksonExtension$extend$lambda_0);
1188
+ var tmp_1 = isInterface(tmp_0, Sequence) ? tmp_0 : THROW_CCE();
1189
+ var tmp_2 = map(tmp_1, JacksonExtension$extend$lambda_1);
1190
+ var tmp_3 = map(tmp_2, Name$Companion$of$ref(Companion_getInstance()));
1191
+ var recordNames = toSet(map(tmp_3, JacksonExtension$extend$lambda_2));
1192
+ // Inline function 'kotlin.sequences.filterIsInstance' call
1193
+ var this_1 = asSequence_0(new NonEmptyList(ir));
1194
+ var tmp_4 = filter(this_1, JacksonExtension$extend$lambda_3);
1195
+ var tmp_5 = isInterface(tmp_4, Sequence) ? tmp_4 : THROW_CCE();
1196
+ // Inline function 'kotlin.sequences.filterIsInstance' call
1197
+ var this_2 = flatMap(tmp_5, JacksonExtension$extend$lambda_4);
1198
+ var tmp_6 = filter(this_2, JacksonExtension$extend$lambda_5);
1199
+ var tmp_7 = isInterface(tmp_6, Sequence) ? tmp_6 : THROW_CCE();
1200
+ var tmp_8 = flatMap(tmp_7, JacksonExtension$extend$lambda_6);
1201
+ var unionMemberNames = toSet(map(tmp_8, JacksonExtension$extend$lambda_7));
1202
+ // Inline function 'arrow.core.NonEmptyList.map' call
1203
+ // Inline function 'kotlin.collections.map' call
1204
+ var this_3 = _NonEmptyList___get_all__impl__pmf509(ir);
1205
+ // Inline function 'kotlin.collections.mapTo' call
1206
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_3, 10));
1207
+ var _iterator__ex2g4s = this_3.t();
1208
+ while (_iterator__ex2g4s.u()) {
1209
+ var item = _iterator__ex2g4s.v();
1210
+ var tmp0_safe_receiver = item instanceof File ? item : null;
1211
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : annotate(this, tmp0_safe_receiver, recordNames, unionMemberNames);
1212
+ var tmp$ret$6 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
1213
+ destination.x(tmp$ret$6);
1214
+ }
1215
+ return _NonEmptyList___init__impl__fxd0xp(destination);
1216
+ };
1217
+ var Target_Java_instance;
1218
+ var Target_Kotlin_instance;
1219
+ var Target_Scala_instance;
1220
+ var Target_entriesInitialized;
1221
+ function Target_initEntries() {
1222
+ if (Target_entriesInitialized)
1223
+ return Unit_instance;
1224
+ Target_entriesInitialized = true;
1225
+ Target_Java_instance = new Target('Java', 0);
1226
+ Target_Kotlin_instance = new Target('Kotlin', 1);
1227
+ Target_Scala_instance = new Target('Scala', 2);
1228
+ }
1229
+ function Target(name, ordinal) {
1230
+ Enum.call(this, name, ordinal);
1231
+ }
1232
+ function Model_0(type, builder, fields) {
1233
+ this.l32_1 = type;
1234
+ this.m32_1 = builder;
1235
+ this.n32_1 = fields;
1236
+ }
1237
+ function withBuilders($this, $receiver, target, recordNames) {
1238
+ // Inline function 'kotlin.collections.flatMap' call
1239
+ var tmp0 = $receiver.iv_1;
1240
+ // Inline function 'kotlin.collections.flatMapTo' call
1241
+ var destination = ArrayList_init_$Create$();
1242
+ var _iterator__ex2g4s = tmp0.t();
1243
+ while (_iterator__ex2g4s.u()) {
1244
+ var element = _iterator__ex2g4s.v();
1245
+ var tmp0_safe_receiver = element instanceof Struct ? element : null;
1246
+ var tmp;
1247
+ if (tmp0_safe_receiver == null) {
1248
+ tmp = null;
1249
+ } else {
1250
+ // Inline function 'kotlin.takeIf' call
1251
+ var tmp_0;
1252
+ if (isRecord($this, tmp0_safe_receiver, recordNames)) {
1253
+ tmp_0 = tmp0_safe_receiver;
1254
+ } else {
1255
+ tmp_0 = null;
1256
+ }
1257
+ tmp = tmp_0;
1258
+ }
1259
+ var tmp1_safe_receiver = tmp;
1260
+ var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : withBuilder($this, tmp1_safe_receiver, target);
1261
+ var list = tmp2_elvis_lhs == null ? listOf(element) : tmp2_elvis_lhs;
1262
+ addAll(destination, list);
1263
+ }
1264
+ return $receiver.lv(VOID, destination);
1265
+ }
1266
+ function isRecord($this, $receiver, recordNames) {
1267
+ var tmp;
1268
+ var tmp_0;
1269
+ if (recordNames.i1($receiver.hx_1.zt())) {
1270
+ // Inline function 'kotlin.collections.isNotEmpty' call
1271
+ tmp_0 = !fieldList($receiver).r();
1272
+ } else {
1273
+ tmp_0 = false;
1274
+ }
1275
+ if (tmp_0) {
1276
+ var tmp0 = $receiver.lx_1;
1277
+ var tmp$ret$1;
1278
+ $l$block_0: {
1279
+ // Inline function 'kotlin.collections.none' call
1280
+ var tmp_1;
1281
+ if (isInterface(tmp0, Collection)) {
1282
+ tmp_1 = tmp0.r();
1283
+ } else {
1284
+ tmp_1 = false;
1285
+ }
1286
+ if (tmp_1) {
1287
+ tmp$ret$1 = true;
1288
+ break $l$block_0;
1289
+ }
1290
+ var _iterator__ex2g4s = tmp0.t();
1291
+ while (_iterator__ex2g4s.u()) {
1292
+ var element = _iterator__ex2g4s.v();
1293
+ var tmp_2;
1294
+ if (element instanceof Struct) {
1295
+ tmp_2 = element.hx_1.equals(Companion_getInstance_1().o32_1);
1296
+ } else {
1297
+ tmp_2 = false;
1298
+ }
1299
+ if (tmp_2) {
1300
+ tmp$ret$1 = false;
1301
+ break $l$block_0;
1302
+ }
1303
+ }
1304
+ tmp$ret$1 = true;
1305
+ }
1306
+ tmp = tmp$ret$1;
1307
+ } else {
1308
+ tmp = false;
1309
+ }
1310
+ return tmp;
1311
+ }
1312
+ function withBuilder($this, $receiver, target) {
1313
+ // Inline function 'kotlin.let' call
1314
+ var pascal = $receiver.hx_1.zt();
1315
+ var tmp;
1316
+ switch (target.e3_1) {
1317
+ case 0:
1318
+ case 1:
1319
+ tmp = Custom_init_$Create$(Companion_getInstance_1().o32_1.xt());
1320
+ break;
1321
+ case 2:
1322
+ tmp = Custom_init_$Create$(pascal + '.' + Companion_getInstance_1().o32_1.xt());
1323
+ break;
1324
+ default:
1325
+ noWhenBranchMatchedException();
1326
+ break;
1327
+ }
1328
+ var builder_0 = tmp;
1329
+ var model = new Model_0(Custom_init_$Create$(pascal), builder_0, fieldList($receiver));
1330
+ var tmp_0;
1331
+ switch (target.e3_1) {
1332
+ case 0:
1333
+ tmp_0 = listOf($receiver.sx(VOID, VOID, VOID, VOID, plus_0(plus_0(plus_0($receiver.lx_1, entryPoint($this, model)), toBuilder($this, model)), builder($this, model, target))));
1334
+ break;
1335
+ case 1:
1336
+ // Inline function 'kotlin.collections.filterNot' call
1337
+
1338
+ var tmp0 = $receiver.lx_1;
1339
+ // Inline function 'kotlin.collections.filterNotTo' call
1340
+
1341
+ var destination = ArrayList_init_$Create$();
1342
+ var _iterator__ex2g4s = tmp0.t();
1343
+ while (_iterator__ex2g4s.u()) {
1344
+ var element = _iterator__ex2g4s.v();
1345
+ var tmp_1;
1346
+ if (element instanceof RawElement) {
1347
+ // Inline function 'kotlin.text.trim' call
1348
+ var this_0 = element.gy_1;
1349
+ tmp_1 = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())) === 'companion object';
1350
+ } else {
1351
+ tmp_1 = false;
1352
+ }
1353
+ if (!tmp_1) {
1354
+ destination.x(element);
1355
+ }
1356
+ }
1357
+
1358
+ tmp_0 = listOf($receiver.sx(VOID, VOID, VOID, VOID, plus_0(plus_0(plus_0(destination, Companion_getInstance_1().q32_1), toBuilder($this, model)), builder($this, model, target))));
1359
+ break;
1360
+ case 2:
1361
+ tmp_0 = listOf_0([$receiver.sx(VOID, VOID, VOID, VOID, plus_0($receiver.lx_1, toBuilder($this, model))), new Namespace($receiver.hx_1, listOf_0([entryPoint($this, model), builder($this, model, target)]))]);
1362
+ break;
1363
+ default:
1364
+ noWhenBranchMatchedException();
1365
+ break;
1366
+ }
1367
+ return tmp_0;
1368
+ }
1369
+ function entryPoint($this, $receiver) {
1370
+ var tmp = Companion_getInstance().wt('builder');
1371
+ var tmp_0 = emptyList();
1372
+ // Inline function 'kotlin.collections.associate' call
1373
+ var this_0 = $receiver.n32_1;
1374
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1375
+ // Inline function 'kotlin.collections.associateTo' call
1376
+ var destination = LinkedHashMap_init_$Create$(capacity);
1377
+ var _iterator__ex2g4s = this_0.t();
1378
+ while (_iterator__ex2g4s.u()) {
1379
+ var element = _iterator__ex2g4s.v();
1380
+ // Inline function 'kotlin.collections.plusAssign' call
1381
+ var pair = to(element.cw_1, NullableEmpty_instance);
1382
+ destination.v2(pair.ff_1, pair.gf_1);
1383
+ }
1384
+ return new Function(tmp, VOID, tmp_0, $receiver.m32_1, listOf(new ReturnStatement(new ConstructorStatement($receiver.m32_1, destination))), VOID, true);
1385
+ }
1386
+ function toBuilder($this, $receiver) {
1387
+ var tmp = Companion_getInstance().wt('toBuilder');
1388
+ var tmp_0 = emptyList();
1389
+ // Inline function 'kotlin.collections.associate' call
1390
+ var this_0 = $receiver.n32_1;
1391
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1392
+ // Inline function 'kotlin.collections.associateTo' call
1393
+ var destination = LinkedHashMap_init_$Create$(capacity);
1394
+ var _iterator__ex2g4s = this_0.t();
1395
+ while (_iterator__ex2g4s.u()) {
1396
+ var element = _iterator__ex2g4s.v();
1397
+ // Inline function 'kotlin.let' call
1398
+ var self_1 = self_0($this, element);
1399
+ var tmp_1;
1400
+ var tmp_2 = element.dw_1;
1401
+ if (tmp_2 instanceof Nullable) {
1402
+ tmp_1 = self_1;
1403
+ } else {
1404
+ tmp_1 = new NullableOf(self_1);
1405
+ }
1406
+ var tmp$ret$3 = tmp_1;
1407
+ // Inline function 'kotlin.collections.plusAssign' call
1408
+ var pair = to(element.cw_1, tmp$ret$3);
1409
+ destination.v2(pair.ff_1, pair.gf_1);
1410
+ }
1411
+ return new Function(tmp, VOID, tmp_0, $receiver.m32_1, listOf(new ReturnStatement(new ConstructorStatement($receiver.m32_1, destination))));
1412
+ }
1413
+ function builder($this, $receiver, target) {
1414
+ var tmp = Companion_getInstance_1().o32_1;
1415
+ // Inline function 'kotlin.collections.map' call
1416
+ var this_0 = $receiver.n32_1;
1417
+ // Inline function 'kotlin.collections.mapTo' call
1418
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1419
+ var _iterator__ex2g4s = this_0.t();
1420
+ while (_iterator__ex2g4s.u()) {
1421
+ var item = _iterator__ex2g4s.v();
1422
+ var tmp$ret$2 = new Field(item.cw_1, optional($this, item.dw_1), VOID, VOID, VOID, VOID, VOID, NullableEmpty_instance);
1423
+ destination.x(tmp$ret$2);
1424
+ }
1425
+ var tmp_0 = destination;
1426
+ // Inline function 'kotlin.collections.map' call
1427
+ var this_1 = $receiver.n32_1;
1428
+ // Inline function 'kotlin.collections.mapTo' call
1429
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
1430
+ var _iterator__ex2g4s_0 = this_1.t();
1431
+ while (_iterator__ex2g4s_0.u()) {
1432
+ var item_0 = _iterator__ex2g4s_0.v();
1433
+ var tmp$ret$5 = wither($this, $receiver, item_0);
1434
+ destination_0.x(tmp$ret$5);
1435
+ }
1436
+ return new Struct(tmp, tmp_0, VOID, VOID, plus_0(destination_0, build($this, $receiver, target)), VOID, Visibility_PUBLIC_getInstance());
1437
+ }
1438
+ function wither($this, $receiver, field) {
1439
+ var tmp = new Name(plus(listOf('with'), Companion_getInstance().wt(field.cw_1.xt()).ut_1));
1440
+ var tmp_0 = listOf(new Parameter(Companion_getInstance_1().p32_1, required($this, field.dw_1)));
1441
+ // Inline function 'kotlin.collections.associate' call
1442
+ var this_0 = $receiver.n32_1;
1443
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1444
+ // Inline function 'kotlin.collections.associateTo' call
1445
+ var destination = LinkedHashMap_init_$Create$(capacity);
1446
+ var _iterator__ex2g4s = this_0.t();
1447
+ while (_iterator__ex2g4s.u()) {
1448
+ var element = _iterator__ex2g4s.v();
1449
+ // Inline function 'kotlin.collections.plusAssign' call
1450
+ var pair = to(element.cw_1, element.cw_1.equals(field.cw_1) ? new NullableOf(new VariableReference(Companion_getInstance_1().p32_1)) : self_0($this, element));
1451
+ destination.v2(pair.ff_1, pair.gf_1);
1452
+ }
1453
+ return new Function(tmp, VOID, tmp_0, $receiver.m32_1, listOf(new ReturnStatement(new ConstructorStatement($receiver.m32_1, destination))));
1454
+ }
1455
+ function build($this, $receiver, target) {
1456
+ var tmp = Companion_getInstance().wt('build');
1457
+ var tmp_0 = emptyList();
1458
+ // Inline function 'kotlin.collections.associate' call
1459
+ var this_0 = $receiver.n32_1;
1460
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1461
+ // Inline function 'kotlin.collections.associateTo' call
1462
+ var destination = LinkedHashMap_init_$Create$(capacity);
1463
+ var _iterator__ex2g4s = this_0.t();
1464
+ while (_iterator__ex2g4s.u()) {
1465
+ var element = _iterator__ex2g4s.v();
1466
+ var tmp_1;
1467
+ var tmp_2 = element.dw_1;
1468
+ if (tmp_2 instanceof Nullable) {
1469
+ tmp_1 = self_0($this, element);
1470
+ } else {
1471
+ tmp_1 = require_0($this, element, target, $receiver.l32_1);
1472
+ }
1473
+ // Inline function 'kotlin.collections.plusAssign' call
1474
+ var pair = to(element.cw_1, tmp_1);
1475
+ destination.v2(pair.ff_1, pair.gf_1);
1476
+ }
1477
+ return new Function(tmp, VOID, tmp_0, $receiver.l32_1, listOf(new ReturnStatement(new ConstructorStatement($receiver.l32_1, destination))));
1478
+ }
1479
+ function require_0($this, $receiver, target, model) {
1480
+ // Inline function 'kotlin.let' call
1481
+ var message = model.qu_1.zt() + '.' + trim_0($receiver.cw_1.xt(), charArrayOf([_Char___init__impl__6a9atx(96)])) + ' is required';
1482
+ var tmp;
1483
+ switch (target.e3_1) {
1484
+ case 0:
1485
+ tmp = new FunctionCall(self_0($this, $receiver), VOID, Companion_getInstance().wt('orElseThrow'), mapOf(to(Companion_getInstance().wt('exceptionSupplier'), new RawExpression('() -> new IllegalStateException("' + message + '")'))));
1486
+ break;
1487
+ case 1:
1488
+ tmp = new FunctionCall(VOID, VOID, Companion_getInstance().wt('checkNotNull'), mapOf_0([to(Companion_getInstance_1().p32_1, self_0($this, $receiver)), to(Companion_getInstance().wt('lazyMessage'), new RawExpression('{ "' + message + '" }'))]));
1489
+ break;
1490
+ case 2:
1491
+ tmp = new FunctionCall(self_0($this, $receiver), VOID, Companion_getInstance().wt('getOrElse'), mapOf(to(Companion_getInstance().wt('default'), new RawExpression('throw new IllegalStateException("' + message + '")'))));
1492
+ break;
1493
+ default:
1494
+ noWhenBranchMatchedException();
1495
+ break;
1496
+ }
1497
+ return tmp;
1498
+ }
1499
+ function self_0($this, $receiver) {
1500
+ return new FieldCall(new RawExpression('this'), $receiver.cw_1);
1501
+ }
1502
+ function optional($this, $receiver) {
1503
+ var tmp0_elvis_lhs = $receiver instanceof Nullable ? $receiver : null;
1504
+ return tmp0_elvis_lhs == null ? new Nullable($receiver) : tmp0_elvis_lhs;
1505
+ }
1506
+ function required($this, $receiver) {
1507
+ var tmp0_safe_receiver = $receiver instanceof Nullable ? $receiver : null;
1508
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.uu_1;
1509
+ return tmp1_elvis_lhs == null ? $receiver : tmp1_elvis_lhs;
1510
+ }
1511
+ function Companion_0() {
1512
+ Companion_instance_2 = this;
1513
+ this.o32_1 = Companion_getInstance().wt('Builder');
1514
+ this.p32_1 = Companion_getInstance().wt('value');
1515
+ this.q32_1 = new RawElement('companion object {\n fun builder(): Builder = Builder()\n}');
1516
+ }
1517
+ var Companion_instance_2;
1518
+ function Companion_getInstance_1() {
1519
+ if (Companion_instance_2 == null)
1520
+ new Companion_0();
1521
+ return Companion_instance_2;
1522
+ }
1523
+ function JvmBuilderExtension$extend$lambda(it) {
1524
+ return new NonEmptyList(it.gp_1);
1525
+ }
1526
+ function JvmBuilderExtension$extend$lambda_0(it) {
1527
+ return it instanceof Type;
1528
+ }
1529
+ function JvmBuilderExtension$extend$lambda_1(it) {
1530
+ return Companion_getInstance().wt(it.kp_1.o1()).zt();
1531
+ }
1532
+ function Target_Java_getInstance() {
1533
+ Target_initEntries();
1534
+ return Target_Java_instance;
1535
+ }
1536
+ function Target_Kotlin_getInstance() {
1537
+ Target_initEntries();
1538
+ return Target_Kotlin_instance;
1539
+ }
1540
+ function Target_Scala_getInstance() {
1541
+ Target_initEntries();
1542
+ return Target_Scala_instance;
1543
+ }
1544
+ function JvmBuilderExtension(language) {
1545
+ Companion_getInstance_1();
1546
+ this.r32_1 = language;
1547
+ var tmp = this;
1548
+ var tmp_0;
1549
+ switch (this.r32_1.e3_1) {
1550
+ case 0:
1551
+ tmp_0 = Target_Java_getInstance();
1552
+ break;
1553
+ case 1:
1554
+ tmp_0 = Target_Kotlin_getInstance();
1555
+ break;
1556
+ case 5:
1557
+ tmp_0 = Target_Scala_getInstance();
1558
+ break;
1559
+ case 2:
1560
+ case 3:
1561
+ case 4:
1562
+ case 6:
1563
+ case 7:
1564
+ case 8:
1565
+ case 9:
1566
+ case 10:
1567
+ case 11:
1568
+ tmp_0 = null;
1569
+ break;
1570
+ default:
1571
+ noWhenBranchMatchedException();
1572
+ break;
1573
+ }
1574
+ tmp.s32_1 = tmp_0;
1575
+ }
1576
+ protoOf(JvmBuilderExtension).b1b = function (ir, ast) {
1577
+ var tmp0_safe_receiver = this.s32_1;
1578
+ var tmp;
1579
+ if (tmp0_safe_receiver == null) {
1580
+ tmp = null;
1581
+ } else {
1582
+ // Inline function 'kotlin.let' call
1583
+ var tmp_0 = asSequence_0(new NonEmptyList(ast.ep_1));
1584
+ // Inline function 'kotlin.sequences.filterIsInstance' call
1585
+ var this_0 = flatMap(tmp_0, JvmBuilderExtension$extend$lambda);
1586
+ var tmp_1 = filter(this_0, JvmBuilderExtension$extend$lambda_0);
1587
+ var tmp_2 = isInterface(tmp_1, Sequence) ? tmp_1 : THROW_CCE();
1588
+ var recordNames = toSet(map(tmp_2, JvmBuilderExtension$extend$lambda_1));
1589
+ // Inline function 'arrow.core.NonEmptyList.map' call
1590
+ // Inline function 'kotlin.collections.map' call
1591
+ var this_1 = _NonEmptyList___get_all__impl__pmf509(ir);
1592
+ // Inline function 'kotlin.collections.mapTo' call
1593
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
1594
+ var _iterator__ex2g4s = this_1.t();
1595
+ while (_iterator__ex2g4s.u()) {
1596
+ var item = _iterator__ex2g4s.v();
1597
+ var tmp0_safe_receiver_0 = item instanceof File ? item : null;
1598
+ var tmp1_elvis_lhs = tmp0_safe_receiver_0 == null ? null : withBuilders(this, tmp0_safe_receiver_0, tmp0_safe_receiver, recordNames);
1599
+ var tmp$ret$6 = tmp1_elvis_lhs == null ? item : tmp1_elvis_lhs;
1600
+ destination.x(tmp$ret$6);
1601
+ }
1602
+ tmp = _NonEmptyList___init__impl__fxd0xp(destination);
1603
+ }
1604
+ var tmp1_elvis_lhs_0 = tmp;
1605
+ var tmp_3;
1606
+ var tmp_4 = tmp1_elvis_lhs_0;
1607
+ if ((tmp_4 == null ? null : new NonEmptyList(tmp_4)) == null) {
1608
+ tmp_3 = ir;
1609
+ } else {
1610
+ tmp_3 = tmp1_elvis_lhs_0;
1611
+ }
1612
+ return tmp_3;
1613
+ };
1614
+ function Companion_1() {
1615
+ }
1616
+ protoOf(Companion_1).t32 = function (channel, types, refined) {
1617
+ var payloadRef = channel.yq_1;
1618
+ var payloadType = KotlinGenerator_getInstance().m1b(convert(payloadRef));
1619
+ var payloadCustom = payloadRef instanceof Custom ? payloadRef : null;
1620
+ var tmp;
1621
+ if (payloadCustom == null) {
1622
+ tmp = null;
1623
+ } else {
1624
+ // Inline function 'kotlin.let' call
1625
+ tmp = Companion_instance_4.u32(payloadCustom.n19_1, types, refined, emptySet());
1626
+ }
1627
+ var tmp1_elvis_lhs = tmp;
1628
+ var payloadFieldShapes = tmp1_elvis_lhs == null ? emptyList() : tmp1_elvis_lhs;
1629
+ var tmp_0;
1630
+ if (payloadCustom == null) {
1631
+ tmp_0 = null;
1632
+ } else {
1633
+ // Inline function 'kotlin.let' call
1634
+ tmp_0 = types.s2(payloadCustom.n19_1);
1635
+ }
1636
+ var tmp3_safe_receiver = tmp_0;
1637
+ var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : tmp3_safe_receiver.lp_1;
1638
+ var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : get_fields(tmp4_safe_receiver);
1639
+ var tmp_1;
1640
+ if (tmp5_safe_receiver == null) {
1641
+ tmp_1 = null;
1642
+ } else {
1643
+ // Inline function 'kotlin.collections.map' call
1644
+ // Inline function 'kotlin.collections.mapTo' call
1645
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp5_safe_receiver, 10));
1646
+ var _iterator__ex2g4s = tmp5_safe_receiver.t();
1647
+ while (_iterator__ex2g4s.u()) {
1648
+ var item = _iterator__ex2g4s.v();
1649
+ var tmp$ret$6 = item.pp_1;
1650
+ destination.x(tmp$ret$6);
1651
+ }
1652
+ tmp_1 = destination;
1653
+ }
1654
+ var tmp6_elvis_lhs = tmp_1;
1655
+ var directRefs = tmp6_elvis_lhs == null ? emptyList() : tmp6_elvis_lhs;
1656
+ var modelImports = Companion_instance_4.v32(plus(listOf(payloadRef), directRefs), payloadFieldShapes, types);
1657
+ return new ChannelShape(Companion_getInstance().wt(channel.xq_1.o1()).zt(), payloadType, payloadFieldShapes, modelImports);
1658
+ };
1659
+ var Companion_instance_3;
1660
+ function Companion_getInstance_2() {
1661
+ return Companion_instance_3;
1662
+ }
1663
+ function ChannelShape(name, payloadType, payloadFieldShapes, modelImports) {
1664
+ this.w32_1 = name;
1665
+ this.x32_1 = payloadType;
1666
+ this.y32_1 = payloadFieldShapes;
1667
+ this.z32_1 = modelImports;
1668
+ }
1669
+ protoOf(ChannelShape).toString = function () {
1670
+ return 'ChannelShape(name=' + this.w32_1 + ', payloadType=' + this.x32_1 + ', payloadFieldShapes=' + toString(this.y32_1) + ', modelImports=' + toString(this.z32_1) + ')';
1671
+ };
1672
+ protoOf(ChannelShape).hashCode = function () {
1673
+ var result = getStringHashCode(this.w32_1);
1674
+ result = imul(result, 31) + getStringHashCode(this.x32_1) | 0;
1675
+ result = imul(result, 31) + hashCode(this.y32_1) | 0;
1676
+ result = imul(result, 31) + hashCode(this.z32_1) | 0;
1677
+ return result;
1678
+ };
1679
+ protoOf(ChannelShape).equals = function (other) {
1680
+ if (this === other)
1681
+ return true;
1682
+ if (!(other instanceof ChannelShape))
1683
+ return false;
1684
+ if (!(this.w32_1 === other.w32_1))
1685
+ return false;
1686
+ if (!(this.x32_1 === other.x32_1))
1687
+ return false;
1688
+ if (!equals(this.y32_1, other.y32_1))
1689
+ return false;
1690
+ if (!equals(this.z32_1, other.z32_1))
1691
+ return false;
1692
+ return true;
1693
+ };
1694
+ function ChannelDslFile$build$lambda$lambda$lambda($builder, $arbPayload, $payload, $shape) {
1695
+ return function ($this$function) {
1696
+ $this$function.l13(Visibility_PUBLIC_getInstance());
1697
+ $this$function.o13('block', $this$function.s14(Unit_instance_0, Custom_init_$Create$($builder)), $this$function.t14('{}'));
1698
+ $this$function.j13($arbPayload);
1699
+ $this$function.i14('val builder = ' + $builder + '().apply(block)');
1700
+ $this$function.i14('return channelCall<' + $payload + '>(' + $shape.w32_1 + '::class).messageGen {');
1701
+ // Inline function 'kotlin.text.trimEnd' call
1702
+ var this_0 = RecordBuilder_instance.a33($shape.y32_1, 'builder', emptyList(), ' ');
1703
+ var tmp$ret$0 = toString(trimEnd(isCharSequence(this_0) ? this_0 : THROW_CCE()));
1704
+ $this$function.i14(tmp$ret$0);
1705
+ $this$function.i14('}');
1706
+ return Unit_instance;
1707
+ };
1708
+ }
1709
+ function ChannelDslFile$build$lambda$lambda$lambda_0($arbPayload, $payload, $shape) {
1710
+ return function ($this$function) {
1711
+ $this$function.l13(Visibility_PUBLIC_getInstance());
1712
+ $this$function.j13($arbPayload);
1713
+ $this$function.p13($this$function.t14('channelCall<' + $payload + '>(' + $shape.w32_1 + '::class).messageGen()'));
1714
+ return Unit_instance;
1715
+ };
1716
+ }
1717
+ function ChannelDslFile$build$lambda$lambda($shape, $payload, $arbPayload) {
1718
+ return function ($this$struct) {
1719
+ $this$struct.h15();
1720
+ $this$struct.l13(Visibility_PUBLIC_getInstance());
1721
+ $this$struct.i15(Visibility_INTERNAL_getInstance());
1722
+ var tmp;
1723
+ // Inline function 'kotlin.collections.isNotEmpty' call
1724
+ if (!$shape.y32_1.r()) {
1725
+ var builder = RecordBuilder_instance.b33($payload);
1726
+ $this$struct.w15('message', VOID, VOID, ChannelDslFile$build$lambda$lambda$lambda(builder, $arbPayload, $payload, $shape));
1727
+ tmp = Unit_instance;
1728
+ } else {
1729
+ $this$struct.w15('message', VOID, VOID, ChannelDslFile$build$lambda$lambda$lambda_0($arbPayload, $payload, $shape));
1730
+ tmp = Unit_instance;
1731
+ }
1732
+ return Unit_instance;
1733
+ };
1734
+ }
1735
+ function ChannelDslFile$build$lambda$lambda_0($genPayload, $payload, $shape) {
1736
+ return function ($this$asyncFunction) {
1737
+ $this$asyncFunction.l13(Visibility_PUBLIC_getInstance());
1738
+ $this$asyncFunction.k13($genPayload);
1739
+ $this$asyncFunction.o13('topic', new Nullable(String_instance), $this$asyncFunction.t14('null'));
1740
+ $this$asyncFunction.o13('key', new Nullable(String_instance), $this$asyncFunction.t14('null'));
1741
+ $this$asyncFunction.j13(Custom_init_$Create$($payload));
1742
+ $this$asyncFunction.i14('val call = channelCall<' + $payload + '>(' + $shape.w32_1 + '::class)');
1743
+ $this$asyncFunction.i14('topic?.let { call.topic(it) }');
1744
+ $this$asyncFunction.i14('key?.let { call.key(it) }');
1745
+ $this$asyncFunction.p13($this$asyncFunction.t14('call.send(this)'));
1746
+ return Unit_instance;
1747
+ };
1748
+ }
1749
+ function ChannelDslFile$build$lambda($kotestPkg, $channelPkg, $shape, $modelPkg, $emitSend, $payload, $arbPayload, $genPayload) {
1750
+ return function ($this$file) {
1751
+ $this$file.e17($kotestPkg);
1752
+ $this$file.s15('community.flock.wirespec.integration.kotest.dsl', 'channelCall');
1753
+ $this$file.s15('io.kotest.property', 'Arb');
1754
+ $this$file.s15('io.kotest.property', 'Gen');
1755
+ $this$file.s15($channelPkg, $shape.w32_1);
1756
+ // Inline function 'kotlin.collections.forEach' call
1757
+ var _iterator__ex2g4s = $shape.z32_1.t();
1758
+ while (_iterator__ex2g4s.u()) {
1759
+ var element = _iterator__ex2g4s.v();
1760
+ $this$file.s15($modelPkg, Companion_getInstance().wt(element).zt());
1761
+ }
1762
+ var tmp = $shape.w32_1 + 'Generate';
1763
+ $this$file.f17(tmp, ChannelDslFile$build$lambda$lambda($shape, $payload, $arbPayload));
1764
+ $this$file.u15('generate', Custom_init_$Create$($shape.w32_1 + 'Generate'), VOID, Visibility_PUBLIC_getInstance(), Custom_init_$Create$($shape.w32_1), VOID, VOID, new FunctionCall(VOID, VOID, Companion_getInstance().wt($shape.w32_1 + 'Generate')));
1765
+ var tmp_0;
1766
+ if ($emitSend) {
1767
+ $this$file.a16('send', VOID, VOID, ChannelDslFile$build$lambda$lambda_0($genPayload, $payload, $shape));
1768
+ tmp_0 = Unit_instance;
1769
+ }
1770
+ return Unit_instance;
1771
+ };
1772
+ }
1773
+ function ChannelDslFile() {
1774
+ }
1775
+ protoOf(ChannelDslFile).c33 = function (channel, packageName, types, refined, emitSend) {
1776
+ var shape = Companion_instance_3.t32(channel, types, refined);
1777
+ var kotestPkg = packageName.bt_1 + '.kotest';
1778
+ var channelPkg = packageName.bt_1 + '.channel';
1779
+ var modelPkg = packageName.bt_1 + '.model';
1780
+ var fileName = Companion_instance_0.at(kotestPkg).dt() + (shape.w32_1 + 'Dsl');
1781
+ var payload = shape.x32_1;
1782
+ var genPayload = Custom_init_$Create$('Gen', listOf(Custom_init_$Create$(payload)));
1783
+ var arbPayload = Custom_init_$Create$('Arb', listOf(Custom_init_$Create$(payload)));
1784
+ var tmp = Companion_getInstance().wt(fileName);
1785
+ return file(tmp, ChannelDslFile$build$lambda(kotestPkg, channelPkg, shape, modelPkg, emitSend, payload, arbPayload, genPayload));
1786
+ };
1787
+ var ChannelDslFile_instance;
1788
+ function ChannelDslFile_getInstance() {
1789
+ return ChannelDslFile_instance;
1790
+ }
1791
+ function Slot(name, genFn, fields) {
1792
+ this.d33_1 = name;
1793
+ this.e33_1 = genFn;
1794
+ this.f33_1 = fields;
1795
+ }
1796
+ protoOf(Slot).toString = function () {
1797
+ return 'Slot(name=' + this.d33_1 + ', genFn=' + this.e33_1 + ', fields=' + toString(this.f33_1) + ')';
1798
+ };
1799
+ protoOf(Slot).hashCode = function () {
1800
+ var result = getStringHashCode(this.d33_1);
1801
+ result = imul(result, 31) + getStringHashCode(this.e33_1) | 0;
1802
+ result = imul(result, 31) + hashCode(this.f33_1) | 0;
1803
+ return result;
1804
+ };
1805
+ protoOf(Slot).equals = function (other) {
1806
+ if (this === other)
1807
+ return true;
1808
+ if (!(other instanceof Slot))
1809
+ return false;
1810
+ if (!(this.d33_1 === other.d33_1))
1811
+ return false;
1812
+ if (!(this.e33_1 === other.e33_1))
1813
+ return false;
1814
+ if (!equals(this.f33_1, other.f33_1))
1815
+ return false;
1816
+ return true;
1817
+ };
1818
+ function presentSlots($this, shape) {
1819
+ // Inline function 'kotlin.collections.filter' call
1820
+ var tmp0 = listOf_0([new Slot('path', 'pathGen', shape.h33_1), new Slot('query', 'queryGen', shape.i33_1), new Slot('header', 'headerGen', shape.j33_1)]);
1821
+ // Inline function 'kotlin.collections.filterTo' call
1822
+ var destination = ArrayList_init_$Create$();
1823
+ var _iterator__ex2g4s = tmp0.t();
1824
+ while (_iterator__ex2g4s.u()) {
1825
+ var element = _iterator__ex2g4s.v();
1826
+ // Inline function 'kotlin.collections.isNotEmpty' call
1827
+ if (!element.f33_1.r()) {
1828
+ destination.x(element);
1829
+ }
1830
+ }
1831
+ return destination;
1832
+ }
1833
+ function requiredSlots($this, shape) {
1834
+ // Inline function 'kotlin.collections.filter' call
1835
+ var tmp0 = presentSlots($this, shape);
1836
+ // Inline function 'kotlin.collections.filterTo' call
1837
+ var destination = ArrayList_init_$Create$();
1838
+ var _iterator__ex2g4s = tmp0.t();
1839
+ while (_iterator__ex2g4s.u()) {
1840
+ var element = _iterator__ex2g4s.v();
1841
+ var tmp0_0 = element.f33_1;
1842
+ var tmp$ret$3;
1843
+ $l$block_0: {
1844
+ // Inline function 'kotlin.collections.any' call
1845
+ var tmp;
1846
+ if (isInterface(tmp0_0, Collection)) {
1847
+ tmp = tmp0_0.r();
1848
+ } else {
1849
+ tmp = false;
1850
+ }
1851
+ if (tmp) {
1852
+ tmp$ret$3 = false;
1853
+ break $l$block_0;
1854
+ }
1855
+ var _iterator__ex2g4s_0 = tmp0_0.t();
1856
+ while (_iterator__ex2g4s_0.u()) {
1857
+ var element_0 = _iterator__ex2g4s_0.v();
1858
+ if (!element_0.s33_1) {
1859
+ tmp$ret$3 = true;
1860
+ break $l$block_0;
1861
+ }
1862
+ }
1863
+ tmp$ret$3 = false;
1864
+ }
1865
+ if (tmp$ret$3) {
1866
+ destination.x(element);
1867
+ }
1868
+ }
1869
+ return destination;
1870
+ }
1871
+ function cap($this, name) {
1872
+ // Inline function 'kotlin.text.replaceFirstChar' call
1873
+ var tmp;
1874
+ // Inline function 'kotlin.text.isNotEmpty' call
1875
+ if (charSequenceLength(name) > 0) {
1876
+ var p0 = charCodeAt(name, 0);
1877
+ var tmp0 = uppercaseChar(p0);
1878
+ // Inline function 'kotlin.text.plus' call
1879
+ var other = substring(name, 1);
1880
+ tmp = toString_0(tmp0) + other;
1881
+ } else {
1882
+ tmp = name;
1883
+ }
1884
+ return tmp;
1885
+ }
1886
+ function slotBuilderName($this, shape, slot) {
1887
+ return shape.g33_1 + cap($this, slot.d33_1) + 'Builder';
1888
+ }
1889
+ function genOf($this, inner) {
1890
+ return Custom_init_$Create$('Gen', listOf(inner));
1891
+ }
1892
+ function genOf_0($this, inner) {
1893
+ return genOf($this, Custom_init_$Create$(inner));
1894
+ }
1895
+ function arbOf($this, inner) {
1896
+ return Custom_init_$Create$('Arb', listOf(inner));
1897
+ }
1898
+ function arbOf_0($this, inner) {
1899
+ return arbOf($this, Custom_init_$Create$(inner));
1900
+ }
1901
+ function genNullableOf($this, inner) {
1902
+ return new Nullable(genOf($this, inner));
1903
+ }
1904
+ function blockType($this, builder) {
1905
+ return new Function_0(emptyList(), Unit_instance_0, Custom_init_$Create$(builder));
1906
+ }
1907
+ function suspendScopeType($this, scope) {
1908
+ return new Function_0(emptyList(), Unit_instance_0, Custom_init_$Create$(scope), true);
1909
+ }
1910
+ function buildGenerateWrapper($this, $receiver, shape) {
1911
+ var tmp = shape.g33_1 + 'Generate';
1912
+ $receiver.f17(tmp, EndpointDslFile$buildGenerateWrapper$lambda(shape));
1913
+ }
1914
+ function buildRequestCall($this, $receiver, shape) {
1915
+ $receiver.a16('call', VOID, VOID, EndpointDslFile$buildRequestCall$lambda(shape));
1916
+ }
1917
+ function buildResponseMock($this, $receiver, shape) {
1918
+ $receiver.a16('mock', VOID, VOID, EndpointDslFile$buildResponseMock$lambda(shape));
1919
+ }
1920
+ function buildResponseScope($this, $receiver, shape, variant) {
1921
+ var scopeName = shape.g33_1 + variant.u33_1 + 'Scope';
1922
+ var variantType = shape.g33_1 + '.' + variant.u33_1;
1923
+ var tmp0_safe_receiver = variant.w33_1;
1924
+ var tmp;
1925
+ if (tmp0_safe_receiver == null) {
1926
+ tmp = null;
1927
+ } else {
1928
+ // Inline function 'kotlin.takeIf' call
1929
+ var tmp_0;
1930
+ if (!variant.v33_1.equals(BodyKind_None_getInstance())) {
1931
+ tmp_0 = tmp0_safe_receiver;
1932
+ } else {
1933
+ tmp_0 = null;
1934
+ }
1935
+ tmp = tmp_0;
1936
+ }
1937
+ var bodyType = tmp;
1938
+ $receiver.f17(scopeName, EndpointDslFile$buildResponseScope$lambda(shape, variantType, bodyType, variant));
1939
+ }
1940
+ function buildScopeClass($this, $receiver, shape, present, required) {
1941
+ var tmp = shape.g33_1 + 'Scope';
1942
+ $receiver.f17(tmp, EndpointDslFile$buildScopeClass$lambda(shape, present, required));
1943
+ }
1944
+ function renderFlushBody($this, shape, present, required) {
1945
+ // Inline function 'kotlin.text.buildString' call
1946
+ // Inline function 'kotlin.apply' call
1947
+ var this_0 = StringBuilder_init_$Create$();
1948
+ // Inline function 'kotlin.collections.map' call
1949
+ // Inline function 'kotlin.collections.mapTo' call
1950
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(required, 10));
1951
+ var _iterator__ex2g4s = required.t();
1952
+ while (_iterator__ex2g4s.u()) {
1953
+ var item = _iterator__ex2g4s.v();
1954
+ var tmp$ret$5 = item.d33_1;
1955
+ destination.x(tmp$ret$5);
1956
+ }
1957
+ var requiredNames = toSet_0(destination);
1958
+ // Inline function 'kotlin.text.appendLine' call
1959
+ var value = 'if (flushed) return';
1960
+ // Inline function 'kotlin.text.appendLine' call
1961
+ this_0.q(value).s(_Char___init__impl__6a9atx(10));
1962
+ // Inline function 'kotlin.text.appendLine' call
1963
+ var value_0 = 'flushed = true';
1964
+ // Inline function 'kotlin.text.appendLine' call
1965
+ this_0.q(value_0).s(_Char___init__impl__6a9atx(10));
1966
+ // Inline function 'kotlin.collections.forEach' call
1967
+ var _iterator__ex2g4s_0 = present.t();
1968
+ while (_iterator__ex2g4s_0.u()) {
1969
+ var element = _iterator__ex2g4s_0.v();
1970
+ var builderClass = slotBuilderName(EndpointDslFile_instance, shape, element);
1971
+ var builderVar = element.d33_1 + 'Builder';
1972
+ if (requiredNames.i1(element.d33_1)) {
1973
+ // Inline function 'kotlin.text.appendLine' call
1974
+ var value_1 = 'val ' + builderVar + ' = ' + builderClass + '().apply(' + element.d33_1 + ' ?: error("' + shape.g33_1 + ': required `' + element.d33_1 + '` block is missing"))';
1975
+ // Inline function 'kotlin.text.appendLine' call
1976
+ this_0.q(value_1).s(_Char___init__impl__6a9atx(10));
1977
+ // Inline function 'kotlin.collections.forEach' call
1978
+ var _iterator__ex2g4s_1 = element.f33_1.t();
1979
+ while (_iterator__ex2g4s_1.u()) {
1980
+ var element_0 = _iterator__ex2g4s_1.v();
1981
+ // Inline function 'kotlin.text.appendLine' call
1982
+ var value_2 = registerLine(EndpointDslFile_instance, shape, element, builderVar, element_0, '');
1983
+ // Inline function 'kotlin.text.appendLine' call
1984
+ this_0.q(value_2).s(_Char___init__impl__6a9atx(10));
1985
+ }
1986
+ } else {
1987
+ // Inline function 'kotlin.text.appendLine' call
1988
+ var value_3 = 'val ' + builderVar + ' = ' + element.d33_1 + '?.let { block -> ' + builderClass + '().apply(block) }';
1989
+ // Inline function 'kotlin.text.appendLine' call
1990
+ this_0.q(value_3).s(_Char___init__impl__6a9atx(10));
1991
+ // Inline function 'kotlin.collections.forEach' call
1992
+ var _iterator__ex2g4s_2 = element.f33_1.t();
1993
+ while (_iterator__ex2g4s_2.u()) {
1994
+ var element_1 = _iterator__ex2g4s_2.v();
1995
+ // Inline function 'kotlin.text.appendLine' call
1996
+ var value_4 = registerLine(EndpointDslFile_instance, shape, element, builderVar, element_1, '', true);
1997
+ // Inline function 'kotlin.text.appendLine' call
1998
+ this_0.q(value_4).s(_Char___init__impl__6a9atx(10));
1999
+ }
2000
+ }
2001
+ }
2002
+ // Inline function 'kotlin.collections.isNotEmpty' call
2003
+ if (!shape.n33_1.r()) {
2004
+ var builderName = RecordBuilder_instance.b33(requireBodyElementType(EndpointDslFile_instance, shape));
2005
+ var isList = shape.k33_1.equals(BodyKind_List_getInstance());
2006
+ var elementType = shape.l33_1;
2007
+ // Inline function 'kotlin.text.appendLine' call
2008
+ var value_5 = 'body?.let { block ->';
2009
+ // Inline function 'kotlin.text.appendLine' call
2010
+ this_0.q(value_5).s(_Char___init__impl__6a9atx(10));
2011
+ // Inline function 'kotlin.text.appendLine' call
2012
+ var value_6 = ' val builder = ' + builderName + '().apply(block)';
2013
+ // Inline function 'kotlin.text.appendLine' call
2014
+ this_0.q(value_6).s(_Char___init__impl__6a9atx(10));
2015
+ if (isList) {
2016
+ // Inline function 'kotlin.text.appendLine' call
2017
+ var value_7 = ' inner.bodyListSize(Arb.int(bodyCount))';
2018
+ // Inline function 'kotlin.text.appendLine' call
2019
+ this_0.q(value_7).s(_Char___init__impl__6a9atx(10));
2020
+ }
2021
+ // Inline function 'kotlin.text.appendLine' call
2022
+ var value_8 = ' inner.bodyTransform { rawBase, rs ->';
2023
+ // Inline function 'kotlin.text.appendLine' call
2024
+ this_0.q(value_8).s(_Char___init__impl__6a9atx(10));
2025
+ if (isList) {
2026
+ // Inline function 'kotlin.text.appendLine' call
2027
+ var value_9 = ' @Suppress("UNCHECKED_CAST")';
2028
+ // Inline function 'kotlin.text.appendLine' call
2029
+ this_0.q(value_9).s(_Char___init__impl__6a9atx(10));
2030
+ // Inline function 'kotlin.text.appendLine' call
2031
+ var value_10 = ' (rawBase as List<' + elementType + '>).map { base ->';
2032
+ // Inline function 'kotlin.text.appendLine' call
2033
+ this_0.q(value_10).s(_Char___init__impl__6a9atx(10));
2034
+ appendBodyCopy(EndpointDslFile_instance, this_0, 'base', 'builder', shape, ' ');
2035
+ // Inline function 'kotlin.text.appendLine' call
2036
+ var value_11 = ' }';
2037
+ // Inline function 'kotlin.text.appendLine' call
2038
+ this_0.q(value_11).s(_Char___init__impl__6a9atx(10));
2039
+ } else {
2040
+ // Inline function 'kotlin.text.appendLine' call
2041
+ var value_12 = ' val base = rawBase as ' + elementType;
2042
+ // Inline function 'kotlin.text.appendLine' call
2043
+ this_0.q(value_12).s(_Char___init__impl__6a9atx(10));
2044
+ appendBodyCopy(EndpointDslFile_instance, this_0, 'base', 'builder', shape, ' ');
2045
+ }
2046
+ // Inline function 'kotlin.text.appendLine' call
2047
+ // Inline function 'kotlin.text.appendLine' call
2048
+ this_0.q(' }').s(_Char___init__impl__6a9atx(10));
2049
+ // Inline function 'kotlin.text.appendLine' call
2050
+ // Inline function 'kotlin.text.appendLine' call
2051
+ this_0.q('}').s(_Char___init__impl__6a9atx(10));
2052
+ }
2053
+ if (shape.k33_1.equals(BodyKind_Primitive_getInstance())) {
2054
+ // Inline function 'kotlin.text.appendLine' call
2055
+ var value_13 = 'body?.let { gen ->';
2056
+ // Inline function 'kotlin.text.appendLine' call
2057
+ this_0.q(value_13).s(_Char___init__impl__6a9atx(10));
2058
+ // Inline function 'kotlin.text.appendLine' call
2059
+ var value_14 = ' inner.bodyTransform { _, rs -> gen.draw(rs) }';
2060
+ // Inline function 'kotlin.text.appendLine' call
2061
+ this_0.q(value_14).s(_Char___init__impl__6a9atx(10));
2062
+ // Inline function 'kotlin.text.appendLine' call
2063
+ // Inline function 'kotlin.text.appendLine' call
2064
+ this_0.q('}').s(_Char___init__impl__6a9atx(10));
2065
+ }
2066
+ return this_0.toString();
2067
+ }
2068
+ function registerLine($this, shape, slot, builderVar, field, indent, nullableBuilder) {
2069
+ nullableBuilder = nullableBuilder === VOID ? false : nullableBuilder;
2070
+ var access = nullableBuilder ? '?.' : '.';
2071
+ var ref = builderVar + access + escapeKotlinIdentifier(field.q33_1);
2072
+ var tmp;
2073
+ if (field.s33_1) {
2074
+ tmp = 'Arb.constant(null)';
2075
+ } else {
2076
+ tmp = 'error("' + shape.g33_1 + '.' + slot.d33_1 + ': required `' + field.q33_1 + '` is missing")';
2077
+ }
2078
+ var fallback = tmp;
2079
+ return indent + 'inner.' + slot.e33_1 + '("' + field.q33_1 + '", ' + ref + ' ?: ' + fallback + ')';
2080
+ }
2081
+ function buildSlotBuilder($this, $receiver, shape, slot) {
2082
+ var tmp = slotBuilderName($this, shape, slot);
2083
+ $receiver.f17(tmp, EndpointDslFile$buildSlotBuilder$lambda(slot));
2084
+ }
2085
+ function appendBodyCopy($this, $receiver, baseExpr, receiver, shape, indent) {
2086
+ // Inline function 'kotlin.text.appendLine' call
2087
+ var value = indent + baseExpr + '.copy(';
2088
+ // Inline function 'kotlin.text.appendLine' call
2089
+ $receiver.q(value).s(_Char___init__impl__6a9atx(10));
2090
+ // Inline function 'kotlin.collections.forEach' call
2091
+ var _iterator__ex2g4s = shape.n33_1.t();
2092
+ while (_iterator__ex2g4s.u()) {
2093
+ var element = _iterator__ex2g4s.v();
2094
+ // Inline function 'kotlin.text.appendLine' call
2095
+ var value_0 = indent + ' ' + escapeKotlinIdentifier(element.m()) + ' = ' + copyValueExpr(EndpointDslFile_instance, element, baseExpr, receiver) + ',';
2096
+ // Inline function 'kotlin.text.appendLine' call
2097
+ $receiver.q(value_0).s(_Char___init__impl__6a9atx(10));
2098
+ }
2099
+ // Inline function 'kotlin.text.appendLine' call
2100
+ var value_1 = indent + ')';
2101
+ // Inline function 'kotlin.text.appendLine' call
2102
+ $receiver.q(value_1).s(_Char___init__impl__6a9atx(10));
2103
+ }
2104
+ function copyValueExpr($this, field, baseExpr, receiver) {
2105
+ var fieldRef = escapeKotlinIdentifier(field.m());
2106
+ var baseField = baseExpr + '.' + fieldRef;
2107
+ var tmp;
2108
+ if (field instanceof Primitive_0) {
2109
+ tmp = receiver + '.' + fieldRef + '.let { gen -> if (gen == null) ' + baseField + ' else ' + wrapDrawn($this, 'gen.draw(rs)', field) + ' }';
2110
+ } else {
2111
+ if (field instanceof NestedObject) {
2112
+ tmp = nestedCopyExpr($this, field.c34_1, field.d34_1, field.e34_1, baseExpr, receiver, false);
2113
+ } else {
2114
+ if (field instanceof NestedList) {
2115
+ tmp = nestedCopyExpr($this, field.z33_1, field.a34_1, field.b34_1, baseExpr, receiver, true);
2116
+ } else {
2117
+ noWhenBranchMatchedException();
2118
+ }
2119
+ }
2120
+ }
2121
+ return tmp;
2122
+ }
2123
+ function nestedCopyExpr($this, fieldName, nestedTypeName, fields, baseExpr, receiver, isList) {
2124
+ var fieldRef = escapeKotlinIdentifier(fieldName);
2125
+ var blockRef = escapeKotlinIdentifier('_' + fieldName + 'Block');
2126
+ var baseField = baseExpr + '.' + fieldRef;
2127
+ var nestedBuilder = RecordBuilder_instance.b33(nestedTypeName);
2128
+ var nestedVar = escapeKotlinIdentifier('nested_' + fieldName);
2129
+ var elemVar = escapeKotlinIdentifier((isList ? 'elem' : 'base') + '_' + fieldName);
2130
+ var overBase = isList ? '?.map' : '?.let';
2131
+ var subs = joinToString(fields, ', ', VOID, VOID, VOID, VOID, EndpointDslFile$nestedCopyExpr$lambda(elemVar, nestedVar));
2132
+ return receiver + '.' + fieldRef + '.let { gen -> if (gen != null) gen.draw(rs) else ' + (receiver + '.' + blockRef + '?.let { block -> val ' + nestedVar + ' = ' + nestedBuilder + '().apply(block); ') + (baseField + overBase + ' { ' + elemVar + ' -> ' + elemVar + '.copy(' + subs + ') } } ?: ' + baseField + ' }');
2133
+ }
2134
+ function wrapDrawn($this, drawn, field) {
2135
+ var tmp0_elvis_lhs = field.h34_1;
2136
+ var tmp;
2137
+ if (tmp0_elvis_lhs == null) {
2138
+ return drawn;
2139
+ } else {
2140
+ tmp = tmp0_elvis_lhs;
2141
+ }
2142
+ var refined = tmp;
2143
+ return field.i34_1 && field.j34_1 ? drawn + '?.map { ' + refined + '(it) }' : field.i34_1 ? drawn + '.map { ' + refined + '(it) }' : field.j34_1 ? drawn + '?.let { ' + refined + '(it) }' : refined + '(' + drawn + ')';
2144
+ }
2145
+ function requireBodyElementType($this, $receiver) {
2146
+ var tmp0_elvis_lhs = $receiver.l33_1;
2147
+ var tmp;
2148
+ if (tmp0_elvis_lhs == null) {
2149
+ // Inline function 'kotlin.error' call
2150
+ var message = 'bodyFieldShapes present but no bodyElementType for ' + $receiver.g33_1;
2151
+ throw IllegalStateException_init_$Create$(toString(message));
2152
+ } else {
2153
+ tmp = tmp0_elvis_lhs;
2154
+ }
2155
+ return tmp;
2156
+ }
2157
+ function requireBodyPrimitiveType($this, $receiver) {
2158
+ var tmp0_elvis_lhs = $receiver.m33_1;
2159
+ var tmp;
2160
+ if (tmp0_elvis_lhs == null) {
2161
+ // Inline function 'kotlin.error' call
2162
+ var message = 'BodyKind.Primitive but no bodyPrimitiveType for ' + $receiver.g33_1;
2163
+ throw IllegalStateException_init_$Create$(toString(message));
2164
+ } else {
2165
+ tmp = tmp0_elvis_lhs;
2166
+ }
2167
+ return tmp;
2168
+ }
2169
+ function EndpointDslFile$build$lambda($kotestPkg, $shape, $endpointPkg, $present, $modelPkg, $required) {
2170
+ return function ($this$file) {
2171
+ $this$file.e17($kotestPkg);
2172
+ $this$file.s15('community.flock.wirespec.integration.kotest.dsl', 'endpointCall');
2173
+ $this$file.s15('community.flock.wirespec.integration.kotest.dsl', 'requestCall');
2174
+ $this$file.s15('community.flock.wirespec.integration.kotest.dsl', 'WirespecScenarioDsl');
2175
+ var tmp;
2176
+ // Inline function 'kotlin.collections.isNotEmpty' call
2177
+ if (!$shape.o33_1.r()) {
2178
+ $this$file.s15('community.flock.wirespec.integration.kotest.dsl', 'responseCall');
2179
+ $this$file.s15('community.flock.wirespec.integration.kotest.dsl', 'responseMock');
2180
+ tmp = Unit_instance;
2181
+ }
2182
+ var tmp_0;
2183
+ var tmp_1;
2184
+ // Inline function 'kotlin.collections.isNotEmpty' call
2185
+ if (!$shape.n33_1.r()) {
2186
+ tmp_1 = true;
2187
+ } else {
2188
+ tmp_1 = $shape.k33_1.equals(BodyKind_Primitive_getInstance());
2189
+ }
2190
+ if (tmp_1) {
2191
+ $this$file.s15('community.flock.wirespec.integration.kotest.dsl', 'draw');
2192
+ tmp_0 = Unit_instance;
2193
+ }
2194
+ $this$file.s15($endpointPkg, $shape.g33_1);
2195
+ $this$file.s15('io.kotest.property', 'Gen');
2196
+ $this$file.s15('io.kotest.property', 'Arb');
2197
+ var isListBody = $shape.k33_1.equals(BodyKind_List_getInstance());
2198
+ var tmp_2;
2199
+ var tmp_3;
2200
+ var tmp_4;
2201
+ var tmp0 = plus(plus($shape.h33_1, $shape.i33_1), $shape.j33_1);
2202
+ var tmp$ret$2;
2203
+ $l$block_0: {
2204
+ // Inline function 'kotlin.collections.any' call
2205
+ var tmp_5;
2206
+ if (isInterface(tmp0, Collection)) {
2207
+ tmp_5 = tmp0.r();
2208
+ } else {
2209
+ tmp_5 = false;
2210
+ }
2211
+ if (tmp_5) {
2212
+ tmp$ret$2 = false;
2213
+ break $l$block_0;
2214
+ }
2215
+ var _iterator__ex2g4s = tmp0.t();
2216
+ while (_iterator__ex2g4s.u()) {
2217
+ var element = _iterator__ex2g4s.v();
2218
+ if (element.s33_1) {
2219
+ tmp$ret$2 = true;
2220
+ break $l$block_0;
2221
+ }
2222
+ }
2223
+ tmp$ret$2 = false;
2224
+ }
2225
+ if (tmp$ret$2) {
2226
+ tmp_4 = true;
2227
+ } else {
2228
+ // Inline function 'kotlin.collections.isNotEmpty' call
2229
+ tmp_4 = !$present.r();
2230
+ }
2231
+ if (tmp_4) {
2232
+ tmp_3 = true;
2233
+ } else {
2234
+ tmp_3 = $shape.k33_1.equals(BodyKind_Primitive_getInstance());
2235
+ }
2236
+ if (tmp_3) {
2237
+ tmp_2 = true;
2238
+ } else {
2239
+ var tmp0_0 = $shape.o33_1;
2240
+ var tmp$ret$5;
2241
+ $l$block_2: {
2242
+ // Inline function 'kotlin.collections.any' call
2243
+ var tmp_6;
2244
+ if (isInterface(tmp0_0, Collection)) {
2245
+ tmp_6 = tmp0_0.r();
2246
+ } else {
2247
+ tmp_6 = false;
2248
+ }
2249
+ if (tmp_6) {
2250
+ tmp$ret$5 = false;
2251
+ break $l$block_2;
2252
+ }
2253
+ var _iterator__ex2g4s_0 = tmp0_0.t();
2254
+ while (_iterator__ex2g4s_0.u()) {
2255
+ var element_0 = _iterator__ex2g4s_0.v();
2256
+ var tmp_7;
2257
+ if (!(element_0.w33_1 == null)) {
2258
+ tmp_7 = true;
2259
+ } else {
2260
+ // Inline function 'kotlin.collections.isNotEmpty' call
2261
+ tmp_7 = !element_0.y33_1.r();
2262
+ }
2263
+ if (tmp_7) {
2264
+ tmp$ret$5 = true;
2265
+ break $l$block_2;
2266
+ }
2267
+ }
2268
+ tmp$ret$5 = false;
2269
+ }
2270
+ tmp_2 = tmp$ret$5;
2271
+ }
2272
+ var needsArbConstant = tmp_2;
2273
+ var tmp_8;
2274
+ if (isListBody) {
2275
+ $this$file.s15('io.kotest.property.arbitrary', 'int');
2276
+ tmp_8 = Unit_instance;
2277
+ }
2278
+ var tmp_9;
2279
+ if (needsArbConstant) {
2280
+ $this$file.s15('io.kotest.property.arbitrary', 'constant');
2281
+ tmp_9 = Unit_instance;
2282
+ }
2283
+ // Inline function 'kotlin.collections.forEach' call
2284
+ var _iterator__ex2g4s_1 = $shape.p33_1.t();
2285
+ while (_iterator__ex2g4s_1.u()) {
2286
+ var element_1 = _iterator__ex2g4s_1.v();
2287
+ $this$file.s15($modelPkg, Companion_getInstance().wt(element_1).zt());
2288
+ }
2289
+ buildGenerateWrapper(EndpointDslFile_instance, $this$file, $shape);
2290
+ $this$file.u15('generate', Custom_init_$Create$($shape.g33_1 + 'Generate'), VOID, Visibility_PUBLIC_getInstance(), Custom_init_$Create$($shape.g33_1), VOID, VOID, new FunctionCall(VOID, VOID, Companion_getInstance().wt($shape.g33_1 + 'Generate')));
2291
+ buildRequestCall(EndpointDslFile_instance, $this$file, $shape);
2292
+ var tmp_10;
2293
+ // Inline function 'kotlin.collections.isNotEmpty' call
2294
+ if (!$shape.o33_1.r()) {
2295
+ buildResponseMock(EndpointDslFile_instance, $this$file, $shape);
2296
+ tmp_10 = Unit_instance;
2297
+ }
2298
+ buildScopeClass(EndpointDslFile_instance, $this$file, $shape, $present, $required);
2299
+ // Inline function 'kotlin.collections.forEach' call
2300
+ var _iterator__ex2g4s_2 = $shape.o33_1.t();
2301
+ while (_iterator__ex2g4s_2.u()) {
2302
+ var element_2 = _iterator__ex2g4s_2.v();
2303
+ buildResponseScope(EndpointDslFile_instance, $this$file, $shape, element_2);
2304
+ }
2305
+ // Inline function 'kotlin.collections.forEach' call
2306
+ var _iterator__ex2g4s_3 = $present.t();
2307
+ while (_iterator__ex2g4s_3.u()) {
2308
+ var element_3 = _iterator__ex2g4s_3.v();
2309
+ buildSlotBuilder(EndpointDslFile_instance, $this$file, $shape, element_3);
2310
+ }
2311
+ return Unit_instance;
2312
+ };
2313
+ }
2314
+ function EndpointDslFile$buildGenerateWrapper$lambda$lambda($shape) {
2315
+ return function ($this$asyncFunction) {
2316
+ $this$asyncFunction.l13(Visibility_PUBLIC_getInstance());
2317
+ $this$asyncFunction.m13('block', suspendScopeType(EndpointDslFile_instance, $shape.g33_1 + 'Scope'));
2318
+ $this$asyncFunction.j13(arbOf_0(EndpointDslFile_instance, $shape.g33_1 + '.Request'));
2319
+ $this$asyncFunction.q13('scope', new FunctionCall(VOID, VOID, Companion_getInstance().wt($shape.g33_1 + 'Scope')));
2320
+ $this$asyncFunction.a14('block', VariableReference_init_$Create$('scope'));
2321
+ $this$asyncFunction.p13(new FunctionCall(VariableReference_init_$Create$('scope'), VOID, Companion_getInstance().wt('buildRequest')));
2322
+ return Unit_instance;
2323
+ };
2324
+ }
2325
+ function EndpointDslFile$buildGenerateWrapper$lambda$lambda_0($scopeName, $shape, $variant) {
2326
+ return function ($this$function) {
2327
+ $this$function.l13(Visibility_PUBLIC_getInstance());
2328
+ $this$function.o13('block', blockType(EndpointDslFile_instance, $scopeName), $this$function.t14('{}'));
2329
+ $this$function.j13(arbOf_0(EndpointDslFile_instance, $shape.g33_1 + '.' + $variant.u33_1));
2330
+ $this$function.p13($this$function.t14($scopeName + '().apply(block).build()'));
2331
+ return Unit_instance;
2332
+ };
2333
+ }
2334
+ function EndpointDslFile$buildGenerateWrapper$lambda($shape) {
2335
+ return function ($this$struct) {
2336
+ $this$struct.h15();
2337
+ $this$struct.l13(Visibility_PUBLIC_getInstance());
2338
+ $this$struct.i15(Visibility_INTERNAL_getInstance());
2339
+ $this$struct.a16('request', VOID, VOID, EndpointDslFile$buildGenerateWrapper$lambda$lambda($shape));
2340
+ // Inline function 'kotlin.collections.forEach' call
2341
+ var _iterator__ex2g4s = $shape.o33_1.t();
2342
+ while (_iterator__ex2g4s.u()) {
2343
+ var element = _iterator__ex2g4s.v();
2344
+ var scopeName = $shape.g33_1 + element.u33_1 + 'Scope';
2345
+ var tmp = 'response' + element.t33_1;
2346
+ $this$struct.w15(tmp, VOID, VOID, EndpointDslFile$buildGenerateWrapper$lambda$lambda_0(scopeName, $shape, element));
2347
+ }
2348
+ return Unit_instance;
2349
+ };
2350
+ }
2351
+ function EndpointDslFile$buildRequestCall$lambda($shape) {
2352
+ return function ($this$asyncFunction) {
2353
+ $this$asyncFunction.l13(Visibility_PUBLIC_getInstance());
2354
+ $this$asyncFunction.k13(genOf_0(EndpointDslFile_instance, $shape.g33_1 + '.Request'));
2355
+ $this$asyncFunction.j13(Custom_init_$Create$($shape.g33_1 + '.Response<*>'));
2356
+ $this$asyncFunction.p13($this$asyncFunction.t14('requestCall(' + $shape.g33_1 + '.api, ' + $shape.g33_1 + ', this)'));
2357
+ return Unit_instance;
2358
+ };
2359
+ }
2360
+ function EndpointDslFile$buildResponseMock$lambda($shape) {
2361
+ return function ($this$asyncFunction) {
2362
+ $this$asyncFunction.l13(Visibility_PUBLIC_getInstance());
2363
+ $this$asyncFunction.k13(genOf_0(EndpointDslFile_instance, $shape.g33_1 + '.Response<*>'));
2364
+ $this$asyncFunction.m13('predicate', new Function_0(listOf(Custom_init_$Create$($shape.g33_1 + '.Request')), Boolean_instance));
2365
+ $this$asyncFunction.j13(Unit_instance_0);
2366
+ $this$asyncFunction.p13($this$asyncFunction.t14('responseMock(' + $shape.g33_1 + '.api, this, predicate)'));
2367
+ return Unit_instance;
2368
+ };
2369
+ }
2370
+ function EndpointDslFile$buildResponseScope$lambda$lambda($variantType, $bodyType, $variant) {
2371
+ return function ($this$function) {
2372
+ $this$function.l13(Visibility_PUBLIC_getInstance());
2373
+ $this$function.j13(arbOf_0(EndpointDslFile_instance, $variantType));
2374
+ var tmp;
2375
+ if (!($bodyType == null)) {
2376
+ $this$function.i14('body?.let { inner.body(it) }');
2377
+ tmp = Unit_instance;
2378
+ }
2379
+ // Inline function 'kotlin.collections.forEach' call
2380
+ var _iterator__ex2g4s = $variant.y33_1.t();
2381
+ while (_iterator__ex2g4s.u()) {
2382
+ var element = _iterator__ex2g4s.v();
2383
+ $this$function.i14(escapeKotlinIdentifier(element.q33_1) + '?.let { inner.headerGen("' + element.q33_1 + '", it) }');
2384
+ }
2385
+ $this$function.i14('@Suppress("UNCHECKED_CAST")');
2386
+ $this$function.p13($this$function.v14(new FunctionCall(VariableReference_init_$Create$('inner'), VOID, Companion_getInstance().wt('buildGen')), arbOf_0(EndpointDslFile_instance, $variantType)));
2387
+ return Unit_instance;
2388
+ };
2389
+ }
2390
+ function EndpointDslFile$buildResponseScope$lambda($shape, $variantType, $bodyType, $variant) {
2391
+ return function ($this$struct) {
2392
+ $this$struct.h15();
2393
+ $this$struct.g15('@WirespecScenarioDsl');
2394
+ $this$struct.l13(Visibility_PUBLIC_getInstance());
2395
+ $this$struct.i15(Visibility_INTERNAL_getInstance());
2396
+ $this$struct.i14('private val inner = responseCall(' + $shape.g33_1 + ', ' + $variantType + '::class)');
2397
+ var tmp;
2398
+ if (!($bodyType == null)) {
2399
+ $this$struct.u15('body', genNullableOf(EndpointDslFile_instance, $bodyType), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $this$struct.t14('null'));
2400
+ valueSetter($this$struct, 'body', $bodyType);
2401
+ tmp = Unit_instance;
2402
+ }
2403
+ // Inline function 'kotlin.collections.forEach' call
2404
+ var _iterator__ex2g4s = $variant.y33_1.t();
2405
+ while (_iterator__ex2g4s.u()) {
2406
+ var element = _iterator__ex2g4s.v();
2407
+ $this$struct.u15(element.q33_1, genNullableOf(EndpointDslFile_instance, element.r33_1), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $this$struct.t14('null'));
2408
+ valueSetter($this$struct, element.q33_1, element.r33_1);
2409
+ }
2410
+ $this$struct.w15('build', VOID, VOID, EndpointDslFile$buildResponseScope$lambda$lambda($variantType, $bodyType, $variant));
2411
+ return Unit_instance;
2412
+ };
2413
+ }
2414
+ function EndpointDslFile$buildScopeClass$lambda$lambda($builderClass, $slot) {
2415
+ return function ($this$function) {
2416
+ $this$function.l13(Visibility_PUBLIC_getInstance());
2417
+ $this$function.m13('block', blockType(EndpointDslFile_instance, $builderClass));
2418
+ $this$function.i14('this.' + $slot.d33_1 + ' = block');
2419
+ return Unit_instance;
2420
+ };
2421
+ }
2422
+ function EndpointDslFile$buildScopeClass$lambda$lambda_0($builderName) {
2423
+ return function ($this$function) {
2424
+ $this$function.l13(Visibility_PUBLIC_getInstance());
2425
+ $this$function.m13('block', blockType(EndpointDslFile_instance, $builderName));
2426
+ $this$function.i14('this.body = block');
2427
+ return Unit_instance;
2428
+ };
2429
+ }
2430
+ function EndpointDslFile$buildScopeClass$lambda$lambda_1($shape, $present, $required) {
2431
+ return function ($this$function) {
2432
+ $this$function.l13(Visibility_PRIVATE_getInstance());
2433
+ // Inline function 'kotlin.text.trimEnd' call
2434
+ var this_0 = renderFlushBody(EndpointDslFile_instance, $shape, $present, $required);
2435
+ var tmp$ret$0 = toString(trimEnd(isCharSequence(this_0) ? this_0 : THROW_CCE()));
2436
+ $this$function.i14(tmp$ret$0);
2437
+ return Unit_instance;
2438
+ };
2439
+ }
2440
+ function EndpointDslFile$buildScopeClass$lambda$lambda_2($shape) {
2441
+ return function ($this$function) {
2442
+ $this$function.l13(Visibility_PUBLIC_getInstance());
2443
+ $this$function.j13(arbOf_0(EndpointDslFile_instance, $shape.g33_1 + '.Request'));
2444
+ $this$function.i14('flush()');
2445
+ $this$function.p13($this$function.t14('inner.buildRequestGen()'));
2446
+ return Unit_instance;
2447
+ };
2448
+ }
2449
+ function EndpointDslFile$buildScopeClass$lambda($shape, $present, $required) {
2450
+ return function ($this$struct) {
2451
+ $this$struct.h15();
2452
+ $this$struct.g15('@WirespecScenarioDsl');
2453
+ $this$struct.l13(Visibility_PUBLIC_getInstance());
2454
+ $this$struct.i15(Visibility_INTERNAL_getInstance());
2455
+ $this$struct.i14('private val inner = endpointCall(' + $shape.g33_1 + '.api, ' + $shape.g33_1 + ')');
2456
+ // Inline function 'kotlin.collections.forEach' call
2457
+ var _iterator__ex2g4s = $present.t();
2458
+ while (_iterator__ex2g4s.u()) {
2459
+ var element = _iterator__ex2g4s.v();
2460
+ var builderClass = slotBuilderName(EndpointDslFile_instance, $shape, element);
2461
+ $this$struct.u15(element.d33_1, new Nullable(blockType(EndpointDslFile_instance, builderClass)), true, Visibility_PRIVATE_getInstance(), VOID, VOID, $this$struct.t14('null'));
2462
+ $this$struct.w15(element.d33_1, VOID, VOID, EndpointDslFile$buildScopeClass$lambda$lambda(builderClass, element));
2463
+ }
2464
+ var tmp;
2465
+ // Inline function 'kotlin.collections.isNotEmpty' call
2466
+ if (!$shape.n33_1.r()) {
2467
+ var builderName = RecordBuilder_instance.b33(requireBodyElementType(EndpointDslFile_instance, $shape));
2468
+ $this$struct.u15('body', new Nullable(blockType(EndpointDslFile_instance, builderName)), true, Visibility_PRIVATE_getInstance(), VOID, VOID, $this$struct.t14('null'));
2469
+ $this$struct.w15('body', VOID, VOID, EndpointDslFile$buildScopeClass$lambda$lambda_0(builderName));
2470
+ var tmp_0;
2471
+ if ($shape.k33_1.equals(BodyKind_List_getInstance())) {
2472
+ $this$struct.u15('bodyCount', Custom_init_$Create$('IntRange'), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $this$struct.t14('1..3'));
2473
+ tmp_0 = Unit_instance;
2474
+ }
2475
+ tmp = tmp_0;
2476
+ }
2477
+ var tmp_1;
2478
+ if ($shape.k33_1.equals(BodyKind_Primitive_getInstance())) {
2479
+ var bodyType = requireBodyPrimitiveType(EndpointDslFile_instance, $shape);
2480
+ $this$struct.u15('body', genNullableOf(EndpointDslFile_instance, bodyType), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $this$struct.t14('null'));
2481
+ valueSetter($this$struct, 'body', bodyType);
2482
+ tmp_1 = Unit_instance;
2483
+ }
2484
+ $this$struct.u15('flushed', Boolean_instance, true, Visibility_PRIVATE_getInstance(), VOID, VOID, $this$struct.t14('false'));
2485
+ $this$struct.w15('flush', VOID, VOID, EndpointDslFile$buildScopeClass$lambda$lambda_1($shape, $present, $required));
2486
+ $this$struct.w15('buildRequest', VOID, VOID, EndpointDslFile$buildScopeClass$lambda$lambda_2($shape));
2487
+ return Unit_instance;
2488
+ };
2489
+ }
2490
+ function EndpointDslFile$buildSlotBuilder$lambda($slot) {
2491
+ return function ($this$struct) {
2492
+ $this$struct.h15();
2493
+ $this$struct.g15('@WirespecScenarioDsl');
2494
+ $this$struct.l13(Visibility_PUBLIC_getInstance());
2495
+ // Inline function 'kotlin.collections.forEach' call
2496
+ var _iterator__ex2g4s = $slot.f33_1.t();
2497
+ while (_iterator__ex2g4s.u()) {
2498
+ var element = _iterator__ex2g4s.v();
2499
+ $this$struct.u15(element.q33_1, genNullableOf(EndpointDslFile_instance, element.r33_1), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $this$struct.t14('null'));
2500
+ valueSetter($this$struct, element.q33_1, element.r33_1);
2501
+ }
2502
+ return Unit_instance;
2503
+ };
2504
+ }
2505
+ function EndpointDslFile$nestedCopyExpr$lambda($elemVar, $nestedVar) {
2506
+ return function (it) {
2507
+ return escapeKotlinIdentifier(it.m()) + ' = ' + copyValueExpr(EndpointDslFile_instance, it, $elemVar, $nestedVar);
2508
+ };
2509
+ }
2510
+ function EndpointDslFile() {
2511
+ }
2512
+ protoOf(EndpointDslFile).k34 = function (endpoint, packageName, types, refined) {
2513
+ var shape = Companion_instance_4.l34(endpoint, types, refined);
2514
+ var present = presentSlots(this, shape);
2515
+ var required = requiredSlots(this, shape);
2516
+ var kotestPkg = packageName.bt_1 + '.kotest';
2517
+ var endpointPkg = packageName.bt_1 + '.endpoint';
2518
+ var modelPkg = packageName.bt_1 + '.model';
2519
+ var fileName = Companion_instance_0.at(kotestPkg).dt() + (shape.g33_1 + 'Dsl');
2520
+ var tmp = Companion_getInstance().wt(fileName);
2521
+ return file(tmp, EndpointDslFile$build$lambda(kotestPkg, shape, endpointPkg, present, modelPkg, required));
2522
+ };
2523
+ var EndpointDslFile_instance;
2524
+ function EndpointDslFile_getInstance() {
2525
+ return EndpointDslFile_instance;
2526
+ }
2527
+ var BodyKind_None_instance;
2528
+ var BodyKind_Object_instance;
2529
+ var BodyKind_List_instance;
2530
+ var BodyKind_Primitive_instance;
2531
+ var BodyKind_entriesInitialized;
2532
+ function BodyKind_initEntries() {
2533
+ if (BodyKind_entriesInitialized)
2534
+ return Unit_instance;
2535
+ BodyKind_entriesInitialized = true;
2536
+ BodyKind_None_instance = new BodyKind('None', 0);
2537
+ BodyKind_Object_instance = new BodyKind('Object', 1);
2538
+ BodyKind_List_instance = new BodyKind('List', 2);
2539
+ BodyKind_Primitive_instance = new BodyKind('Primitive', 3);
2540
+ }
2541
+ function Primitive_0(name, type, refinedTypeName, isList, isNullable) {
2542
+ refinedTypeName = refinedTypeName === VOID ? null : refinedTypeName;
2543
+ isList = isList === VOID ? false : isList;
2544
+ isNullable = isNullable === VOID ? false : isNullable;
2545
+ this.f34_1 = name;
2546
+ this.g34_1 = type;
2547
+ this.h34_1 = refinedTypeName;
2548
+ this.i34_1 = isList;
2549
+ this.j34_1 = isNullable;
2550
+ }
2551
+ protoOf(Primitive_0).m = function () {
2552
+ return this.f34_1;
2553
+ };
2554
+ protoOf(Primitive_0).toString = function () {
2555
+ return 'Primitive(name=' + this.f34_1 + ', type=' + toString(this.g34_1) + ', refinedTypeName=' + this.h34_1 + ', isList=' + this.i34_1 + ', isNullable=' + this.j34_1 + ')';
2556
+ };
2557
+ protoOf(Primitive_0).hashCode = function () {
2558
+ var result = getStringHashCode(this.f34_1);
2559
+ result = imul(result, 31) + hashCode(this.g34_1) | 0;
2560
+ result = imul(result, 31) + (this.h34_1 == null ? 0 : getStringHashCode(this.h34_1)) | 0;
2561
+ result = imul(result, 31) + getBooleanHashCode(this.i34_1) | 0;
2562
+ result = imul(result, 31) + getBooleanHashCode(this.j34_1) | 0;
2563
+ return result;
2564
+ };
2565
+ protoOf(Primitive_0).equals = function (other) {
2566
+ if (this === other)
2567
+ return true;
2568
+ if (!(other instanceof Primitive_0))
2569
+ return false;
2570
+ if (!(this.f34_1 === other.f34_1))
2571
+ return false;
2572
+ if (!equals(this.g34_1, other.g34_1))
2573
+ return false;
2574
+ if (!(this.h34_1 == other.h34_1))
2575
+ return false;
2576
+ if (!(this.i34_1 === other.i34_1))
2577
+ return false;
2578
+ if (!(this.j34_1 === other.j34_1))
2579
+ return false;
2580
+ return true;
2581
+ };
2582
+ function NestedObject(name, typeName, fields) {
2583
+ this.c34_1 = name;
2584
+ this.d34_1 = typeName;
2585
+ this.e34_1 = fields;
2586
+ }
2587
+ protoOf(NestedObject).m = function () {
2588
+ return this.c34_1;
2589
+ };
2590
+ protoOf(NestedObject).toString = function () {
2591
+ return 'NestedObject(name=' + this.c34_1 + ', typeName=' + this.d34_1 + ', fields=' + toString(this.e34_1) + ')';
2592
+ };
2593
+ protoOf(NestedObject).hashCode = function () {
2594
+ var result = getStringHashCode(this.c34_1);
2595
+ result = imul(result, 31) + getStringHashCode(this.d34_1) | 0;
2596
+ result = imul(result, 31) + hashCode(this.e34_1) | 0;
2597
+ return result;
2598
+ };
2599
+ protoOf(NestedObject).equals = function (other) {
2600
+ if (this === other)
2601
+ return true;
2602
+ if (!(other instanceof NestedObject))
2603
+ return false;
2604
+ if (!(this.c34_1 === other.c34_1))
2605
+ return false;
2606
+ if (!(this.d34_1 === other.d34_1))
2607
+ return false;
2608
+ if (!equals(this.e34_1, other.e34_1))
2609
+ return false;
2610
+ return true;
2611
+ };
2612
+ function NestedList(name, elementTypeName, fields) {
2613
+ this.z33_1 = name;
2614
+ this.a34_1 = elementTypeName;
2615
+ this.b34_1 = fields;
2616
+ }
2617
+ protoOf(NestedList).m = function () {
2618
+ return this.z33_1;
2619
+ };
2620
+ protoOf(NestedList).toString = function () {
2621
+ return 'NestedList(name=' + this.z33_1 + ', elementTypeName=' + this.a34_1 + ', fields=' + toString(this.b34_1) + ')';
2622
+ };
2623
+ protoOf(NestedList).hashCode = function () {
2624
+ var result = getStringHashCode(this.z33_1);
2625
+ result = imul(result, 31) + getStringHashCode(this.a34_1) | 0;
2626
+ result = imul(result, 31) + hashCode(this.b34_1) | 0;
2627
+ return result;
2628
+ };
2629
+ protoOf(NestedList).equals = function (other) {
2630
+ if (this === other)
2631
+ return true;
2632
+ if (!(other instanceof NestedList))
2633
+ return false;
2634
+ if (!(this.z33_1 === other.z33_1))
2635
+ return false;
2636
+ if (!(this.a34_1 === other.a34_1))
2637
+ return false;
2638
+ if (!equals(this.b34_1, other.b34_1))
2639
+ return false;
2640
+ return true;
2641
+ };
2642
+ function classifyBody($this, reference) {
2643
+ var tmp;
2644
+ var tmp_0;
2645
+ if (reference == null) {
2646
+ tmp_0 = true;
2647
+ } else {
2648
+ tmp_0 = reference instanceof Unit;
2649
+ }
2650
+ if (tmp_0) {
2651
+ tmp = to(BodyKind_None_getInstance(), null);
2652
+ } else {
2653
+ if (reference instanceof Custom) {
2654
+ tmp = to(BodyKind_Object_getInstance(), reference.n19_1);
2655
+ } else {
2656
+ if (reference instanceof Iterable) {
2657
+ var tmp_1 = reference.yp_1;
2658
+ var tmp1_safe_receiver = tmp_1 instanceof Custom ? tmp_1 : null;
2659
+ var tmp_2;
2660
+ if (tmp1_safe_receiver == null) {
2661
+ tmp_2 = null;
2662
+ } else {
2663
+ // Inline function 'kotlin.let' call
2664
+ tmp_2 = to(BodyKind_List_getInstance(), tmp1_safe_receiver.n19_1);
2665
+ }
2666
+ var tmp2_elvis_lhs = tmp_2;
2667
+ tmp = tmp2_elvis_lhs == null ? to(BodyKind_None_getInstance(), null) : tmp2_elvis_lhs;
2668
+ } else {
2669
+ if (reference instanceof Primitive) {
2670
+ tmp = to(BodyKind_Primitive_getInstance(), null);
2671
+ } else {
2672
+ tmp = to(BodyKind_None_getInstance(), null);
2673
+ }
2674
+ }
2675
+ }
2676
+ }
2677
+ return tmp;
2678
+ }
2679
+ function collectCustomNames($this, reference) {
2680
+ var tmp;
2681
+ if (reference instanceof Custom) {
2682
+ tmp = listOf(reference.n19_1);
2683
+ } else {
2684
+ if (reference instanceof Iterable) {
2685
+ tmp = collectCustomNames($this, reference.yp_1);
2686
+ } else {
2687
+ if (reference instanceof Dict) {
2688
+ tmp = collectCustomNames($this, reference.bq_1);
2689
+ } else {
2690
+ tmp = emptyList();
2691
+ }
2692
+ }
2693
+ }
2694
+ return tmp;
2695
+ }
2696
+ function _get_nestedTypeName__7gbrsh($this, $receiver) {
2697
+ var tmp;
2698
+ if ($receiver instanceof NestedObject) {
2699
+ tmp = $receiver.d34_1;
2700
+ } else {
2701
+ if ($receiver instanceof NestedList) {
2702
+ tmp = $receiver.a34_1;
2703
+ } else {
2704
+ if ($receiver instanceof Primitive_0) {
2705
+ tmp = null;
2706
+ } else {
2707
+ noWhenBranchMatchedException();
2708
+ }
2709
+ }
2710
+ }
2711
+ return tmp;
2712
+ }
2713
+ function _get_childFields__pje2ws($this, $receiver) {
2714
+ var tmp;
2715
+ if ($receiver instanceof NestedObject) {
2716
+ tmp = $receiver.e34_1;
2717
+ } else {
2718
+ if ($receiver instanceof NestedList) {
2719
+ tmp = $receiver.b34_1;
2720
+ } else {
2721
+ if ($receiver instanceof Primitive_0) {
2722
+ tmp = emptyList();
2723
+ } else {
2724
+ noWhenBranchMatchedException();
2725
+ }
2726
+ }
2727
+ }
2728
+ return tmp;
2729
+ }
2730
+ function collectNestedTypeNames($this, fields) {
2731
+ // Inline function 'kotlin.collections.flatMap' call
2732
+ // Inline function 'kotlin.collections.flatMapTo' call
2733
+ var destination = ArrayList_init_$Create$();
2734
+ var _iterator__ex2g4s = fields.t();
2735
+ while (_iterator__ex2g4s.u()) {
2736
+ var element = _iterator__ex2g4s.v();
2737
+ var list = plus(listOfNotNull(_get_nestedTypeName__7gbrsh(Companion_instance_4, element)), collectNestedTypeNames(Companion_instance_4, _get_childFields__pje2ws(Companion_instance_4, element)));
2738
+ addAll(destination, list);
2739
+ }
2740
+ return destination;
2741
+ }
2742
+ function collectFieldTypeNames($this, fields, types) {
2743
+ // Inline function 'kotlin.collections.flatMap' call
2744
+ // Inline function 'kotlin.collections.flatMapTo' call
2745
+ var destination = ArrayList_init_$Create$();
2746
+ var _iterator__ex2g4s = fields.t();
2747
+ while (_iterator__ex2g4s.u()) {
2748
+ var element = _iterator__ex2g4s.v();
2749
+ var tmp0_safe_receiver = _get_nestedTypeName__7gbrsh(Companion_instance_4, element);
2750
+ var tmp;
2751
+ if (tmp0_safe_receiver == null) {
2752
+ tmp = null;
2753
+ } else {
2754
+ // Inline function 'kotlin.let' call
2755
+ var tmp0_safe_receiver_0 = types.s2(tmp0_safe_receiver);
2756
+ var tmp1_safe_receiver = tmp0_safe_receiver_0 == null ? null : tmp0_safe_receiver_0.lp_1;
2757
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : get_fields(tmp1_safe_receiver);
2758
+ var tmp_0;
2759
+ if (tmp2_safe_receiver == null) {
2760
+ tmp_0 = null;
2761
+ } else {
2762
+ // Inline function 'kotlin.collections.flatMap' call
2763
+ // Inline function 'kotlin.collections.flatMapTo' call
2764
+ var destination_0 = ArrayList_init_$Create$();
2765
+ var _iterator__ex2g4s_0 = tmp2_safe_receiver.t();
2766
+ while (_iterator__ex2g4s_0.u()) {
2767
+ var element_0 = _iterator__ex2g4s_0.v();
2768
+ var list = collectCustomNames(Companion_instance_4, element_0.pp_1);
2769
+ addAll(destination_0, list);
2770
+ }
2771
+ tmp_0 = destination_0;
2772
+ }
2773
+ tmp = tmp_0;
2774
+ }
2775
+ var tmp1_elvis_lhs = tmp;
2776
+ var nestedFieldRefs = tmp1_elvis_lhs == null ? emptyList() : tmp1_elvis_lhs;
2777
+ var list_0 = plus(nestedFieldRefs, collectFieldTypeNames(Companion_instance_4, _get_childFields__pje2ws(Companion_instance_4, element), types));
2778
+ addAll(destination, list_0);
2779
+ }
2780
+ return destination;
2781
+ }
2782
+ function primitiveOf($this, name, ref, refined) {
2783
+ var tmp;
2784
+ var tmp_0;
2785
+ if (ref instanceof Custom) {
2786
+ // Inline function 'kotlin.collections.contains' call
2787
+ // Inline function 'kotlin.collections.containsKey' call
2788
+ var key = ref.n19_1;
2789
+ tmp_0 = (isInterface(refined, KtMap) ? refined : THROW_CCE()).q2(key);
2790
+ } else {
2791
+ tmp_0 = false;
2792
+ }
2793
+ if (tmp_0) {
2794
+ tmp = to(ref.n19_1, false);
2795
+ } else {
2796
+ if (ref instanceof Iterable) {
2797
+ var inner = ref.yp_1;
2798
+ var tmp_1;
2799
+ var tmp_2;
2800
+ if (inner instanceof Custom) {
2801
+ // Inline function 'kotlin.collections.contains' call
2802
+ // Inline function 'kotlin.collections.containsKey' call
2803
+ var key_0 = inner.n19_1;
2804
+ tmp_2 = (isInterface(refined, KtMap) ? refined : THROW_CCE()).q2(key_0);
2805
+ } else {
2806
+ tmp_2 = false;
2807
+ }
2808
+ if (tmp_2) {
2809
+ tmp_1 = to(inner.n19_1, true);
2810
+ } else {
2811
+ tmp_1 = to(null, false);
2812
+ }
2813
+ tmp = tmp_1;
2814
+ } else {
2815
+ tmp = to(null, false);
2816
+ }
2817
+ }
2818
+ var _destruct__k2r9zo = tmp;
2819
+ var refinedTypeName = _destruct__k2r9zo.ze();
2820
+ var isList = _destruct__k2r9zo.af();
2821
+ return new Primitive_0(name, mapWithRefinedUnwrap($this, ref, refined), refinedTypeName, isList, ref.ot());
2822
+ }
2823
+ function mapWithRefinedUnwrap($this, reference, refined) {
2824
+ var tmp;
2825
+ if (reference instanceof Custom) {
2826
+ var tmp1_safe_receiver = refined.s2(reference.n19_1);
2827
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.ms_1;
2828
+ var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.v1e(VOID, reference.o19_1);
2829
+ var tmp4_elvis_lhs = tmp3_safe_receiver == null ? null : convert(tmp3_safe_receiver);
2830
+ tmp = tmp4_elvis_lhs == null ? convert(reference) : tmp4_elvis_lhs;
2831
+ } else {
2832
+ if (reference instanceof Iterable) {
2833
+ // Inline function 'kotlin.let' call
2834
+ var it = new Array_0(mapWithRefinedUnwrap($this, reference.yp_1, refined));
2835
+ tmp = reference.zp_1 ? new Nullable(it) : it;
2836
+ } else {
2837
+ if (reference instanceof Dict) {
2838
+ // Inline function 'kotlin.let' call
2839
+ var it_0 = new Dict_0(String_instance, mapWithRefinedUnwrap($this, reference.bq_1, refined));
2840
+ tmp = reference.cq_1 ? new Nullable(it_0) : it_0;
2841
+ } else {
2842
+ tmp = convert(reference);
2843
+ }
2844
+ }
2845
+ }
2846
+ return tmp;
2847
+ }
2848
+ function NamedTypedField(name, type, isNullable) {
2849
+ isNullable = isNullable === VOID ? false : isNullable;
2850
+ this.q33_1 = name;
2851
+ this.r33_1 = type;
2852
+ this.s33_1 = isNullable;
2853
+ }
2854
+ protoOf(NamedTypedField).toString = function () {
2855
+ return 'NamedTypedField(name=' + this.q33_1 + ', type=' + toString(this.r33_1) + ', isNullable=' + this.s33_1 + ')';
2856
+ };
2857
+ protoOf(NamedTypedField).hashCode = function () {
2858
+ var result = getStringHashCode(this.q33_1);
2859
+ result = imul(result, 31) + hashCode(this.r33_1) | 0;
2860
+ result = imul(result, 31) + getBooleanHashCode(this.s33_1) | 0;
2861
+ return result;
2862
+ };
2863
+ protoOf(NamedTypedField).equals = function (other) {
2864
+ if (this === other)
2865
+ return true;
2866
+ if (!(other instanceof NamedTypedField))
2867
+ return false;
2868
+ if (!(this.q33_1 === other.q33_1))
2869
+ return false;
2870
+ if (!equals(this.r33_1, other.r33_1))
2871
+ return false;
2872
+ if (!(this.s33_1 === other.s33_1))
2873
+ return false;
2874
+ return true;
2875
+ };
2876
+ function ResponseVariantShape(status, className, bodyKind, bodyType, bodyElementType, headerFields) {
2877
+ this.t33_1 = status;
2878
+ this.u33_1 = className;
2879
+ this.v33_1 = bodyKind;
2880
+ this.w33_1 = bodyType;
2881
+ this.x33_1 = bodyElementType;
2882
+ this.y33_1 = headerFields;
2883
+ }
2884
+ protoOf(ResponseVariantShape).toString = function () {
2885
+ return 'ResponseVariantShape(status=' + this.t33_1 + ', className=' + this.u33_1 + ', bodyKind=' + this.v33_1.toString() + ', bodyType=' + toString_1(this.w33_1) + ', bodyElementType=' + this.x33_1 + ', headerFields=' + toString(this.y33_1) + ')';
2886
+ };
2887
+ protoOf(ResponseVariantShape).hashCode = function () {
2888
+ var result = getStringHashCode(this.t33_1);
2889
+ result = imul(result, 31) + getStringHashCode(this.u33_1) | 0;
2890
+ result = imul(result, 31) + this.v33_1.hashCode() | 0;
2891
+ result = imul(result, 31) + (this.w33_1 == null ? 0 : hashCode(this.w33_1)) | 0;
2892
+ result = imul(result, 31) + (this.x33_1 == null ? 0 : getStringHashCode(this.x33_1)) | 0;
2893
+ result = imul(result, 31) + hashCode(this.y33_1) | 0;
2894
+ return result;
2895
+ };
2896
+ protoOf(ResponseVariantShape).equals = function (other) {
2897
+ if (this === other)
2898
+ return true;
2899
+ if (!(other instanceof ResponseVariantShape))
2900
+ return false;
2901
+ if (!(this.t33_1 === other.t33_1))
2902
+ return false;
2903
+ if (!(this.u33_1 === other.u33_1))
2904
+ return false;
2905
+ if (!this.v33_1.equals(other.v33_1))
2906
+ return false;
2907
+ if (!equals(this.w33_1, other.w33_1))
2908
+ return false;
2909
+ if (!(this.x33_1 == other.x33_1))
2910
+ return false;
2911
+ if (!equals(this.y33_1, other.y33_1))
2912
+ return false;
2913
+ return true;
2914
+ };
2915
+ function BodyKind(name, ordinal) {
2916
+ Enum.call(this, name, ordinal);
2917
+ }
2918
+ function Companion_2() {
2919
+ }
2920
+ protoOf(Companion_2).l34 = function (endpoint, types, refined) {
2921
+ // Inline function 'kotlin.collections.filterIsInstance' call
2922
+ var tmp0 = endpoint.hr_1;
2923
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
2924
+ var destination = ArrayList_init_$Create$();
2925
+ var _iterator__ex2g4s = tmp0.t();
2926
+ while (_iterator__ex2g4s.u()) {
2927
+ var element = _iterator__ex2g4s.v();
2928
+ if (element instanceof Param) {
2929
+ destination.x(element);
2930
+ }
2931
+ }
2932
+ // Inline function 'kotlin.collections.map' call
2933
+ // Inline function 'kotlin.collections.mapTo' call
2934
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination, 10));
2935
+ var _iterator__ex2g4s_0 = destination.t();
2936
+ while (_iterator__ex2g4s_0.u()) {
2937
+ var item = _iterator__ex2g4s_0.v();
2938
+ var tmp$ret$4 = new NamedTypedField(item.mr_1.o1(), convert(item.nr_1), item.nr_1.ot());
2939
+ destination_0.x(tmp$ret$4);
2940
+ }
2941
+ var pathFields = destination_0;
2942
+ // Inline function 'kotlin.collections.map' call
2943
+ var this_0 = get_fields(endpoint.ir_1);
2944
+ // Inline function 'kotlin.collections.mapTo' call
2945
+ var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
2946
+ var _iterator__ex2g4s_1 = this_0.t();
2947
+ while (_iterator__ex2g4s_1.u()) {
2948
+ var item_0 = _iterator__ex2g4s_1.v();
2949
+ var tmp$ret$7 = new NamedTypedField(item_0.op_1.o1(), convert(item_0.pp_1), item_0.pp_1.ot());
2950
+ destination_1.x(tmp$ret$7);
2951
+ }
2952
+ var queryFields = destination_1;
2953
+ // Inline function 'kotlin.collections.map' call
2954
+ var this_1 = get_fields(endpoint.jr_1);
2955
+ // Inline function 'kotlin.collections.mapTo' call
2956
+ var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
2957
+ var _iterator__ex2g4s_2 = this_1.t();
2958
+ while (_iterator__ex2g4s_2.u()) {
2959
+ var item_1 = _iterator__ex2g4s_2.v();
2960
+ var tmp$ret$10 = new NamedTypedField(item_1.op_1.o1(), convert(item_1.pp_1), item_1.pp_1.ot());
2961
+ destination_2.x(tmp$ret$10);
2962
+ }
2963
+ var headerFields = destination_2;
2964
+ var tmp0_safe_receiver = firstOrNull_0(endpoint.kr_1);
2965
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.or_1;
2966
+ var bodyRef = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.qr_1;
2967
+ var _destruct__k2r9zo = classifyBody(this, bodyRef);
2968
+ var bodyKind = _destruct__k2r9zo.ze();
2969
+ var bodyElementType = _destruct__k2r9zo.af();
2970
+ var tmp;
2971
+ if (bodyRef == null) {
2972
+ tmp = null;
2973
+ } else {
2974
+ // Inline function 'kotlin.takeIf' call
2975
+ var tmp_0;
2976
+ if (bodyKind.equals(BodyKind_Primitive_getInstance())) {
2977
+ tmp_0 = bodyRef;
2978
+ } else {
2979
+ tmp_0 = null;
2980
+ }
2981
+ tmp = tmp_0;
2982
+ }
2983
+ var tmp3_safe_receiver = tmp;
2984
+ var tmp4_safe_receiver = tmp3_safe_receiver == null ? null : convert(tmp3_safe_receiver);
2985
+ var tmp_1;
2986
+ if (tmp4_safe_receiver == null) {
2987
+ tmp_1 = null;
2988
+ } else {
2989
+ // Inline function 'kotlin.let' call
2990
+ var tmp_2;
2991
+ if (tmp4_safe_receiver instanceof Nullable) {
2992
+ tmp_2 = tmp4_safe_receiver.uu_1;
2993
+ } else {
2994
+ tmp_2 = tmp4_safe_receiver;
2995
+ }
2996
+ tmp_1 = tmp_2;
2997
+ }
2998
+ var bodyPrimitiveType = tmp_1;
2999
+ var tmp_3;
3000
+ if (bodyElementType == null) {
3001
+ tmp_3 = null;
3002
+ } else {
3003
+ // Inline function 'kotlin.let' call
3004
+ tmp_3 = Companion_instance_4.u32(bodyElementType, types, refined, emptySet());
3005
+ }
3006
+ var tmp6_elvis_lhs = tmp_3;
3007
+ var bodyFieldShapes = tmp6_elvis_lhs == null ? emptyList() : tmp6_elvis_lhs;
3008
+ // Inline function 'kotlin.collections.mapNotNull' call
3009
+ var tmp0_0 = endpoint.lr_1;
3010
+ // Inline function 'kotlin.collections.mapNotNullTo' call
3011
+ var destination_3 = ArrayList_init_$Create$();
3012
+ // Inline function 'kotlin.collections.forEach' call
3013
+ var _iterator__ex2g4s_3 = tmp0_0.t();
3014
+ while (_iterator__ex2g4s_3.u()) {
3015
+ var element_0 = _iterator__ex2g4s_3.v();
3016
+ var tmp$ret$21;
3017
+ $l$block_0: {
3018
+ // Inline function 'kotlin.takeIf' call
3019
+ var this_2 = element_0.rr_1;
3020
+ var tmp_4;
3021
+ var tmp$ret$24;
3022
+ $l$block: {
3023
+ // Inline function 'kotlin.text.all' call
3024
+ var inductionVariable = 0;
3025
+ while (inductionVariable < charSequenceLength(this_2)) {
3026
+ var element_1 = charSequenceGet(this_2, inductionVariable);
3027
+ inductionVariable = inductionVariable + 1 | 0;
3028
+ if (!isDigit(element_1)) {
3029
+ tmp$ret$24 = false;
3030
+ break $l$block;
3031
+ }
3032
+ }
3033
+ tmp$ret$24 = true;
3034
+ }
3035
+ if (tmp$ret$24) {
3036
+ tmp_4 = this_2;
3037
+ } else {
3038
+ tmp_4 = null;
3039
+ }
3040
+ var tmp0_elvis_lhs = tmp_4;
3041
+ var tmp_5;
3042
+ if (tmp0_elvis_lhs == null) {
3043
+ tmp$ret$21 = null;
3044
+ break $l$block_0;
3045
+ } else {
3046
+ tmp_5 = tmp0_elvis_lhs;
3047
+ }
3048
+ var status = tmp_5;
3049
+ var tmp1_safe_receiver_0 = element_0.tr_1;
3050
+ var respBodyRef = tmp1_safe_receiver_0 == null ? null : tmp1_safe_receiver_0.qr_1;
3051
+ var tmp_6;
3052
+ if (respBodyRef == null) {
3053
+ tmp_6 = null;
3054
+ } else {
3055
+ // Inline function 'kotlin.let' call
3056
+ var tmp_7;
3057
+ if (respBodyRef instanceof Unit) {
3058
+ tmp_7 = null;
3059
+ } else {
3060
+ tmp_7 = convert(respBodyRef);
3061
+ }
3062
+ tmp_6 = tmp_7;
3063
+ }
3064
+ var respBodyType = tmp_6;
3065
+ var _destruct__k2r9zo_0 = classifyBody(Companion_instance_4, respBodyRef);
3066
+ var respBodyKind = _destruct__k2r9zo_0.ze();
3067
+ var respElementName = _destruct__k2r9zo_0.af();
3068
+ var tmp_8 = 'Response' + status;
3069
+ // Inline function 'kotlin.collections.map' call
3070
+ var this_3 = get_fields(element_0.sr_1);
3071
+ // Inline function 'kotlin.collections.mapTo' call
3072
+ var destination_4 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_3, 10));
3073
+ var _iterator__ex2g4s_4 = this_3.t();
3074
+ while (_iterator__ex2g4s_4.u()) {
3075
+ var item_2 = _iterator__ex2g4s_4.v();
3076
+ var tmp$ret$30 = new NamedTypedField(item_2.op_1.o1(), convert(item_2.pp_1), item_2.pp_1.ot());
3077
+ destination_4.x(tmp$ret$30);
3078
+ }
3079
+ tmp$ret$21 = new ResponseVariantShape(status, tmp_8, respBodyKind, respBodyType, respElementName, destination_4);
3080
+ }
3081
+ var tmp0_safe_receiver_0 = tmp$ret$21;
3082
+ if (tmp0_safe_receiver_0 == null)
3083
+ null;
3084
+ else {
3085
+ // Inline function 'kotlin.let' call
3086
+ destination_3.x(tmp0_safe_receiver_0);
3087
+ }
3088
+ }
3089
+ // Inline function 'kotlin.collections.distinctBy' call
3090
+ var set = HashSet_init_$Create$();
3091
+ var list = ArrayList_init_$Create$();
3092
+ var _iterator__ex2g4s_5 = destination_3.t();
3093
+ while (_iterator__ex2g4s_5.u()) {
3094
+ var e = _iterator__ex2g4s_5.v();
3095
+ var key = e.t33_1;
3096
+ if (set.x(key)) {
3097
+ list.x(e);
3098
+ }
3099
+ }
3100
+ var responseVariants = list;
3101
+ // Inline function 'kotlin.collections.buildList' call
3102
+ // Inline function 'kotlin.collections.buildListInternal' call
3103
+ // Inline function 'kotlin.apply' call
3104
+ var this_4 = ArrayList_init_$Create$();
3105
+ // Inline function 'kotlin.collections.filterIsInstance' call
3106
+ var tmp0_1 = endpoint.hr_1;
3107
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
3108
+ var destination_5 = ArrayList_init_$Create$();
3109
+ var _iterator__ex2g4s_6 = tmp0_1.t();
3110
+ while (_iterator__ex2g4s_6.u()) {
3111
+ var element_2 = _iterator__ex2g4s_6.v();
3112
+ if (element_2 instanceof Param) {
3113
+ destination_5.x(element_2);
3114
+ }
3115
+ }
3116
+ // Inline function 'kotlin.collections.forEach' call
3117
+ var _iterator__ex2g4s_7 = destination_5.t();
3118
+ while (_iterator__ex2g4s_7.u()) {
3119
+ var element_3 = _iterator__ex2g4s_7.v();
3120
+ this_4.x(element_3.nr_1);
3121
+ }
3122
+ // Inline function 'kotlin.collections.forEach' call
3123
+ var _iterator__ex2g4s_8 = get_fields(endpoint.ir_1).t();
3124
+ while (_iterator__ex2g4s_8.u()) {
3125
+ var element_4 = _iterator__ex2g4s_8.v();
3126
+ this_4.x(element_4.pp_1);
3127
+ }
3128
+ // Inline function 'kotlin.collections.forEach' call
3129
+ var _iterator__ex2g4s_9 = get_fields(endpoint.jr_1).t();
3130
+ while (_iterator__ex2g4s_9.u()) {
3131
+ var element_5 = _iterator__ex2g4s_9.v();
3132
+ this_4.x(element_5.pp_1);
3133
+ }
3134
+ if (!(bodyRef == null)) {
3135
+ this_4.x(bodyRef);
3136
+ }
3137
+ // Inline function 'kotlin.collections.forEach' call
3138
+ var _iterator__ex2g4s_10 = endpoint.lr_1.t();
3139
+ while (_iterator__ex2g4s_10.u()) {
3140
+ var element_6 = _iterator__ex2g4s_10.v();
3141
+ var tmp0_safe_receiver_1 = element_6.tr_1;
3142
+ var tmp1_safe_receiver_1 = tmp0_safe_receiver_1 == null ? null : tmp0_safe_receiver_1.qr_1;
3143
+ if (tmp1_safe_receiver_1 == null)
3144
+ null;
3145
+ else {
3146
+ // Inline function 'kotlin.let' call
3147
+ this_4.x(tmp1_safe_receiver_1);
3148
+ }
3149
+ // Inline function 'kotlin.collections.forEach' call
3150
+ var _iterator__ex2g4s_11 = get_fields(element_6.sr_1).t();
3151
+ while (_iterator__ex2g4s_11.u()) {
3152
+ var element_7 = _iterator__ex2g4s_11.v();
3153
+ this_4.x(element_7.pp_1);
3154
+ }
3155
+ }
3156
+ var refs = this_4.q5();
3157
+ var tmp_9;
3158
+ if (bodyElementType == null) {
3159
+ tmp_9 = null;
3160
+ } else {
3161
+ // Inline function 'kotlin.let' call
3162
+ tmp_9 = types.s2(bodyElementType);
3163
+ }
3164
+ var tmp8_safe_receiver = tmp_9;
3165
+ var tmp9_safe_receiver = tmp8_safe_receiver == null ? null : tmp8_safe_receiver.lp_1;
3166
+ var tmp10_safe_receiver = tmp9_safe_receiver == null ? null : get_fields(tmp9_safe_receiver);
3167
+ var tmp_10;
3168
+ if (tmp10_safe_receiver == null) {
3169
+ tmp_10 = null;
3170
+ } else {
3171
+ // Inline function 'kotlin.collections.map' call
3172
+ // Inline function 'kotlin.collections.mapTo' call
3173
+ var destination_6 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp10_safe_receiver, 10));
3174
+ var _iterator__ex2g4s_12 = tmp10_safe_receiver.t();
3175
+ while (_iterator__ex2g4s_12.u()) {
3176
+ var item_3 = _iterator__ex2g4s_12.v();
3177
+ var tmp$ret$57 = item_3.pp_1;
3178
+ destination_6.x(tmp$ret$57);
3179
+ }
3180
+ tmp_10 = destination_6;
3181
+ }
3182
+ var tmp11_elvis_lhs = tmp_10;
3183
+ var bodyFieldRefs = tmp11_elvis_lhs == null ? emptyList() : tmp11_elvis_lhs;
3184
+ var modelImports = this.v32(plus(refs, bodyFieldRefs), bodyFieldShapes, types);
3185
+ return new EndpointShape(Companion_getInstance().wt(endpoint.fr_1.o1()).zt(), pathFields, queryFields, headerFields, bodyKind, bodyElementType, bodyPrimitiveType, bodyFieldShapes, responseVariants, modelImports);
3186
+ };
3187
+ protoOf(Companion_2).v32 = function (refs, fieldShapes, types) {
3188
+ // Inline function 'kotlin.collections.flatMap' call
3189
+ // Inline function 'kotlin.collections.flatMapTo' call
3190
+ var destination = ArrayList_init_$Create$();
3191
+ var _iterator__ex2g4s = refs.t();
3192
+ while (_iterator__ex2g4s.u()) {
3193
+ var element = _iterator__ex2g4s.v();
3194
+ var list = collectCustomNames(this, element);
3195
+ addAll(destination, list);
3196
+ }
3197
+ return distinct(plus(plus(destination, collectNestedTypeNames(this, fieldShapes)), collectFieldTypeNames(this, fieldShapes, types)));
3198
+ };
3199
+ protoOf(Companion_2).u32 = function (typeName, types, refined, visited) {
3200
+ if (visited.i1(typeName))
3201
+ return emptyList();
3202
+ var tmp0_elvis_lhs = types.s2(typeName);
3203
+ var tmp;
3204
+ if (tmp0_elvis_lhs == null) {
3205
+ return emptyList();
3206
+ } else {
3207
+ tmp = tmp0_elvis_lhs;
3208
+ }
3209
+ var type = tmp;
3210
+ var nextVisited = plus_1(visited, typeName);
3211
+ // Inline function 'kotlin.collections.map' call
3212
+ var this_0 = get_fields(type.lp_1);
3213
+ // Inline function 'kotlin.collections.mapTo' call
3214
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
3215
+ var _iterator__ex2g4s = this_0.t();
3216
+ while (_iterator__ex2g4s.u()) {
3217
+ var item = _iterator__ex2g4s.v();
3218
+ var name = item.op_1.o1();
3219
+ var ref = item.pp_1;
3220
+ var tmp_0;
3221
+ if (ref instanceof Custom) {
3222
+ var tmp_1;
3223
+ // Inline function 'kotlin.collections.contains' call
3224
+ // Inline function 'kotlin.collections.containsKey' call
3225
+ var key = ref.n19_1;
3226
+ if ((isInterface(types, KtMap) ? types : THROW_CCE()).q2(key)) {
3227
+ tmp_1 = new NestedObject(name, ref.n19_1, Companion_instance_4.u32(ref.n19_1, types, refined, nextVisited));
3228
+ } else {
3229
+ tmp_1 = primitiveOf(Companion_instance_4, name, ref, refined);
3230
+ }
3231
+ tmp_0 = tmp_1;
3232
+ } else {
3233
+ if (ref instanceof Iterable) {
3234
+ var inner = ref.yp_1;
3235
+ var tmp_2;
3236
+ var tmp_3;
3237
+ if (inner instanceof Custom) {
3238
+ // Inline function 'kotlin.collections.contains' call
3239
+ // Inline function 'kotlin.collections.containsKey' call
3240
+ var key_0 = inner.n19_1;
3241
+ tmp_3 = (isInterface(types, KtMap) ? types : THROW_CCE()).q2(key_0);
3242
+ } else {
3243
+ tmp_3 = false;
3244
+ }
3245
+ if (tmp_3) {
3246
+ tmp_2 = new NestedList(name, inner.n19_1, Companion_instance_4.u32(inner.n19_1, types, refined, nextVisited));
3247
+ } else {
3248
+ tmp_2 = primitiveOf(Companion_instance_4, name, ref, refined);
3249
+ }
3250
+ tmp_0 = tmp_2;
3251
+ } else {
3252
+ tmp_0 = primitiveOf(Companion_instance_4, name, ref, refined);
3253
+ }
3254
+ }
3255
+ var tmp$ret$2 = tmp_0;
3256
+ destination.x(tmp$ret$2);
3257
+ }
3258
+ return destination;
3259
+ };
3260
+ var Companion_instance_4;
3261
+ function Companion_getInstance_3() {
3262
+ return Companion_instance_4;
3263
+ }
3264
+ function BodyKind_None_getInstance() {
3265
+ BodyKind_initEntries();
3266
+ return BodyKind_None_instance;
3267
+ }
3268
+ function BodyKind_Object_getInstance() {
3269
+ BodyKind_initEntries();
3270
+ return BodyKind_Object_instance;
3271
+ }
3272
+ function BodyKind_List_getInstance() {
3273
+ BodyKind_initEntries();
3274
+ return BodyKind_List_instance;
3275
+ }
3276
+ function BodyKind_Primitive_getInstance() {
3277
+ BodyKind_initEntries();
3278
+ return BodyKind_Primitive_instance;
3279
+ }
3280
+ function EndpointShape(name, pathFields, queryFields, headerFields, bodyKind, bodyElementType, bodyPrimitiveType, bodyFieldShapes, responseVariants, modelImports) {
3281
+ this.g33_1 = name;
3282
+ this.h33_1 = pathFields;
3283
+ this.i33_1 = queryFields;
3284
+ this.j33_1 = headerFields;
3285
+ this.k33_1 = bodyKind;
3286
+ this.l33_1 = bodyElementType;
3287
+ this.m33_1 = bodyPrimitiveType;
3288
+ this.n33_1 = bodyFieldShapes;
3289
+ this.o33_1 = responseVariants;
3290
+ this.p33_1 = modelImports;
3291
+ }
3292
+ protoOf(EndpointShape).toString = function () {
3293
+ return 'EndpointShape(name=' + this.g33_1 + ', pathFields=' + toString(this.h33_1) + ', queryFields=' + toString(this.i33_1) + ', headerFields=' + toString(this.j33_1) + ', bodyKind=' + this.k33_1.toString() + ', bodyElementType=' + this.l33_1 + ', bodyPrimitiveType=' + toString_1(this.m33_1) + ', bodyFieldShapes=' + toString(this.n33_1) + ', responseVariants=' + toString(this.o33_1) + ', modelImports=' + toString(this.p33_1) + ')';
3294
+ };
3295
+ protoOf(EndpointShape).hashCode = function () {
3296
+ var result = getStringHashCode(this.g33_1);
3297
+ result = imul(result, 31) + hashCode(this.h33_1) | 0;
3298
+ result = imul(result, 31) + hashCode(this.i33_1) | 0;
3299
+ result = imul(result, 31) + hashCode(this.j33_1) | 0;
3300
+ result = imul(result, 31) + this.k33_1.hashCode() | 0;
3301
+ result = imul(result, 31) + (this.l33_1 == null ? 0 : getStringHashCode(this.l33_1)) | 0;
3302
+ result = imul(result, 31) + (this.m33_1 == null ? 0 : hashCode(this.m33_1)) | 0;
3303
+ result = imul(result, 31) + hashCode(this.n33_1) | 0;
3304
+ result = imul(result, 31) + hashCode(this.o33_1) | 0;
3305
+ result = imul(result, 31) + hashCode(this.p33_1) | 0;
3306
+ return result;
3307
+ };
3308
+ protoOf(EndpointShape).equals = function (other) {
3309
+ if (this === other)
3310
+ return true;
3311
+ if (!(other instanceof EndpointShape))
3312
+ return false;
3313
+ if (!(this.g33_1 === other.g33_1))
3314
+ return false;
3315
+ if (!equals(this.h33_1, other.h33_1))
3316
+ return false;
3317
+ if (!equals(this.i33_1, other.i33_1))
3318
+ return false;
3319
+ if (!equals(this.j33_1, other.j33_1))
3320
+ return false;
3321
+ if (!this.k33_1.equals(other.k33_1))
3322
+ return false;
3323
+ if (!(this.l33_1 == other.l33_1))
3324
+ return false;
3325
+ if (!equals(this.m33_1, other.m33_1))
3326
+ return false;
3327
+ if (!equals(this.n33_1, other.n33_1))
3328
+ return false;
3329
+ if (!equals(this.o33_1, other.o33_1))
3330
+ return false;
3331
+ if (!equals(this.p33_1, other.p33_1))
3332
+ return false;
3333
+ return true;
3334
+ };
3335
+ function genNullable($this, element) {
3336
+ return new Nullable(Custom_init_$Create$('Gen', listOf(element)));
3337
+ }
3338
+ function blockType_0($this, nested) {
3339
+ return new Function_0(emptyList(), Unit_instance_0, Custom_init_$Create$(nested));
3340
+ }
3341
+ function nestedBlock($this, $receiver, fieldName, nestedTypeName, genType, valueType) {
3342
+ var nested = $this.b33(nestedTypeName);
3343
+ $receiver.u15(fieldName, genType, true, Visibility_PUBLIC_getInstance(), VOID, VOID, $receiver.t14('null'));
3344
+ valueSetter($receiver, fieldName, valueType);
3345
+ $receiver.u15('_' + fieldName + 'Block', new Nullable(blockType_0($this, nested)), true, Visibility_INTERNAL_getInstance(), VOID, listOf('@PublishedApi'), $receiver.t14('null'));
3346
+ var tmp = fieldName + 'Block';
3347
+ $receiver.w15(tmp, VOID, VOID, RecordBuilder$nestedBlock$lambda(nested, fieldName));
3348
+ }
3349
+ function appendNestedBlock($this, $receiver, fieldName, nestedTypeName, fields, receiver, path, indent, listSegment) {
3350
+ var blockRef = receiver + '.' + escapeKotlinIdentifier('_' + fieldName + 'Block');
3351
+ var nestedVar = escapeKotlinIdentifier('nested_' + fieldName);
3352
+ var nextPath = listSegment ? plus_0(plus_0(path, fieldName), '*') : plus_0(path, fieldName);
3353
+ // Inline function 'kotlin.text.appendLine' call
3354
+ var value = indent + blockRef + '?.let { block ->';
3355
+ // Inline function 'kotlin.text.appendLine' call
3356
+ $receiver.q(value).s(_Char___init__impl__6a9atx(10));
3357
+ // Inline function 'kotlin.text.appendLine' call
3358
+ var value_0 = indent + ' val ' + nestedVar + ' = ' + $this.b33(nestedTypeName) + '().apply(block)';
3359
+ // Inline function 'kotlin.text.appendLine' call
3360
+ $receiver.q(value_0).s(_Char___init__impl__6a9atx(10));
3361
+ $receiver.q($this.a33(fields, nestedVar, nextPath, indent + ' '));
3362
+ // Inline function 'kotlin.text.appendLine' call
3363
+ var value_1 = indent + '}';
3364
+ // Inline function 'kotlin.text.appendLine' call
3365
+ $receiver.q(value_1).s(_Char___init__impl__6a9atx(10));
3366
+ }
3367
+ function RecordBuilder$buildBuilderClass$lambda($fields) {
3368
+ return function ($this$struct) {
3369
+ $this$struct.h15();
3370
+ $this$struct.g15('@WirespecScenarioDsl');
3371
+ $this$struct.l13(Visibility_PUBLIC_getInstance());
3372
+ // Inline function 'kotlin.collections.forEach' call
3373
+ var _iterator__ex2g4s = $fields.t();
3374
+ while (_iterator__ex2g4s.u()) {
3375
+ var element = _iterator__ex2g4s.v();
3376
+ if (element instanceof Primitive_0) {
3377
+ $this$struct.u15(element.f34_1, genNullable(RecordBuilder_instance, element.g34_1), true, Visibility_PUBLIC_getInstance(), VOID, VOID, $this$struct.t14('null'));
3378
+ valueSetter($this$struct, element.f34_1, element.g34_1);
3379
+ } else {
3380
+ if (element instanceof NestedObject) {
3381
+ nestedBlock(RecordBuilder_instance, $this$struct, element.c34_1, element.d34_1, genNullable(RecordBuilder_instance, Custom_init_$Create$(element.d34_1)), Custom_init_$Create$(element.d34_1));
3382
+ } else {
3383
+ if (element instanceof NestedList) {
3384
+ nestedBlock(RecordBuilder_instance, $this$struct, element.z33_1, element.a34_1, genNullable(RecordBuilder_instance, new Array_0(Custom_init_$Create$(element.a34_1))), new Array_0(Custom_init_$Create$(element.a34_1)));
3385
+ } else {
3386
+ noWhenBranchMatchedException();
3387
+ }
3388
+ }
3389
+ }
3390
+ }
3391
+ return Unit_instance;
3392
+ };
3393
+ }
3394
+ function RecordBuilder$nestedBlock$lambda($nested, $fieldName) {
3395
+ return function ($this$function) {
3396
+ $this$function.l13(Visibility_PUBLIC_getInstance());
3397
+ $this$function.m13('block', blockType_0(RecordBuilder_instance, $nested));
3398
+ $this$function.i14(escapeKotlinIdentifier('_' + $fieldName + 'Block') + ' = block');
3399
+ return Unit_instance;
3400
+ };
3401
+ }
3402
+ function RecordBuilder$renderRegistration$lambda(it) {
3403
+ return '"' + it + '"';
3404
+ }
3405
+ function RecordBuilder() {
3406
+ }
3407
+ protoOf(RecordBuilder).b33 = function (typeName) {
3408
+ return Companion_getInstance().wt(typeName).zt() + 'Builder';
3409
+ };
3410
+ protoOf(RecordBuilder).m34 = function (typeName, fields) {
3411
+ var tmp = this.b33(typeName);
3412
+ return struct(tmp, RecordBuilder$buildBuilderClass$lambda(fields));
3413
+ };
3414
+ protoOf(RecordBuilder).a33 = function (fields, receiver, path, indent) {
3415
+ // Inline function 'kotlin.text.buildString' call
3416
+ // Inline function 'kotlin.apply' call
3417
+ var this_0 = StringBuilder_init_$Create$();
3418
+ // Inline function 'kotlin.collections.forEach' call
3419
+ var _iterator__ex2g4s = fields.t();
3420
+ while (_iterator__ex2g4s.u()) {
3421
+ var element = _iterator__ex2g4s.v();
3422
+ var fieldRef = receiver + '.' + escapeKotlinIdentifier(element.m());
3423
+ var tmp = plus_0(path, element.m());
3424
+ var segs = joinToString(tmp, ', ', VOID, VOID, VOID, VOID, RecordBuilder$renderRegistration$lambda);
3425
+ // Inline function 'kotlin.text.appendLine' call
3426
+ var value = indent + fieldRef + '?.let { registerPath(' + segs + ') { it } }';
3427
+ // Inline function 'kotlin.text.appendLine' call
3428
+ this_0.q(value).s(_Char___init__impl__6a9atx(10));
3429
+ if (!(element instanceof Primitive_0)) {
3430
+ if (element instanceof NestedObject) {
3431
+ appendNestedBlock(RecordBuilder_instance, this_0, element.c34_1, element.d34_1, element.e34_1, receiver, path, indent, false);
3432
+ } else {
3433
+ if (element instanceof NestedList) {
3434
+ appendNestedBlock(RecordBuilder_instance, this_0, element.z33_1, element.a34_1, element.b34_1, receiver, path, indent, true);
3435
+ } else {
3436
+ noWhenBranchMatchedException();
3437
+ }
3438
+ }
3439
+ }
3440
+ }
3441
+ return this_0.toString();
3442
+ };
3443
+ var RecordBuilder_instance;
3444
+ function RecordBuilder_getInstance() {
3445
+ return RecordBuilder_instance;
3446
+ }
3447
+ function TypeDslFile$build$lambda$lambda($receiver, $builder, $model, $shape) {
3448
+ return function ($this$function) {
3449
+ $this$function.l13(Visibility_PUBLIC_getInstance());
3450
+ $this$function.k13(Custom_init_$Create$($receiver));
3451
+ $this$function.o13('block', $this$function.s14(Unit_instance_0, Custom_init_$Create$($builder)), $this$function.t14('{}'));
3452
+ $this$function.j13(Custom_init_$Create$('Arb', listOf(Custom_init_$Create$($model))));
3453
+ $this$function.i14('val builder = ' + $builder + '().apply(block)');
3454
+ $this$function.i14('return recordGen<' + $model + '> {');
3455
+ // Inline function 'kotlin.text.trimEnd' call
3456
+ var this_0 = RecordBuilder_instance.a33($shape.o34_1, 'builder', emptyList(), ' ');
3457
+ var tmp$ret$0 = toString(trimEnd(isCharSequence(this_0) ? this_0 : THROW_CCE()));
3458
+ $this$function.i14(tmp$ret$0);
3459
+ $this$function.i14('}');
3460
+ return Unit_instance;
3461
+ };
3462
+ }
3463
+ function TypeDslFile$build$lambda($kotestPkg, $shape, $modelPkg, $receiver, $builder, $model) {
3464
+ return function ($this$file) {
3465
+ $this$file.e17($kotestPkg);
3466
+ $this$file.s15('community.flock.wirespec.integration.kotest.dsl', 'recordGen');
3467
+ $this$file.s15('community.flock.wirespec.integration.kotest.dsl', 'WirespecScenarioDsl');
3468
+ $this$file.s15('io.kotest.property', 'Arb');
3469
+ var tmp;
3470
+ // Inline function 'kotlin.collections.isNotEmpty' call
3471
+ if (!$shape.o34_1.r()) {
3472
+ $this$file.s15('io.kotest.property', 'Gen');
3473
+ $this$file.s15('io.kotest.property.arbitrary', 'constant');
3474
+ tmp = Unit_instance;
3475
+ }
3476
+ // Inline function 'kotlin.collections.forEach' call
3477
+ var _iterator__ex2g4s = distinct(plus(listOf($shape.n34_1), $shape.p34_1)).t();
3478
+ while (_iterator__ex2g4s.u()) {
3479
+ var element = _iterator__ex2g4s.v();
3480
+ $this$file.s15($modelPkg, Companion_getInstance().wt(element).zt());
3481
+ }
3482
+ $this$file.w15('generate', VOID, VOID, TypeDslFile$build$lambda$lambda($receiver, $builder, $model, $shape));
3483
+ $this$file.d17_1.x(RecordBuilder_instance.m34($shape.n34_1, $shape.o34_1));
3484
+ return Unit_instance;
3485
+ };
3486
+ }
3487
+ function TypeDslFile() {
3488
+ }
3489
+ protoOf(TypeDslFile).q34 = function (type, packageName, types, refined) {
3490
+ var shape = Companion_instance_5.r34(type, types, refined);
3491
+ var kotestPkg = packageName.bt_1 + '.kotest';
3492
+ var modelPkg = packageName.bt_1 + '.model';
3493
+ var fileName = Companion_instance_0.at(kotestPkg).dt() + (shape.n34_1 + 'Dsl');
3494
+ var model = Companion_getInstance().wt(shape.n34_1).zt();
3495
+ var builder = RecordBuilder_instance.b33(shape.n34_1);
3496
+ var receiver = shape.o34_1.r() ? model : model + '.Companion';
3497
+ var tmp = Companion_getInstance().wt(fileName);
3498
+ return file(tmp, TypeDslFile$build$lambda(kotestPkg, shape, modelPkg, receiver, builder, model));
3499
+ };
3500
+ var TypeDslFile_instance;
3501
+ function TypeDslFile_getInstance() {
3502
+ return TypeDslFile_instance;
3503
+ }
3504
+ function Companion_3() {
3505
+ }
3506
+ protoOf(Companion_3).r34 = function (type, types, refined) {
3507
+ var name = type.kp_1.o1();
3508
+ var fields = Companion_instance_4.u32(name, types, refined, emptySet());
3509
+ // Inline function 'kotlin.collections.map' call
3510
+ var this_0 = get_fields(type.lp_1);
3511
+ // Inline function 'kotlin.collections.mapTo' call
3512
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
3513
+ var _iterator__ex2g4s = this_0.t();
3514
+ while (_iterator__ex2g4s.u()) {
3515
+ var item = _iterator__ex2g4s.v();
3516
+ var tmp$ret$2 = item.pp_1;
3517
+ destination.x(tmp$ret$2);
3518
+ }
3519
+ var directRefs = destination;
3520
+ var modelImports = Companion_instance_4.v32(directRefs, fields, types);
3521
+ return new TypeShape(name, fields, modelImports);
3522
+ };
3523
+ var Companion_instance_5;
3524
+ function Companion_getInstance_4() {
3525
+ return Companion_instance_5;
3526
+ }
3527
+ function TypeShape(name, fields, modelImports) {
3528
+ this.n34_1 = name;
3529
+ this.o34_1 = fields;
3530
+ this.p34_1 = modelImports;
3531
+ }
3532
+ protoOf(TypeShape).toString = function () {
3533
+ return 'TypeShape(name=' + this.n34_1 + ', fields=' + toString(this.o34_1) + ', modelImports=' + toString(this.p34_1) + ')';
3534
+ };
3535
+ protoOf(TypeShape).hashCode = function () {
3536
+ var result = getStringHashCode(this.n34_1);
3537
+ result = imul(result, 31) + hashCode(this.o34_1) | 0;
3538
+ result = imul(result, 31) + hashCode(this.p34_1) | 0;
3539
+ return result;
3540
+ };
3541
+ protoOf(TypeShape).equals = function (other) {
3542
+ if (this === other)
3543
+ return true;
3544
+ if (!(other instanceof TypeShape))
3545
+ return false;
3546
+ if (!(this.n34_1 === other.n34_1))
3547
+ return false;
3548
+ if (!equals(this.o34_1, other.o34_1))
3549
+ return false;
3550
+ if (!equals(this.p34_1, other.p34_1))
3551
+ return false;
3552
+ return true;
3553
+ };
3554
+ function valueSetter(_this__u8e3s4, fieldName, type) {
3555
+ var escaped = escapeKotlinIdentifier(fieldName);
3556
+ _this__u8e3s4.w15(fieldName, VOID, VOID, valueSetter$lambda(type, escaped));
3557
+ }
3558
+ function valueSetter$lambda($type, $escaped) {
3559
+ return function ($this$function) {
3560
+ $this$function.l13(Visibility_PUBLIC_getInstance());
3561
+ $this$function.m13('value', $type);
3562
+ $this$function.i14('this.' + $escaped + ' = Arb.constant(value)');
3563
+ return Unit_instance;
3564
+ };
3565
+ }
3566
+ function injectRecordCompanion($this, $receiver, recordNames, modelPkg) {
3567
+ var tmp;
3568
+ var tmp_0;
3569
+ if ($receiver instanceof File) {
3570
+ var tmp0 = $receiver.iv_1;
3571
+ var tmp$ret$0;
3572
+ $l$block_0: {
3573
+ // Inline function 'kotlin.collections.any' call
3574
+ var tmp_1;
3575
+ if (isInterface(tmp0, Collection)) {
3576
+ tmp_1 = tmp0.r();
3577
+ } else {
3578
+ tmp_1 = false;
3579
+ }
3580
+ if (tmp_1) {
3581
+ tmp$ret$0 = false;
3582
+ break $l$block_0;
3583
+ }
3584
+ var _iterator__ex2g4s = tmp0.t();
3585
+ while (_iterator__ex2g4s.u()) {
3586
+ var element = _iterator__ex2g4s.v();
3587
+ var tmp_2;
3588
+ if (element instanceof Package) {
3589
+ tmp_2 = element.mv_1 === modelPkg;
3590
+ } else {
3591
+ tmp_2 = false;
3592
+ }
3593
+ if (tmp_2) {
3594
+ tmp$ret$0 = true;
3595
+ break $l$block_0;
3596
+ }
3597
+ }
3598
+ tmp$ret$0 = false;
3599
+ }
3600
+ tmp_0 = tmp$ret$0;
3601
+ } else {
3602
+ tmp_0 = false;
3603
+ }
3604
+ if (tmp_0) {
3605
+ // Inline function 'kotlin.collections.map' call
3606
+ var this_0 = $receiver.iv_1;
3607
+ // Inline function 'kotlin.collections.mapTo' call
3608
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
3609
+ var _iterator__ex2g4s_0 = this_0.t();
3610
+ while (_iterator__ex2g4s_0.u()) {
3611
+ var item = _iterator__ex2g4s_0.v();
3612
+ var tmp_3;
3613
+ var tmp_4;
3614
+ var tmp_5;
3615
+ var tmp_6;
3616
+ if (item instanceof Struct) {
3617
+ tmp_6 = recordNames.i1(item.hx_1.zt());
3618
+ } else {
3619
+ tmp_6 = false;
3620
+ }
3621
+ if (tmp_6) {
3622
+ // Inline function 'kotlin.collections.isNotEmpty' call
3623
+ tmp_5 = !fieldList(item).r();
3624
+ } else {
3625
+ tmp_5 = false;
3626
+ }
3627
+ if (tmp_5) {
3628
+ tmp_4 = !hasCompanion($this, item);
3629
+ } else {
3630
+ tmp_4 = false;
3631
+ }
3632
+ if (tmp_4) {
3633
+ tmp_3 = item.sx(VOID, VOID, VOID, VOID, plus_0(item.lx_1, raw('companion object')));
3634
+ } else {
3635
+ tmp_3 = item;
3636
+ }
3637
+ var tmp$ret$4 = tmp_3;
3638
+ destination.x(tmp$ret$4);
3639
+ }
3640
+ tmp = $receiver.lv(VOID, destination);
3641
+ } else {
3642
+ tmp = $receiver;
3643
+ }
3644
+ return tmp;
3645
+ }
3646
+ function hasCompanion($this, $receiver) {
3647
+ var tmp0 = $receiver.lx_1;
3648
+ var tmp$ret$0;
3649
+ $l$block_0: {
3650
+ // Inline function 'kotlin.collections.any' call
3651
+ var tmp;
3652
+ if (isInterface(tmp0, Collection)) {
3653
+ tmp = tmp0.r();
3654
+ } else {
3655
+ tmp = false;
3656
+ }
3657
+ if (tmp) {
3658
+ tmp$ret$0 = false;
3659
+ break $l$block_0;
3660
+ }
3661
+ var _iterator__ex2g4s = tmp0.t();
3662
+ while (_iterator__ex2g4s.u()) {
3663
+ var element = _iterator__ex2g4s.v();
3664
+ var tmp_0;
3665
+ if (element instanceof RawElement) {
3666
+ // Inline function 'kotlin.text.trimStart' call
3667
+ var this_0 = element.gy_1;
3668
+ var tmp$ret$2 = toString(trimStart(isCharSequence(this_0) ? this_0 : THROW_CCE()));
3669
+ tmp_0 = startsWith(tmp$ret$2, 'companion object');
3670
+ } else {
3671
+ tmp_0 = false;
3672
+ }
3673
+ if (tmp_0) {
3674
+ tmp$ret$0 = true;
3675
+ break $l$block_0;
3676
+ }
3677
+ }
3678
+ tmp$ret$0 = false;
3679
+ }
3680
+ return tmp$ret$0;
3681
+ }
3682
+ function KotestDslExtension(packageName) {
3683
+ this.s34_1 = packageName;
3684
+ }
3685
+ protoOf(KotestDslExtension).b1b = function (ir, ast) {
3686
+ var modules = NonEmptyList__toList_impl_t5xcy2(ast.ep_1);
3687
+ // Inline function 'kotlin.collections.flatMap' call
3688
+ // Inline function 'kotlin.collections.flatMapTo' call
3689
+ var destination = ArrayList_init_$Create$();
3690
+ var _iterator__ex2g4s = modules.t();
3691
+ while (_iterator__ex2g4s.u()) {
3692
+ var element = _iterator__ex2g4s.v();
3693
+ var list = NonEmptyList__toList_impl_t5xcy2(element.gp_1);
3694
+ addAll(destination, list);
3695
+ }
3696
+ var allStatements = destination;
3697
+ // Inline function 'kotlin.collections.filterIsInstance' call
3698
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
3699
+ var destination_0 = ArrayList_init_$Create$();
3700
+ var _iterator__ex2g4s_0 = allStatements.t();
3701
+ while (_iterator__ex2g4s_0.u()) {
3702
+ var element_0 = _iterator__ex2g4s_0.v();
3703
+ if (element_0 instanceof Type) {
3704
+ destination_0.x(element_0);
3705
+ }
3706
+ }
3707
+ // Inline function 'kotlin.collections.associateBy' call
3708
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(destination_0, 10)), 16);
3709
+ // Inline function 'kotlin.collections.associateByTo' call
3710
+ var destination_1 = LinkedHashMap_init_$Create$(capacity);
3711
+ var _iterator__ex2g4s_1 = destination_0.t();
3712
+ while (_iterator__ex2g4s_1.u()) {
3713
+ var element_1 = _iterator__ex2g4s_1.v();
3714
+ var tmp$ret$7 = element_1.kp_1.o1();
3715
+ destination_1.v2(tmp$ret$7, element_1);
3716
+ }
3717
+ var types = destination_1;
3718
+ // Inline function 'kotlin.collections.filterIsInstance' call
3719
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
3720
+ var destination_2 = ArrayList_init_$Create$();
3721
+ var _iterator__ex2g4s_2 = allStatements.t();
3722
+ while (_iterator__ex2g4s_2.u()) {
3723
+ var element_2 = _iterator__ex2g4s_2.v();
3724
+ if (element_2 instanceof Refined) {
3725
+ destination_2.x(element_2);
3726
+ }
3727
+ }
3728
+ // Inline function 'kotlin.collections.associateBy' call
3729
+ var capacity_0 = coerceAtLeast(mapCapacity(collectionSizeOrDefault(destination_2, 10)), 16);
3730
+ // Inline function 'kotlin.collections.associateByTo' call
3731
+ var destination_3 = LinkedHashMap_init_$Create$(capacity_0);
3732
+ var _iterator__ex2g4s_3 = destination_2.t();
3733
+ while (_iterator__ex2g4s_3.u()) {
3734
+ var element_3 = _iterator__ex2g4s_3.v();
3735
+ var tmp$ret$12 = element_3.ls_1.o1();
3736
+ destination_3.v2(tmp$ret$12, element_3);
3737
+ }
3738
+ var refined = destination_3;
3739
+ // Inline function 'kotlin.collections.filterIsInstance' call
3740
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
3741
+ var destination_4 = ArrayList_init_$Create$();
3742
+ var _iterator__ex2g4s_4 = allStatements.t();
3743
+ while (_iterator__ex2g4s_4.u()) {
3744
+ var element_4 = _iterator__ex2g4s_4.v();
3745
+ if (element_4 instanceof Endpoint) {
3746
+ destination_4.x(element_4);
3747
+ }
3748
+ }
3749
+ var endpoints = destination_4;
3750
+ // Inline function 'kotlin.collections.filterIsInstance' call
3751
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
3752
+ var destination_5 = ArrayList_init_$Create$();
3753
+ var _iterator__ex2g4s_5 = allStatements.t();
3754
+ while (_iterator__ex2g4s_5.u()) {
3755
+ var element_5 = _iterator__ex2g4s_5.v();
3756
+ if (element_5 instanceof Channel) {
3757
+ destination_5.x(element_5);
3758
+ }
3759
+ }
3760
+ var channels = destination_5;
3761
+ // Inline function 'kotlin.collections.map' call
3762
+ var this_0 = types.u2();
3763
+ // Inline function 'kotlin.collections.mapTo' call
3764
+ var destination_6 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
3765
+ var _iterator__ex2g4s_6 = this_0.t();
3766
+ while (_iterator__ex2g4s_6.u()) {
3767
+ var item = _iterator__ex2g4s_6.v();
3768
+ var tmp$ret$19 = TypeDslFile_instance.q34(item, this.s34_1, types, refined);
3769
+ destination_6.x(tmp$ret$19);
3770
+ }
3771
+ var typeDsl = destination_6;
3772
+ // Inline function 'kotlin.collections.map' call
3773
+ // Inline function 'kotlin.collections.mapTo' call
3774
+ var destination_7 = ArrayList_init_$Create$_0(collectionSizeOrDefault(endpoints, 10));
3775
+ var _iterator__ex2g4s_7 = endpoints.t();
3776
+ while (_iterator__ex2g4s_7.u()) {
3777
+ var item_0 = _iterator__ex2g4s_7.v();
3778
+ var tmp$ret$22 = EndpointDslFile_instance.k34(item_0, this.s34_1, types, refined);
3779
+ destination_7.x(tmp$ret$22);
3780
+ }
3781
+ var endpointDsl = destination_7;
3782
+ // Inline function 'kotlin.collections.mutableSetOf' call
3783
+ var sendPayloads = LinkedHashSet_init_$Create$();
3784
+ // Inline function 'kotlin.collections.map' call
3785
+ // Inline function 'kotlin.collections.mapTo' call
3786
+ var destination_8 = ArrayList_init_$Create$_0(collectionSizeOrDefault(channels, 10));
3787
+ var _iterator__ex2g4s_8 = channels.t();
3788
+ while (_iterator__ex2g4s_8.u()) {
3789
+ var item_1 = _iterator__ex2g4s_8.v();
3790
+ var payload = Companion_instance_3.t32(item_1, types, refined).x32_1;
3791
+ var tmp$ret$26 = ChannelDslFile_instance.c33(item_1, this.s34_1, types, refined, sendPayloads.x(payload));
3792
+ destination_8.x(tmp$ret$26);
3793
+ }
3794
+ var channelDsl = destination_8;
3795
+ var extra = plus(plus(typeDsl, endpointDsl), channelDsl);
3796
+ // Inline function 'kotlin.collections.map' call
3797
+ var this_1 = types.u2();
3798
+ // Inline function 'kotlin.collections.mapTo' call
3799
+ var destination_9 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
3800
+ var _iterator__ex2g4s_9 = this_1.t();
3801
+ while (_iterator__ex2g4s_9.u()) {
3802
+ var item_2 = _iterator__ex2g4s_9.v();
3803
+ var tmp$ret$29 = Companion_getInstance().wt(item_2.kp_1.o1()).zt();
3804
+ destination_9.x(tmp$ret$29);
3805
+ }
3806
+ var recordNames = toSet_0(destination_9);
3807
+ var modelPkg = this.s34_1.bt_1 + '.model';
3808
+ // Inline function 'arrow.core.NonEmptyList.map' call
3809
+ // Inline function 'kotlin.collections.map' call
3810
+ var this_2 = _NonEmptyList___get_all__impl__pmf509(ir);
3811
+ // Inline function 'kotlin.collections.mapTo' call
3812
+ var destination_10 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
3813
+ var _iterator__ex2g4s_10 = this_2.t();
3814
+ while (_iterator__ex2g4s_10.u()) {
3815
+ var item_3 = _iterator__ex2g4s_10.v();
3816
+ var tmp$ret$33 = injectRecordCompanion(this, item_3, recordNames, modelPkg);
3817
+ destination_10.x(tmp$ret$33);
3818
+ }
3819
+ var withCompanions = _NonEmptyList___init__impl__fxd0xp(destination_10);
3820
+ return NonEmptyList__plus_impl_xqmb9(withCompanions, extra);
3821
+ };
3822
+ function annotateSerializable($this, $receiver, serialNames, serializableOnlyNames) {
3823
+ // Inline function 'kotlin.collections.flatMap' call
3824
+ var tmp0 = $receiver.iv_1;
3825
+ // Inline function 'kotlin.collections.flatMapTo' call
3826
+ var destination = ArrayList_init_$Create$();
3827
+ var _iterator__ex2g4s = tmp0.t();
3828
+ while (_iterator__ex2g4s.u()) {
3829
+ var element = _iterator__ex2g4s.v();
3830
+ var tmp;
3831
+ var tmp_0;
3832
+ if (element instanceof Struct) {
3833
+ // Inline function 'kotlin.collections.contains' call
3834
+ // Inline function 'kotlin.collections.containsKey' call
3835
+ var key = element.hx_1.zt();
3836
+ tmp_0 = (isInterface(serialNames, KtMap) ? serialNames : THROW_CCE()).q2(key);
3837
+ } else {
3838
+ tmp_0 = false;
3839
+ }
3840
+ if (tmp_0) {
3841
+ tmp = listOf_0([Companion_getInstance_5().t34_1, Companion_getInstance_5().u34(getValue(serialNames, element.hx_1.zt())), element]);
3842
+ } else {
3843
+ var tmp_1;
3844
+ var tmp_2;
3845
+ if (isInterface(element, HasName)) {
3846
+ var tmp_3;
3847
+ if (element instanceof Union) {
3848
+ tmp_3 = true;
3849
+ } else {
3850
+ tmp_3 = element instanceof Enum_1;
3851
+ }
3852
+ tmp_2 = tmp_3;
3853
+ } else {
3854
+ tmp_2 = false;
3855
+ }
3856
+ if (tmp_2) {
3857
+ tmp_1 = serializableOnlyNames.i1(element.m().zt());
3858
+ } else {
3859
+ tmp_1 = false;
3860
+ }
3861
+ if (tmp_1) {
3862
+ tmp = listOf_0([Companion_getInstance_5().t34_1, element]);
3863
+ } else {
3864
+ tmp = listOf(element);
3865
+ }
3866
+ }
3867
+ var list = tmp;
3868
+ addAll(destination, list);
3869
+ }
3870
+ return $receiver.lv(VOID, destination);
3871
+ }
3872
+ function Companion_4() {
3873
+ Companion_instance_6 = this;
3874
+ this.t34_1 = new RawElement('@kotlinx.serialization.Serializable');
3875
+ }
3876
+ protoOf(Companion_4).u34 = function (name) {
3877
+ return new RawElement('@kotlinx.serialization.SerialName("' + name + '")');
3878
+ };
3879
+ var Companion_instance_6;
3880
+ function Companion_getInstance_5() {
3881
+ if (Companion_instance_6 == null)
3882
+ new Companion_4();
3883
+ return Companion_instance_6;
3884
+ }
3885
+ function KotlinxSerializationExtension() {
3886
+ Companion_getInstance_5();
3887
+ }
3888
+ protoOf(KotlinxSerializationExtension).b1b = function (ir, ast) {
3889
+ // Inline function 'kotlin.collections.flatMap' call
3890
+ var tmp0 = NonEmptyList__toList_impl_t5xcy2(ast.ep_1);
3891
+ // Inline function 'kotlin.collections.flatMapTo' call
3892
+ var destination = ArrayList_init_$Create$();
3893
+ var _iterator__ex2g4s = tmp0.t();
3894
+ while (_iterator__ex2g4s.u()) {
3895
+ var element = _iterator__ex2g4s.v();
3896
+ var list = new NonEmptyList(element.gp_1);
3897
+ addAll(destination, list);
3898
+ }
3899
+ var definitions = destination;
3900
+ // Inline function 'kotlin.collections.filter' call
3901
+ // Inline function 'kotlin.collections.filterTo' call
3902
+ var destination_0 = ArrayList_init_$Create$();
3903
+ var _iterator__ex2g4s_0 = definitions.t();
3904
+ while (_iterator__ex2g4s_0.u()) {
3905
+ var element_0 = _iterator__ex2g4s_0.v();
3906
+ var tmp;
3907
+ if (element_0 instanceof Type) {
3908
+ tmp = true;
3909
+ } else {
3910
+ tmp = element_0 instanceof Refined;
3911
+ }
3912
+ if (tmp) {
3913
+ destination_0.x(element_0);
3914
+ }
3915
+ }
3916
+ // Inline function 'kotlin.collections.associate' call
3917
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(destination_0, 10)), 16);
3918
+ // Inline function 'kotlin.collections.associateTo' call
3919
+ var destination_1 = LinkedHashMap_init_$Create$(capacity);
3920
+ var _iterator__ex2g4s_1 = destination_0.t();
3921
+ while (_iterator__ex2g4s_1.u()) {
3922
+ var element_1 = _iterator__ex2g4s_1.v();
3923
+ // Inline function 'kotlin.collections.plusAssign' call
3924
+ var pair = to(Companion_getInstance().wt(element_1.ds().o1()).zt(), element_1.ds().o1());
3925
+ destination_1.v2(pair.ff_1, pair.gf_1);
3926
+ }
3927
+ var serialNames = destination_1;
3928
+ // Inline function 'kotlin.collections.filter' call
3929
+ // Inline function 'kotlin.collections.filterTo' call
3930
+ var destination_2 = ArrayList_init_$Create$();
3931
+ var _iterator__ex2g4s_2 = definitions.t();
3932
+ while (_iterator__ex2g4s_2.u()) {
3933
+ var element_2 = _iterator__ex2g4s_2.v();
3934
+ var tmp_0;
3935
+ if (element_2 instanceof Union_0) {
3936
+ tmp_0 = true;
3937
+ } else {
3938
+ tmp_0 = element_2 instanceof Enum_0;
3939
+ }
3940
+ if (tmp_0) {
3941
+ destination_2.x(element_2);
3942
+ }
3943
+ }
3944
+ // Inline function 'kotlin.collections.map' call
3945
+ // Inline function 'kotlin.collections.mapTo' call
3946
+ var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_2, 10));
3947
+ var _iterator__ex2g4s_3 = destination_2.t();
3948
+ while (_iterator__ex2g4s_3.u()) {
3949
+ var item = _iterator__ex2g4s_3.v();
3950
+ var tmp$ret$15 = Companion_getInstance().wt(item.ds().o1()).zt();
3951
+ destination_3.x(tmp$ret$15);
3952
+ }
3953
+ var serializableOnlyNames = toSet_0(destination_3);
3954
+ // Inline function 'arrow.core.NonEmptyList.map' call
3955
+ // Inline function 'kotlin.collections.map' call
3956
+ var this_0 = _NonEmptyList___get_all__impl__pmf509(ir);
3957
+ // Inline function 'kotlin.collections.mapTo' call
3958
+ var destination_4 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
3959
+ var _iterator__ex2g4s_4 = this_0.t();
3960
+ while (_iterator__ex2g4s_4.u()) {
3961
+ var item_0 = _iterator__ex2g4s_4.v();
3962
+ var tmp_1;
3963
+ if (item_0 instanceof File) {
3964
+ tmp_1 = annotateSerializable(this, item_0, serialNames, serializableOnlyNames);
3965
+ } else {
3966
+ tmp_1 = item_0;
3967
+ }
3968
+ var tmp$ret$19 = tmp_1;
3969
+ destination_4.x(tmp$ret$19);
3970
+ }
3971
+ return _NonEmptyList___init__impl__fxd0xp(destination_4);
3972
+ };
3973
+ function annotateEndpointHandler($this, $receiver, endpoints) {
3974
+ // Inline function 'kotlin.collections.find' call
3975
+ var tmp$ret$1;
3976
+ $l$block: {
3977
+ // Inline function 'kotlin.collections.firstOrNull' call
3978
+ var _iterator__ex2g4s = endpoints.t();
3979
+ while (_iterator__ex2g4s.u()) {
3980
+ var element = _iterator__ex2g4s.v();
3981
+ if (containsEndpointNamespace($this, $receiver, element)) {
3982
+ tmp$ret$1 = element;
3983
+ break $l$block;
3984
+ }
3985
+ }
3986
+ tmp$ret$1 = null;
3987
+ }
3988
+ var tmp0_elvis_lhs = tmp$ret$1;
3989
+ var tmp;
3990
+ if (tmp0_elvis_lhs == null) {
3991
+ return $receiver;
3992
+ } else {
3993
+ tmp = tmp0_elvis_lhs;
3994
+ }
3995
+ var endpoint = tmp;
3996
+ return injectSpringAnnotationBeforeHandler($receiver, springAnnotation(endpoint, $this.v34_1));
3997
+ }
3998
+ function containsEndpointNamespace($this, $receiver, endpoint) {
3999
+ // Inline function 'community.flock.wirespec.compiler.core.ir.findAll' call
4000
+ // Inline function 'kotlin.collections.buildList' call
4001
+ // Inline function 'kotlin.collections.buildListInternal' call
4002
+ // Inline function 'kotlin.apply' call
4003
+ var this_0 = ArrayList_init_$Create$();
4004
+ forEachElement($receiver, SpringMappingAnnotationsExtension$containsEndpointNamespace$lambda(this_0));
4005
+ var tmp0 = this_0.q5();
4006
+ var tmp$ret$5;
4007
+ $l$block_0: {
4008
+ // Inline function 'kotlin.collections.any' call
4009
+ var tmp;
4010
+ if (isInterface(tmp0, Collection)) {
4011
+ tmp = tmp0.r();
4012
+ } else {
4013
+ tmp = false;
4014
+ }
4015
+ if (tmp) {
4016
+ tmp$ret$5 = false;
4017
+ break $l$block_0;
4018
+ }
4019
+ var _iterator__ex2g4s = tmp0.t();
4020
+ while (_iterator__ex2g4s.u()) {
4021
+ var element = _iterator__ex2g4s.v();
4022
+ var tmp_0;
4023
+ var tmp0_safe_receiver = element.pv_1;
4024
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.qu_1;
4025
+ if ((tmp1_safe_receiver == null ? null : tmp1_safe_receiver.xt()) === 'Wirespec.Endpoint') {
4026
+ tmp_0 = element.nv_1.zt() === Companion_getInstance().wt(endpoint.fr_1.o1()).zt();
4027
+ } else {
4028
+ tmp_0 = false;
4029
+ }
4030
+ if (tmp_0) {
4031
+ tmp$ret$5 = true;
4032
+ break $l$block_0;
4033
+ }
4034
+ }
4035
+ tmp$ret$5 = false;
4036
+ }
4037
+ return tmp$ret$5;
4038
+ }
4039
+ function SpringMappingAnnotationsExtension$containsEndpointNamespace$lambda($$this$buildList) {
4040
+ return function (element) {
4041
+ var tmp;
4042
+ if (element instanceof Namespace) {
4043
+ $$this$buildList.x(element);
4044
+ tmp = Unit_instance;
4045
+ }
4046
+ return Unit_instance;
4047
+ };
4048
+ }
4049
+ function SpringMappingAnnotationsExtension(language) {
4050
+ this.v34_1 = language;
4051
+ }
4052
+ protoOf(SpringMappingAnnotationsExtension).b1b = function (ir, ast) {
4053
+ // Inline function 'kotlin.collections.flatMap' call
4054
+ var tmp0 = NonEmptyList__toList_impl_t5xcy2(ast.ep_1);
4055
+ // Inline function 'kotlin.collections.flatMapTo' call
4056
+ var destination = ArrayList_init_$Create$();
4057
+ var _iterator__ex2g4s = tmp0.t();
4058
+ while (_iterator__ex2g4s.u()) {
4059
+ var element = _iterator__ex2g4s.v();
4060
+ var list = new NonEmptyList(element.gp_1);
4061
+ addAll(destination, list);
4062
+ }
4063
+ // Inline function 'kotlin.collections.filterIsInstance' call
4064
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
4065
+ var destination_0 = ArrayList_init_$Create$();
4066
+ var _iterator__ex2g4s_0 = destination.t();
4067
+ while (_iterator__ex2g4s_0.u()) {
4068
+ var element_0 = _iterator__ex2g4s_0.v();
4069
+ if (element_0 instanceof Endpoint) {
4070
+ destination_0.x(element_0);
4071
+ }
4072
+ }
4073
+ var endpoints = destination_0;
4074
+ // Inline function 'arrow.core.NonEmptyList.map' call
4075
+ // Inline function 'kotlin.collections.map' call
4076
+ var this_0 = _NonEmptyList___get_all__impl__pmf509(ir);
4077
+ // Inline function 'kotlin.collections.mapTo' call
4078
+ var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
4079
+ var _iterator__ex2g4s_1 = this_0.t();
4080
+ while (_iterator__ex2g4s_1.u()) {
4081
+ var item = _iterator__ex2g4s_1.v();
4082
+ var tmp;
4083
+ if (item instanceof File) {
4084
+ tmp = annotateEndpointHandler(this, item, endpoints);
4085
+ } else {
4086
+ tmp = item;
4087
+ }
4088
+ var tmp$ret$8 = tmp;
4089
+ destination_1.x(tmp$ret$8);
4090
+ }
4091
+ return _NonEmptyList___init__impl__fxd0xp(destination_1);
4092
+ };
4093
+ function injectSpringAnnotationBeforeHandler(_this__u8e3s4, annotation) {
4094
+ // Inline function 'community.flock.wirespec.compiler.core.ir.transform' call
4095
+ var scope = new TransformScope(_this__u8e3s4);
4096
+ // Inline function 'community.flock.wirespec.compiler.core.ir.TransformScope.injectBefore' call
4097
+ var tmp = scope;
4098
+ // Inline function 'community.flock.wirespec.compiler.core.ir.injectBefore' call
4099
+ // Inline function 'community.flock.wirespec.compiler.core.ir.transformMatchingElements' call
4100
+ var this_0 = scope.q18_1;
4101
+ // Inline function 'community.flock.wirespec.compiler.core.ir.transformer' call
4102
+ // Inline function 'kotlin.apply' call
4103
+ var this_1 = new TransformerBuilder();
4104
+ this_1.k19(injectSpringAnnotationBeforeHandler$lambda(annotation));
4105
+ var tmp$ret$5 = this_1.f19();
4106
+ tmp.q18_1 = transform(this_0, tmp$ret$5);
4107
+ var tmp_0 = scope.q18_1;
4108
+ return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
4109
+ }
4110
+ function springAnnotation(_this__u8e3s4, language) {
4111
+ var pathString = '/' + joinToString(_this__u8e3s4.hr_1, '/', VOID, VOID, VOID, VOID, springAnnotation$lambda);
4112
+ var prefix = 'org.springframework.web.bind.annotation';
4113
+ var tmp;
4114
+ switch (_this__u8e3s4.gr_1.e3_1) {
4115
+ case 0:
4116
+ tmp = '@' + prefix + '.GetMapping("' + pathString + '")';
4117
+ break;
4118
+ case 1:
4119
+ tmp = '@' + prefix + '.PostMapping("' + pathString + '")';
4120
+ break;
4121
+ case 2:
4122
+ tmp = '@' + prefix + '.PutMapping("' + pathString + '")';
4123
+ break;
4124
+ case 3:
4125
+ tmp = '@' + prefix + '.DeleteMapping("' + pathString + '")';
4126
+ break;
4127
+ case 6:
4128
+ tmp = '@' + prefix + '.PatchMapping("' + pathString + '")';
4129
+ break;
4130
+ case 4:
4131
+ tmp = springAnnotation$requestMapping(language, prefix, pathString, 'OPTIONS');
4132
+ break;
4133
+ case 5:
4134
+ tmp = springAnnotation$requestMapping(language, prefix, pathString, 'HEAD');
4135
+ break;
4136
+ case 7:
4137
+ tmp = springAnnotation$requestMapping(language, prefix, pathString, 'TRACE');
4138
+ break;
4139
+ default:
4140
+ noWhenBranchMatchedException();
4141
+ break;
4142
+ }
4143
+ return tmp;
4144
+ }
4145
+ function injectSpringAnnotationBeforeHandler$lambda($annotation) {
4146
+ return function (element, transformer) {
4147
+ var tmp;
4148
+ if (element instanceof Interface) {
4149
+ var injected = element.tv_1.equals(Companion_getInstance().wt('Handler')) ? listOf(new RawElement($annotation)) : emptyList();
4150
+ var tmp_0;
4151
+ // Inline function 'kotlin.collections.isNotEmpty' call
4152
+ if (!injected.r()) {
4153
+ // Inline function 'community.flock.wirespec.compiler.core.ir.withElements' call
4154
+ var elements = plus(injected, element.jv());
4155
+ var tmp_1;
4156
+ if (element instanceof File) {
4157
+ tmp_1 = element.lv(VOID, elements);
4158
+ } else {
4159
+ if (element instanceof Struct) {
4160
+ tmp_1 = element.sx(VOID, VOID, VOID, VOID, elements);
4161
+ } else {
4162
+ if (element instanceof Namespace) {
4163
+ tmp_1 = element.sv(VOID, elements);
4164
+ } else {
4165
+ if (element instanceof Interface) {
4166
+ tmp_1 = element.bw(VOID, elements);
4167
+ } else {
4168
+ if (element instanceof Enum_1) {
4169
+ tmp_1 = element.gx(VOID, VOID, VOID, VOID, VOID, elements);
4170
+ } else {
4171
+ if (element instanceof Main) {
4172
+ tmp_1 = element;
4173
+ } else {
4174
+ tmp_1 = element;
4175
+ }
4176
+ }
4177
+ }
4178
+ }
4179
+ }
4180
+ }
4181
+ var tmp_2 = tmp_1;
4182
+ tmp_0 = tmp_2 instanceof Interface ? tmp_2 : THROW_CCE();
4183
+ } else {
4184
+ tmp_0 = element;
4185
+ }
4186
+ tmp = tmp_0;
4187
+ } else {
4188
+ tmp = element;
4189
+ }
4190
+ var transformed = tmp;
4191
+ return transformChildren(transformed, transformer);
4192
+ };
4193
+ }
4194
+ function springAnnotation$lambda(it) {
4195
+ var tmp;
4196
+ if (it instanceof Literal) {
4197
+ tmp = it.w1a_1;
4198
+ } else {
4199
+ if (it instanceof Param) {
4200
+ tmp = '{' + it.mr_1.o1() + '}';
4201
+ } else {
4202
+ noWhenBranchMatchedException();
4203
+ }
4204
+ }
4205
+ return tmp;
4206
+ }
4207
+ function springAnnotation$requestMapping($language, prefix, pathString, method) {
4208
+ return $language.e3_1 === 1 ? '@' + prefix + '.RequestMapping(value=["' + pathString + '"], method = [' + prefix + '.RequestMethod.' + method + '])' : '@' + prefix + '.RequestMapping(value="' + pathString + '", method = ' + prefix + '.RequestMethod.' + method + ')';
4209
+ }
4210
+ function nativeHintsFile($this, ast) {
4211
+ // Inline function 'kotlin.collections.flatMap' call
4212
+ var tmp0 = NonEmptyList__toList_impl_t5xcy2(ast.ep_1);
4213
+ // Inline function 'kotlin.collections.flatMapTo' call
4214
+ var destination = ArrayList_init_$Create$();
4215
+ var _iterator__ex2g4s = tmp0.t();
4216
+ while (_iterator__ex2g4s.u()) {
4217
+ var element = _iterator__ex2g4s.v();
4218
+ var list = new NonEmptyList(element.gp_1);
4219
+ addAll(destination, list);
4220
+ }
4221
+ var definitions = destination;
4222
+ // Inline function 'kotlin.collections.filterIsInstance' call
4223
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
4224
+ var destination_0 = ArrayList_init_$Create$();
4225
+ var _iterator__ex2g4s_0 = definitions.t();
4226
+ while (_iterator__ex2g4s_0.u()) {
4227
+ var element_0 = _iterator__ex2g4s_0.v();
4228
+ if (!(element_0 == null) ? isInterface(element_0, Model) : false) {
4229
+ destination_0.x(element_0);
4230
+ }
4231
+ }
4232
+ // Inline function 'kotlin.collections.map' call
4233
+ // Inline function 'kotlin.collections.mapTo' call
4234
+ var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_0, 10));
4235
+ var _iterator__ex2g4s_1 = destination_0.t();
4236
+ while (_iterator__ex2g4s_1.u()) {
4237
+ var item = _iterator__ex2g4s_1.v();
4238
+ var tmp$ret$7 = Companion_getInstance().wt(item.ds().o1()).zt();
4239
+ destination_1.x(tmp$ret$7);
4240
+ }
4241
+ var modelNames = destination_1;
4242
+ // Inline function 'kotlin.collections.filter' call
4243
+ // Inline function 'kotlin.collections.filterTo' call
4244
+ var destination_2 = ArrayList_init_$Create$();
4245
+ var _iterator__ex2g4s_2 = definitions.t();
4246
+ while (_iterator__ex2g4s_2.u()) {
4247
+ var element_1 = _iterator__ex2g4s_2.v();
4248
+ var tmp;
4249
+ if (element_1 instanceof Endpoint) {
4250
+ tmp = true;
4251
+ } else {
4252
+ tmp = element_1 instanceof Channel;
4253
+ }
4254
+ if (tmp) {
4255
+ destination_2.x(element_1);
4256
+ }
4257
+ }
4258
+ // Inline function 'kotlin.collections.map' call
4259
+ // Inline function 'kotlin.collections.mapTo' call
4260
+ var destination_3 = ArrayList_init_$Create$_0(collectionSizeOrDefault(destination_2, 10));
4261
+ var _iterator__ex2g4s_3 = destination_2.t();
4262
+ while (_iterator__ex2g4s_3.u()) {
4263
+ var item_0 = _iterator__ex2g4s_3.v();
4264
+ var tmp$ret$13 = Companion_getInstance().wt(item_0.ds().o1()).zt();
4265
+ destination_3.x(tmp$ret$13);
4266
+ }
4267
+ var endpointNames = destination_3;
4268
+ if (modelNames.r() && endpointNames.r())
4269
+ return null;
4270
+ var pkg = $this.w34_1.bt_1;
4271
+ var tmp_0 = Companion_getInstance().wt($this.w34_1.dt() + 'WirespecNativeHints');
4272
+ return file(tmp_0, SpringNativeHintsExtension$nativeHintsFile$lambda(pkg, modelNames, endpointNames, $this));
4273
+ }
4274
+ function nativeHintsClassBody($this, names) {
4275
+ var tmp;
4276
+ switch ($this.x34_1.e3_1) {
4277
+ case 1:
4278
+ tmp = kotlinNativeHintsClassBody($this, names);
4279
+ break;
4280
+ case 0:
4281
+ tmp = javaNativeHintsClassBody($this, names);
4282
+ break;
4283
+ default:
4284
+ // Inline function 'kotlin.error' call
4285
+
4286
+ var message = 'SpringNativeHintsExtension supports Kotlin and Java targets only, got ' + toString($this.x34_1);
4287
+ throw IllegalStateException_init_$Create$(toString(message));
4288
+ }
4289
+ return tmp;
4290
+ }
4291
+ function kotlinNativeHintsClassBody($this, names) {
4292
+ var registrations = joinToString(names, '\n', VOID, VOID, VOID, VOID, SpringNativeHintsExtension$kotlinNativeHintsClassBody$lambda);
4293
+ return trimMargin('\n |@Configuration\n |@ImportRuntimeHints(WirespecNativeHints.GeneratedHints::class)\n |open class WirespecNativeHints {\n |\n | class GeneratedHints : RuntimeHintsRegistrar {\n | override fun registerHints(hints: RuntimeHints, classLoader: ClassLoader?) {\n | val allMembers = MemberCategory.entries.toTypedArray()\n |' + registrations + '\n | }\n |\n | private fun registerWithInnerClasses(hints: RuntimeHints, clazz: Class<*>, categories: Array<MemberCategory>) {\n | hints.reflection().registerType(clazz, *categories)\n | for (inner in clazz.declaredClasses) {\n | registerWithInnerClasses(hints, inner, categories)\n | }\n | }\n | }\n |}\n ');
4294
+ }
4295
+ function javaNativeHintsClassBody($this, names) {
4296
+ var registrations = joinToString(names, '\n', VOID, VOID, VOID, VOID, SpringNativeHintsExtension$javaNativeHintsClassBody$lambda);
4297
+ return trimMargin('\n |@Configuration\n |@ImportRuntimeHints(WirespecNativeHints.GeneratedHints.class)\n |public class WirespecNativeHints {\n |\n | static class GeneratedHints implements RuntimeHintsRegistrar {\n | @Override\n | public void registerHints(RuntimeHints hints, ClassLoader classLoader) {\n | var allMembers = MemberCategory.values();\n |' + registrations + '\n | }\n |\n | private static void registerWithInnerClasses(RuntimeHints hints, Class<?> clazz, MemberCategory[] categories) {\n | hints.reflection().registerType(clazz, categories);\n | for (Class<?> inner : clazz.getDeclaredClasses()) {\n | registerWithInnerClasses(hints, inner, categories);\n | }\n | }\n | }\n |}\n ');
4298
+ }
4299
+ function SpringNativeHintsExtension$nativeHintsFile$lambda($pkg, $modelNames, $endpointNames, this$0) {
4300
+ return function ($this$file) {
4301
+ $this$file.e17($pkg);
4302
+ // Inline function 'kotlin.collections.forEach' call
4303
+ var _iterator__ex2g4s = $modelNames.t();
4304
+ while (_iterator__ex2g4s.u()) {
4305
+ var element = _iterator__ex2g4s.v();
4306
+ $this$file.s15($pkg + '.model', element);
4307
+ }
4308
+ // Inline function 'kotlin.collections.forEach' call
4309
+ var _iterator__ex2g4s_0 = $endpointNames.t();
4310
+ while (_iterator__ex2g4s_0.u()) {
4311
+ var element_0 = _iterator__ex2g4s_0.v();
4312
+ $this$file.s15($pkg + '.endpoint', element_0);
4313
+ }
4314
+ $this$file.s15('org.springframework.aot.hint', 'MemberCategory');
4315
+ $this$file.s15('org.springframework.aot.hint', 'RuntimeHints');
4316
+ $this$file.s15('org.springframework.aot.hint', 'RuntimeHintsRegistrar');
4317
+ $this$file.s15('org.springframework.context.annotation', 'Configuration');
4318
+ $this$file.s15('org.springframework.context.annotation', 'ImportRuntimeHints');
4319
+ $this$file.i14(nativeHintsClassBody(this$0, plus($modelNames, $endpointNames)));
4320
+ return Unit_instance;
4321
+ };
4322
+ }
4323
+ function SpringNativeHintsExtension$kotlinNativeHintsClassBody$lambda(it) {
4324
+ return ' registerWithInnerClasses(hints, ' + it + '::class.java, allMembers)';
4325
+ }
4326
+ function SpringNativeHintsExtension$javaNativeHintsClassBody$lambda(it) {
4327
+ return ' registerWithInnerClasses(hints, ' + it + '.class, allMembers);';
4328
+ }
4329
+ function SpringNativeHintsExtension(packageName, language) {
4330
+ this.w34_1 = packageName;
4331
+ this.x34_1 = language;
4332
+ }
4333
+ protoOf(SpringNativeHintsExtension).b1b = function (ir, ast) {
4334
+ return NonEmptyList__plus_impl_xqmb9(ir, listOfNotNull(nativeHintsFile(this, ast)));
4335
+ };
4336
+ //region block: init
4337
+ Companion_instance_3 = new Companion_1();
4338
+ ChannelDslFile_instance = new ChannelDslFile();
4339
+ EndpointDslFile_instance = new EndpointDslFile();
4340
+ Companion_instance_4 = new Companion_2();
4341
+ RecordBuilder_instance = new RecordBuilder();
4342
+ TypeDslFile_instance = new TypeDslFile();
4343
+ Companion_instance_5 = new Companion_3();
4344
+ //endregion
4345
+ //region block: exports
4346
+ export {
4347
+ AvroExtension as AvroExtension2wwjmwjwaw598,
4348
+ JacksonExtension as JacksonExtension2apty7n2u8qwe,
4349
+ JvmBuilderExtension as JvmBuilderExtension2kiaqxykl1i7i,
4350
+ KotestDslExtension as KotestDslExtension3b1gkjx78hy8l,
4351
+ KotlinxSerializationExtension as KotlinxSerializationExtension2mu27sgt74cx0,
4352
+ SpringMappingAnnotationsExtension as SpringMappingAnnotationsExtension2ztar9kzbv7sb,
4353
+ SpringNativeHintsExtension as SpringNativeHintsExtension1dir3w0zn6fa3,
4354
+ };
4355
+ //endregion
4356
+
4357
+ //# sourceMappingURL=wirespec-src-plugin-extensions.mjs.map