@flock/wirespec 0.17.19 → 0.18.0-RC.1

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 (87) hide show
  1. package/arrow-arrow-annotations.mjs.map +1 -1
  2. package/arrow-arrow-atomic.mjs +13 -13
  3. package/arrow-arrow-atomic.mjs.map +1 -1
  4. package/arrow-arrow-core.mjs +594 -431
  5. package/arrow-arrow-core.mjs.map +1 -1
  6. package/arrow-arrow-exception-utils.mjs +30 -0
  7. package/arrow-arrow-exception-utils.mjs.map +1 -0
  8. package/clikt-clikt-mordant.mjs +318 -0
  9. package/clikt-clikt-mordant.mjs.map +1 -0
  10. package/clikt-clikt.mjs +3834 -3696
  11. package/clikt-clikt.mjs.map +1 -1
  12. package/colormath-root-colormath.mjs +619 -682
  13. package/colormath-root-colormath.mjs.map +1 -1
  14. package/kotlin-js-core.mjs +4 -0
  15. package/kotlin-js-core.mjs.map +1 -0
  16. package/kotlin-js.mjs +4 -0
  17. package/kotlin-js.mjs.map +1 -0
  18. package/kotlin-kotlin-stdlib.mjs +6339 -5816
  19. package/kotlin-kotlin-stdlib.mjs.map +1 -1
  20. package/kotlin-openapi-bindings.mjs +8163 -8198
  21. package/kotlin-openapi-bindings.mjs.map +1 -1
  22. package/kotlin-plugins-js-plain-objects-runtime.mjs +4 -0
  23. package/kotlin-plugins-js-plain-objects-runtime.mjs.map +1 -0
  24. package/kotlin-rgxgen.mjs +2007 -2062
  25. package/kotlin-rgxgen.mjs.map +1 -1
  26. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map +1 -1
  27. package/kotlinx-atomicfu.mjs +4 -0
  28. package/kotlinx-atomicfu.mjs.map +1 -0
  29. package/kotlinx-coroutines-core.mjs +4 -0
  30. package/kotlinx-coroutines-core.mjs.map +1 -0
  31. package/kotlinx-io-kotlinx-io-bytestring.mjs.map +1 -1
  32. package/kotlinx-io-kotlinx-io-core.mjs +803 -839
  33. package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
  34. package/kotlinx-serialization-kotlinx-serialization-core.mjs +2483 -2553
  35. package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
  36. package/kotlinx-serialization-kotlinx-serialization-json.mjs +1869 -1928
  37. package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
  38. package/mordant-mordant-omnibus.mjs +4 -0
  39. package/mordant-mordant-omnibus.mjs.map +1 -0
  40. package/mordant-mordant.mjs +2532 -4425
  41. package/mordant-mordant.mjs.map +1 -1
  42. package/package.json +4 -7
  43. package/seskar-core.mjs +4 -0
  44. package/seskar-core.mjs.map +1 -0
  45. package/wirespec-bin.mjs +13 -1
  46. package/wirespec-fetch.d.ts +4 -1
  47. package/wirespec-fetch.mjs +34 -0
  48. package/wirespec-serialization.d.ts +13 -2
  49. package/wirespec-serialization.mjs +22 -1
  50. package/wirespec-src-compiler-core.mjs +2856 -3908
  51. package/wirespec-src-compiler-core.mjs.map +1 -1
  52. package/wirespec-src-compiler-emitters-java.mjs +1358 -427
  53. package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
  54. package/wirespec-src-compiler-emitters-kotlin.mjs +1010 -337
  55. package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
  56. package/wirespec-src-compiler-emitters-python.mjs +1462 -385
  57. package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
  58. package/wirespec-src-compiler-emitters-rust.mjs +2247 -0
  59. package/wirespec-src-compiler-emitters-rust.mjs.map +1 -0
  60. package/wirespec-src-compiler-emitters-scala.mjs +1018 -0
  61. package/wirespec-src-compiler-emitters-scala.mjs.map +1 -0
  62. package/wirespec-src-compiler-emitters-typescript.mjs +1540 -426
  63. package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
  64. package/wirespec-src-compiler-emitters-wirespec.mjs +119 -141
  65. package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
  66. package/wirespec-src-compiler-ir.mjs +17339 -0
  67. package/wirespec-src-compiler-ir.mjs.map +1 -0
  68. package/wirespec-src-compiler-lib.mjs +662 -728
  69. package/wirespec-src-compiler-lib.mjs.map +1 -1
  70. package/wirespec-src-converter-avro.mjs +630 -656
  71. package/wirespec-src-converter-avro.mjs.map +1 -1
  72. package/wirespec-src-converter-common.mjs.map +1 -1
  73. package/wirespec-src-converter-openapi.mjs +1705 -2024
  74. package/wirespec-src-converter-openapi.mjs.map +1 -1
  75. package/wirespec-src-plugin-arguments.mjs +418 -459
  76. package/wirespec-src-plugin-arguments.mjs.map +1 -1
  77. package/wirespec-src-plugin-cli.mjs +367 -331
  78. package/wirespec-src-plugin-cli.mjs.map +1 -1
  79. package/{wirespec-src-plugin-npm.d.ts → wirespec-src-plugin-npm.d.mts} +247 -0
  80. package/wirespec-src-plugin-npm.mjs +166 -359
  81. package/wirespec-src-plugin-npm.mjs.map +1 -1
  82. package/wirespec-src-tools-generator.mjs +79 -106
  83. package/wirespec-src-tools-generator.mjs.map +1 -1
  84. package/arrow-arrow-continuations.mjs +0 -18
  85. package/arrow-arrow-continuations.mjs.map +0 -1
  86. package/markdown.mjs +0 -6756
  87. package/markdown.mjs.map +0 -1
@@ -0,0 +1,1018 @@
1
+ import {
2
+ ArrayList_init_$Create$1jemgvhi5v0js as ArrayList_init_$Create$,
3
+ Unit_instance28fytmsmm6r23 as Unit_instance,
4
+ Paire9pteg33gng7 as Pair,
5
+ plus20p0vtfmu0596 as plus,
6
+ plus310ted5e4i90h as plus_0,
7
+ VOID3gxj6tk5isa35 as VOID,
8
+ setOf45ia9pnfhe90 as setOf,
9
+ listOfvhqybd2zx248 as listOf,
10
+ collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
11
+ ArrayList_init_$Create$3ivpeip4ouddx as ArrayList_init_$Create$_0,
12
+ listOf1jh22dvmctj1r as listOf_0,
13
+ addAll1k27qatfgp3k5 as addAll,
14
+ emptyList1g2z5xcrvp2zy as emptyList,
15
+ KProperty1ca4yb4wlo496 as KProperty1,
16
+ getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
17
+ split2bvyvnrlcifjv as split,
18
+ checkIndexOverflow3frtmheghr0th as checkIndexOverflow,
19
+ joinToString1cxrrlmo0chqs as joinToString,
20
+ StringBuilder_init_$Create$322n630qt3r8c as StringBuilder_init_$Create$,
21
+ charSequenceLength3278n89t01tmv as charSequenceLength,
22
+ charSequenceGet1vxk1y5n17t1z as charSequenceGet,
23
+ isLetterOrDigit2kuxd9e198haf as isLetterOrDigit,
24
+ _Char___init__impl__6a9atx1csff5kwtduxl as _Char___init__impl__6a9atx,
25
+ firstOrNulltrxqttxfxqju as firstOrNull,
26
+ isDigit3mimrri4wkzop as isDigit,
27
+ Char19o2r8palgjof as Char,
28
+ HashSet_init_$Create$33p49hmosnvr4 as HashSet_init_$Create$,
29
+ THROW_CCE2g6jy02ryeudk as THROW_CCE,
30
+ isInterface3d6p8outrmvmk as isInterface,
31
+ singleo93pzdgfc557 as single,
32
+ trimMarginhyd3fsmh8iev as trimMargin,
33
+ protoOf180f3jzyo7rfj as protoOf,
34
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
35
+ to2cs3ny02qtbcb as to,
36
+ toMap1vec9topfei08 as toMap,
37
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
38
+ endsWith3cq61xxngobwh as endsWith,
39
+ noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
40
+ lazy2hsh8ze7j6ikd as lazy,
41
+ firstOrNull1982767dljvdy as firstOrNull_0,
42
+ ensureNotNull1e947j3ixpazm as ensureNotNull,
43
+ } from './kotlin-kotlin-stdlib.mjs';
44
+ import {
45
+ Package2tniq694j1763 as Package,
46
+ Custom2si7lto3wompr as Custom,
47
+ Importdjdfxu3pjkxa as Import,
48
+ File3dimy4iqmuock as File,
49
+ transformChildrend9p91tpcqdkx as transformChildren,
50
+ Interface3pn84xq686t2r as Interface,
51
+ Namespace345pal554qu3j as Namespace,
52
+ Companion_getInstance3gvtuyxc9uhxj as Companion_getInstance,
53
+ withElements2toq84v08e72 as withElements,
54
+ TransformScopeyrd3lf4zrk76 as TransformScope,
55
+ TransformerBuildera6a1gvlhjj9b as TransformerBuilder,
56
+ transform3eti8i2bqvifx as transform,
57
+ Elementitq62jg6fid3 as Element,
58
+ Struct39wf79cwtn4ty as Struct,
59
+ rawttvqxl50flj9 as raw,
60
+ Nameoqr8dt2fim9d as Name,
61
+ transformChildren2mszeagj5nq4c as transformChildren_0,
62
+ sanitizeFieldName2ukb9v6ywyhle as sanitizeFieldName,
63
+ ConstructorStatement1x4n4sr59iy4n as ConstructorStatement,
64
+ FunctionCall30872kpnbr7op as FunctionCall,
65
+ SanitizationConfig1cdlo8dm6nafn as SanitizationConfig,
66
+ AccessorStyle_PROPERTIES_getInstance1nw41hme1mkqu as AccessorStyle_PROPERTIES_getInstance,
67
+ buildClientServerInterfaces2363tdgi9w3me as buildClientServerInterfaces,
68
+ convert13xvfhgrf57n5 as convert,
69
+ generateScala1gu01ibz2u66l as generateScala,
70
+ RawElement2yts1x2rbem1g as RawElement,
71
+ Constructor3io4sluuia3gk as Constructor,
72
+ RawExpression2bo7ldfrptjia as RawExpression,
73
+ withLabelField22w2j91tp01o3 as withLabelField,
74
+ Enumlszg09mwd24f as Enum,
75
+ transformChildren3n5cjwmxlhwx9 as transformChildren_1,
76
+ FieldCall1iz7z2fx2xo4p as FieldCall,
77
+ TypeParameter1x56bawg1pg87 as TypeParameter,
78
+ Function21cuq8qizkin7 as Function,
79
+ ScalaGenerator_instance3rrk4wjh7ybct as ScalaGenerator_instance,
80
+ emit3bzdcd0f6nwtj as emit,
81
+ withSharedSource1qgrajaccojj3 as withSharedSource,
82
+ emitn3eihixilqyh as emit_0,
83
+ wrapWithPackagedyp8fwgcgbx0 as wrapWithPackage,
84
+ convertWithValidation3ar3nbcqsbkpn as convertWithValidation,
85
+ sanitizeNames3w41y78hqenku as sanitizeNames,
86
+ convert11ert2po54h1y as convert_0,
87
+ convert37aabdzvtv9vg as convert_1,
88
+ convert17zcptkz4mhr4 as convert_2,
89
+ convert32tuiui3czihh as convert_3,
90
+ flattenNestedStructs3rzqu1ggdb6h2 as flattenNestedStructs,
91
+ convert1cn4bolzoed8c as convert_4,
92
+ emitEndpointClient1meajc90wf3el as emitEndpointClient,
93
+ emitClient32kfwzg2hm5vj as emitClient,
94
+ emit1oxjujel6f3jb as emit_1,
95
+ IrEmitterh2m93ojzvkep as IrEmitter,
96
+ } from './wirespec-src-compiler-ir.mjs';
97
+ import {
98
+ Companion_instancebcq57hoyp8c2 as Companion_instance,
99
+ FieldIdentifier34k7iphndcnl0 as FieldIdentifier,
100
+ addBackticks1di5q03fw4yhx as addBackticks,
101
+ importReferencesy4xv7r53sjjs as importReferences,
102
+ Shared1uygqfbd22ukz as Shared,
103
+ Companion_instance1a2xqc448tlhh as Companion_instance_0,
104
+ Paramvfwnys2w6aj1 as Param,
105
+ Literal331hu9r04vptz as Literal,
106
+ Companion_instance2ryk3262e300f as Companion_instance_1,
107
+ FileExtension_Scala_getInstancedd4dbv51x4if as FileExtension_Scala_getInstance,
108
+ plus14o24vdaiongg as plus_1,
109
+ } from './wirespec-src-compiler-core.mjs';
110
+ //region block: imports
111
+ //endregion
112
+ //region block: pre-declaration
113
+ initMetadataForCompanion(Companion);
114
+ initMetadataForClass(ScalaIrEmitter$shared$1);
115
+ initMetadataForClass(ScalaIrEmitter, 'ScalaIrEmitter', ScalaIrEmitter, VOID, [IrEmitter]);
116
+ //endregion
117
+ function ScalaIrEmitter$shared$o$source$lambda(element, transformer) {
118
+ var tmp;
119
+ if (element instanceof File) {
120
+ // Inline function 'kotlin.collections.partition' call
121
+ var this_0 = element.r1m_1;
122
+ var first = ArrayList_init_$Create$();
123
+ var second = ArrayList_init_$Create$();
124
+ var _iterator__ex2g4s = this_0.t();
125
+ while (_iterator__ex2g4s.u()) {
126
+ var element_0 = _iterator__ex2g4s.v();
127
+ if (element_0 instanceof Package) {
128
+ first.x(element_0);
129
+ } else {
130
+ second.x(element_0);
131
+ }
132
+ }
133
+ var _destruct__k2r9zo = new Pair(first, second);
134
+ var packageElements = _destruct__k2r9zo.oe();
135
+ var rest = _destruct__k2r9zo.pe();
136
+ tmp = element.u1m(VOID, plus_0(plus(packageElements, new Import('scala.reflect', new Custom('ClassTag'))), rest));
137
+ } else {
138
+ tmp = element;
139
+ }
140
+ var transformed = tmp;
141
+ return transformChildren(transformed, transformer);
142
+ }
143
+ function ScalaIrEmitter$shared$o$source$lambda_0(element, transformer) {
144
+ var tmp;
145
+ if (element instanceof Namespace) {
146
+ var tmp_0;
147
+ if (element.a1n_1.equals(Companion_getInstance().o1h('Wirespec'))) {
148
+ // Inline function 'kotlin.collections.flatMap' call
149
+ var tmp0 = element.b1n_1;
150
+ // Inline function 'kotlin.collections.flatMapTo' call
151
+ var destination = ArrayList_init_$Create$();
152
+ var _iterator__ex2g4s = tmp0.t();
153
+ while (_iterator__ex2g4s.u()) {
154
+ var element_0 = _iterator__ex2g4s.v();
155
+ var tmp_1;
156
+ var tmp_2;
157
+ if (element_0 instanceof Interface) {
158
+ tmp_2 = setOf(['Request', 'Response']).h1(element_0.o1o_1.u1l());
159
+ } else {
160
+ tmp_2 = false;
161
+ }
162
+ if (tmp_2) {
163
+ // Inline function 'kotlin.collections.filterIsInstance' call
164
+ var tmp0_0 = element_0.p1o_1;
165
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
166
+ var destination_0 = ArrayList_init_$Create$();
167
+ var _iterator__ex2g4s_0 = tmp0_0.t();
168
+ while (_iterator__ex2g4s_0.u()) {
169
+ var element_1 = _iterator__ex2g4s_0.v();
170
+ if (element_1 instanceof Interface) {
171
+ destination_0.x(element_1);
172
+ }
173
+ }
174
+ var tmp$ret$3;
175
+ $l$block: {
176
+ // Inline function 'kotlin.collections.firstOrNull' call
177
+ var _iterator__ex2g4s_1 = destination_0.t();
178
+ while (_iterator__ex2g4s_1.u()) {
179
+ var element_2 = _iterator__ex2g4s_1.v();
180
+ if (element_2.o1o_1.u1l() === 'Headers') {
181
+ tmp$ret$3 = element_2;
182
+ break $l$block;
183
+ }
184
+ }
185
+ tmp$ret$3 = null;
186
+ }
187
+ var nestedHeaders = tmp$ret$3;
188
+ var tmp_3;
189
+ if (!(nestedHeaders == null)) {
190
+ var tmp_4 = new Namespace(element_0.o1o_1, listOf(nestedHeaders));
191
+ // Inline function 'kotlin.collections.filter' call
192
+ var tmp0_1 = element_0.p1o_1;
193
+ // Inline function 'kotlin.collections.filterTo' call
194
+ var destination_1 = ArrayList_init_$Create$();
195
+ var _iterator__ex2g4s_2 = tmp0_1.t();
196
+ while (_iterator__ex2g4s_2.u()) {
197
+ var element_3 = _iterator__ex2g4s_2.v();
198
+ var tmp_5;
199
+ if (element_3 instanceof Interface) {
200
+ tmp_5 = element_3.o1o_1.u1l() === 'Headers';
201
+ } else {
202
+ tmp_5 = false;
203
+ }
204
+ if (!tmp_5) {
205
+ destination_1.x(element_3);
206
+ }
207
+ }
208
+ var tmp_6 = destination_1;
209
+ // Inline function 'kotlin.collections.map' call
210
+ var this_0 = element_0.t1o_1;
211
+ // Inline function 'kotlin.collections.mapTo' call
212
+ var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
213
+ var _iterator__ex2g4s_3 = this_0.t();
214
+ while (_iterator__ex2g4s_3.u()) {
215
+ var item = _iterator__ex2g4s_3.v();
216
+ var tmp_7;
217
+ if (item.n1n_1.u1h() === 'headers') {
218
+ tmp_7 = item.r1n(VOID, new Custom(element_0.o1o_1.u1l() + '.Headers'));
219
+ } else {
220
+ tmp_7 = item;
221
+ }
222
+ var tmp$ret$7 = tmp_7;
223
+ destination_2.x(tmp$ret$7);
224
+ }
225
+ tmp_3 = listOf_0([tmp_4, element_0.v1o(VOID, tmp_6, VOID, VOID, VOID, destination_2)]);
226
+ } else {
227
+ tmp_3 = listOf(element_0);
228
+ }
229
+ tmp_1 = tmp_3;
230
+ } else {
231
+ tmp_1 = listOf(element_0);
232
+ }
233
+ var list = tmp_1;
234
+ addAll(destination, list);
235
+ }
236
+ var newElements = destination;
237
+ tmp_0 = element.e1n(VOID, newElements);
238
+ } else {
239
+ tmp_0 = element;
240
+ }
241
+ tmp = tmp_0;
242
+ } else {
243
+ tmp = element;
244
+ }
245
+ var transformed = tmp;
246
+ return transformChildren(transformed, transformer);
247
+ }
248
+ function ScalaIrEmitter$shared$o$source$lambda_1(this$0) {
249
+ return function (element, transformer) {
250
+ var tmp;
251
+ if (element instanceof Namespace) {
252
+ var injected = element.a1n_1.equals(Companion_getInstance().o1h('Wirespec')) ? this$0.w1z_1 : emptyList();
253
+ var tmp_0;
254
+ // Inline function 'kotlin.collections.isNotEmpty' call
255
+ if (!injected.r()) {
256
+ tmp_0 = withElements(element, plus_0(element.s1m(), injected));
257
+ } else {
258
+ tmp_0 = element;
259
+ }
260
+ tmp = tmp_0;
261
+ } else {
262
+ tmp = element;
263
+ }
264
+ var transformed = tmp;
265
+ return transformChildren(transformed, transformer);
266
+ };
267
+ }
268
+ function _get_sanitizationConfig__sns434($this) {
269
+ var tmp0 = $this.d20_1;
270
+ var tmp = KProperty1;
271
+ // Inline function 'kotlin.getValue' call
272
+ getPropertyCallableRef('sanitizationConfig', 1, tmp, ScalaIrEmitter$_get_sanitizationConfig_$ref_ydarb0(), null);
273
+ return tmp0.n1();
274
+ }
275
+ function sanitize($this, _this__u8e3s4) {
276
+ // Inline function 'kotlin.collections.mapIndexed' call
277
+ var this_0 = split(_this__u8e3s4.n1(), ['.', ' ']);
278
+ // Inline function 'kotlin.collections.mapIndexedTo' call
279
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
280
+ var index = 0;
281
+ var _iterator__ex2g4s = this_0.t();
282
+ while (_iterator__ex2g4s.u()) {
283
+ var item = _iterator__ex2g4s.v();
284
+ var _unary__edvuaz = index;
285
+ index = _unary__edvuaz + 1 | 0;
286
+ var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance.qq(item) : item;
287
+ destination.x(tmp$ret$0);
288
+ }
289
+ // Inline function 'kotlin.text.filter' call
290
+ var tmp0 = joinToString(destination, '');
291
+ // Inline function 'kotlin.text.filterTo' call
292
+ var destination_0 = StringBuilder_init_$Create$();
293
+ var inductionVariable = 0;
294
+ var last = charSequenceLength(tmp0);
295
+ if (inductionVariable < last)
296
+ do {
297
+ var index_0 = inductionVariable;
298
+ inductionVariable = inductionVariable + 1 | 0;
299
+ var element = charSequenceGet(tmp0, index_0);
300
+ if (isLetterOrDigit(element) || element === _Char___init__impl__6a9atx(95)) {
301
+ destination_0.s(element);
302
+ }
303
+ }
304
+ while (inductionVariable < last);
305
+ var tmp$ret$5 = destination_0.toString();
306
+ // Inline function 'kotlin.let' call
307
+ var it = sanitizeFirstIsDigit($this, tmp$ret$5);
308
+ var tmp;
309
+ if (_this__u8e3s4 instanceof FieldIdentifier) {
310
+ tmp = sanitizeKeywords($this, it);
311
+ } else {
312
+ tmp = it;
313
+ }
314
+ return tmp;
315
+ }
316
+ function sanitizeFirstIsDigit($this, _this__u8e3s4) {
317
+ var tmp;
318
+ var tmp0_safe_receiver = firstOrNull(_this__u8e3s4);
319
+ var tmp_0;
320
+ var tmp_1 = tmp0_safe_receiver;
321
+ if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
322
+ tmp_0 = null;
323
+ } else {
324
+ tmp_0 = isDigit(tmp0_safe_receiver);
325
+ }
326
+ if (tmp_0 === true) {
327
+ tmp = '_' + _this__u8e3s4;
328
+ } else {
329
+ tmp = _this__u8e3s4;
330
+ }
331
+ return tmp;
332
+ }
333
+ function sanitizeKeywords($this, _this__u8e3s4) {
334
+ return Companion_getInstance_0().f20_1.h1(_this__u8e3s4) ? addBackticks(_this__u8e3s4) : _this__u8e3s4;
335
+ }
336
+ function sanitizeSymbol($this, _this__u8e3s4) {
337
+ // Inline function 'kotlin.collections.mapIndexed' call
338
+ var this_0 = split(_this__u8e3s4, ['.', ' ', '-']);
339
+ // Inline function 'kotlin.collections.mapIndexedTo' call
340
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
341
+ var index = 0;
342
+ var _iterator__ex2g4s = this_0.t();
343
+ while (_iterator__ex2g4s.u()) {
344
+ var item = _iterator__ex2g4s.v();
345
+ var _unary__edvuaz = index;
346
+ index = _unary__edvuaz + 1 | 0;
347
+ var tmp$ret$0 = checkIndexOverflow(_unary__edvuaz) > 0 ? Companion_instance.qq(item) : item;
348
+ destination.x(tmp$ret$0);
349
+ }
350
+ // Inline function 'kotlin.text.filter' call
351
+ var tmp0 = joinToString(destination, '');
352
+ // Inline function 'kotlin.text.filterTo' call
353
+ var destination_0 = StringBuilder_init_$Create$();
354
+ var inductionVariable = 0;
355
+ var last = charSequenceLength(tmp0);
356
+ if (inductionVariable < last)
357
+ do {
358
+ var index_0 = inductionVariable;
359
+ inductionVariable = inductionVariable + 1 | 0;
360
+ var element = charSequenceGet(tmp0, index_0);
361
+ if (isLetterOrDigit(element) || element === _Char___init__impl__6a9atx(95)) {
362
+ destination_0.s(element);
363
+ }
364
+ }
365
+ while (inductionVariable < last);
366
+ var tmp$ret$5 = destination_0.toString();
367
+ return sanitizeFirstIsDigit($this, tmp$ret$5);
368
+ }
369
+ function sanitizeEnum($this, _this__u8e3s4) {
370
+ return sanitizeKeywords($this, sanitizeFirstIsDigit($this, joinToString(split(_this__u8e3s4, ['-', ', ', '.', ' ', '//']), '_')));
371
+ }
372
+ function buildImports($this, _this__u8e3s4) {
373
+ // Inline function 'kotlin.collections.distinctBy' call
374
+ var this_0 = importReferences(_this__u8e3s4);
375
+ var set = HashSet_init_$Create$();
376
+ var list = ArrayList_init_$Create$();
377
+ var _iterator__ex2g4s = this_0.t();
378
+ while (_iterator__ex2g4s.u()) {
379
+ var e = _iterator__ex2g4s.v();
380
+ var key = e.nu_1;
381
+ if (set.x(key)) {
382
+ list.x(e);
383
+ }
384
+ }
385
+ var tmp = list;
386
+ return joinToString(tmp, '\n', VOID, VOID, VOID, VOID, ScalaIrEmitter$buildImports$lambda($this));
387
+ }
388
+ function addIdentityTypeToCall($this, _this__u8e3s4) {
389
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
390
+ var scope = new TransformScope(_this__u8e3s4);
391
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
392
+ var tmp = scope;
393
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
394
+ var this_0 = scope.a1u_1;
395
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
396
+ // Inline function 'kotlin.apply' call
397
+ var this_1 = new TransformerBuilder();
398
+ this_1.f1h(ScalaIrEmitter$addIdentityTypeToCall$lambda);
399
+ var tmp$ret$2 = this_1.g1h();
400
+ tmp.a1u_1 = transform(this_0, tmp$ret$2);
401
+ var tmp_0 = scope.a1u_1;
402
+ return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
403
+ }
404
+ function isRequestObject($this, namespace) {
405
+ // Inline function 'kotlin.collections.filterIsInstance' call
406
+ var tmp0 = namespace.b1n_1;
407
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
408
+ var destination = ArrayList_init_$Create$();
409
+ var _iterator__ex2g4s = tmp0.t();
410
+ while (_iterator__ex2g4s.u()) {
411
+ var element = _iterator__ex2g4s.v();
412
+ if (element instanceof Struct) {
413
+ destination.x(element);
414
+ }
415
+ }
416
+ var tmp$ret$3;
417
+ $l$block: {
418
+ // Inline function 'kotlin.collections.firstOrNull' call
419
+ var _iterator__ex2g4s_0 = destination.t();
420
+ while (_iterator__ex2g4s_0.u()) {
421
+ var element_0 = _iterator__ex2g4s_0.v();
422
+ if (element_0.g1n_1.u1l() === 'Request') {
423
+ tmp$ret$3 = element_0;
424
+ break $l$block;
425
+ }
426
+ }
427
+ tmp$ret$3 = null;
428
+ }
429
+ var tmp0_elvis_lhs = tmp$ret$3;
430
+ var tmp;
431
+ if (tmp0_elvis_lhs == null) {
432
+ return false;
433
+ } else {
434
+ tmp = tmp0_elvis_lhs;
435
+ }
436
+ var requestStruct = tmp;
437
+ return requestStruct.i1n_1.a1() === 1 && single(requestStruct.i1n_1).s1n_1.r() || (requestStruct.h1n_1.r() && requestStruct.i1n_1.r());
438
+ }
439
+ function injectHandleFunction($this, _this__u8e3s4) {
440
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
441
+ var scope = new TransformScope(_this__u8e3s4);
442
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
443
+ var tmp = scope;
444
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
445
+ var this_0 = scope.a1u_1;
446
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
447
+ // Inline function 'kotlin.apply' call
448
+ var this_1 = new TransformerBuilder();
449
+ this_1.f1h(ScalaIrEmitter$injectHandleFunction$lambda);
450
+ var tmp$ret$2 = this_1.g1h();
451
+ tmp.a1u_1 = transform(this_0, tmp$ret$2);
452
+ var tmp_0 = scope.a1u_1;
453
+ return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
454
+ }
455
+ function buildClientServerObjects($this, endpoint, requestIsObject, namespace) {
456
+ var reqType = requestIsObject ? 'Request.type' : 'Request';
457
+ var pathTemplate = '/' + joinToString(endpoint.ip_1, '/', VOID, VOID, VOID, VOID, ScalaIrEmitter$buildClientServerObjects$lambda);
458
+ var clientObject = raw(trimMargin('\n |object Client extends Wirespec.Client[' + reqType + ', Response[?]] {\n | override val pathTemplate: String = "' + pathTemplate + '"\n | override val method: String = "' + endpoint.hp_1.toString() + '"\n | override def client(serialization: Wirespec.Serialization): Wirespec.ClientEdge[' + reqType + ', Response[?]] = new Wirespec.ClientEdge[' + reqType + ', Response[?]] {\n | override def to(request: ' + reqType + '): Wirespec.RawRequest = toRawRequest(serialization, request)\n | override def from(response: Wirespec.RawResponse): Response[?] = fromRawResponse(serialization, response)\n | }\n |}\n '));
459
+ var serverObject = raw(trimMargin('\n |object Server extends Wirespec.Server[' + reqType + ', Response[?]] {\n | override val pathTemplate: String = "' + pathTemplate + '"\n | override val method: String = "' + endpoint.hp_1.toString() + '"\n | override def server(serialization: Wirespec.Serialization): Wirespec.ServerEdge[' + reqType + ', Response[?]] = new Wirespec.ServerEdge[' + reqType + ', Response[?]] {\n | override def from(request: Wirespec.RawRequest): ' + reqType + ' = fromRawRequest(serialization, request)\n | override def to(response: Response[?]): Wirespec.RawResponse = toRawResponse(serialization, response)\n | }\n |}\n '));
460
+ return namespace.e1n(VOID, plus(plus(namespace.b1n_1, clientObject), serverObject));
461
+ }
462
+ function Companion() {
463
+ Companion_instance_2 = this;
464
+ this.f20_1 = setOf(['abstract', 'case', 'class', 'def', 'do', 'else', 'extends', 'false', 'final', 'for', 'forSome', 'if', 'implicit', 'import', 'lazy', 'match', 'new', 'null', 'object', 'override', 'package', 'private', 'protected', 'return', 'sealed', 'super', 'this', 'throw', 'trait', 'true', 'try', 'type', 'val', 'var', 'while', 'with', 'yield', 'given', 'using', 'enum', 'export', 'then']);
465
+ }
466
+ var Companion_instance_2;
467
+ function Companion_getInstance_0() {
468
+ if (Companion_instance_2 == null)
469
+ new Companion();
470
+ return Companion_instance_2;
471
+ }
472
+ function ScalaIrEmitter$sanitizationConfig$delegate$lambda$lambda(it) {
473
+ return addBackticks(it);
474
+ }
475
+ function ScalaIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0) {
476
+ return function (name) {
477
+ var sanitized = name.p1h_1.a1() > 1 ? name.t1l() : sanitizeSymbol(this$0, name.u1h());
478
+ return new Name(listOf(sanitized));
479
+ };
480
+ }
481
+ function ScalaIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0) {
482
+ return function (name) {
483
+ return new Name(listOf(sanitizeSymbol(this$0, name.t1l())));
484
+ };
485
+ }
486
+ function ScalaIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(this$0) {
487
+ return function (it) {
488
+ return sanitizeSymbol(this$0, it);
489
+ };
490
+ }
491
+ function ScalaIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0) {
492
+ return function (stmt, tr) {
493
+ var tmp;
494
+ if (stmt instanceof FunctionCall) {
495
+ var tmp_0;
496
+ if (stmt.y1l_1.u1h() === 'validate') {
497
+ tmp_0 = transformChildren_0(stmt.c1m(VOID, emptyList()), tr);
498
+ } else {
499
+ tmp_0 = transformChildren_0(stmt, tr);
500
+ }
501
+ tmp = tmp_0;
502
+ } else {
503
+ if (stmt instanceof ConstructorStatement) {
504
+ var tmp_1 = tr.s1t(stmt.m1m_1);
505
+ // Inline function 'kotlin.collections.map' call
506
+ var this_0 = stmt.n1m_1;
507
+ // Inline function 'kotlin.collections.mapTo' call
508
+ var destination = ArrayList_init_$Create$_0(this_0.a1());
509
+ // Inline function 'kotlin.collections.iterator' call
510
+ var _iterator__ex2g4s = this_0.l1().t();
511
+ while (_iterator__ex2g4s.u()) {
512
+ var item = _iterator__ex2g4s.v();
513
+ // Inline function 'kotlin.collections.component1' call
514
+ var name = item.m1();
515
+ // Inline function 'kotlin.collections.component2' call
516
+ var expr = item.n1();
517
+ var tmp$ret$3 = to(sanitizeFieldName(_get_sanitizationConfig__sns434(this$0), name), tr.v1t(expr));
518
+ destination.x(tmp$ret$3);
519
+ }
520
+ tmp = new ConstructorStatement(tmp_1, toMap(destination));
521
+ } else {
522
+ tmp = transformChildren_0(stmt, tr);
523
+ }
524
+ }
525
+ return tmp;
526
+ };
527
+ }
528
+ function ScalaIrEmitter$sanitizationConfig$delegate$lambda(this$0) {
529
+ return function () {
530
+ var tmp = Companion_getInstance_0().f20_1;
531
+ var tmp_0 = ScalaIrEmitter$sanitizationConfig$delegate$lambda$lambda;
532
+ var tmp_1 = ScalaIrEmitter$sanitizationConfig$delegate$lambda$lambda_0(this$0);
533
+ var tmp_2 = ScalaIrEmitter$sanitizationConfig$delegate$lambda$lambda_1(this$0);
534
+ var tmp_3 = ScalaIrEmitter$sanitizationConfig$delegate$lambda$lambda_2(this$0);
535
+ return new SanitizationConfig(tmp, tmp_0, tmp_1, tmp_2, tmp_3, ScalaIrEmitter$sanitizationConfig$delegate$lambda$lambda_3(this$0));
536
+ };
537
+ }
538
+ function ScalaIrEmitter$_get_sanitizationConfig_$ref_ydarb0() {
539
+ return function (p0) {
540
+ return _get_sanitizationConfig__sns434(p0);
541
+ };
542
+ }
543
+ function ScalaIrEmitter$shared$1() {
544
+ this.v1z_1 = 'community.flock.wirespec.scala';
545
+ this.w1z_1 = buildClientServerInterfaces(AccessorStyle_PROPERTIES_getInstance());
546
+ var tmp = this;
547
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
548
+ var this_0 = convert(new Shared(this.v1z_1));
549
+ var scope = new TransformScope(this_0);
550
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
551
+ var tmp_0 = scope;
552
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
553
+ var this_1 = scope.a1u_1;
554
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
555
+ // Inline function 'kotlin.apply' call
556
+ var this_2 = new TransformerBuilder();
557
+ this_2.f1h(ScalaIrEmitter$shared$o$source$lambda);
558
+ var tmp$ret$2 = this_2.g1h();
559
+ tmp_0.a1u_1 = transform(this_1, tmp$ret$2);
560
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
561
+ var tmp_1 = scope;
562
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
563
+ var this_3 = scope.a1u_1;
564
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
565
+ // Inline function 'kotlin.apply' call
566
+ var this_4 = new TransformerBuilder();
567
+ this_4.f1h(ScalaIrEmitter$shared$o$source$lambda_0);
568
+ var tmp$ret$7 = this_4.g1h();
569
+ tmp_1.a1u_1 = transform(this_3, tmp$ret$7);
570
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.injectAfter' call
571
+ var tmp_2 = scope;
572
+ // Inline function 'community.flock.wirespec.ir.core.injectAfter' call
573
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
574
+ var this_5 = scope.a1u_1;
575
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
576
+ // Inline function 'kotlin.apply' call
577
+ var this_6 = new TransformerBuilder();
578
+ this_6.f1h(ScalaIrEmitter$shared$o$source$lambda_1(this));
579
+ var tmp$ret$12 = this_6.g1h();
580
+ tmp_2.a1u_1 = transform(this_5, tmp$ret$12);
581
+ var tmp_3 = scope.a1u_1;
582
+ var tmp$ret$17 = isInterface(tmp_3, Element) ? tmp_3 : THROW_CCE();
583
+ tmp.x1z_1 = generateScala(tmp$ret$17);
584
+ }
585
+ protoOf(ScalaIrEmitter$shared$1).s1w = function () {
586
+ return this.x1z_1;
587
+ };
588
+ function ScalaIrEmitter$emit$lambda(this$0) {
589
+ return function () {
590
+ return new File(Companion_getInstance().o1h(Companion_instance_0.nr('community.flock.wirespec.scala').qr() + 'Wirespec'), listOf(new RawElement(this$0.u1v().s1w())));
591
+ };
592
+ }
593
+ function ScalaIrEmitter$emit$lambda_0(element, transformer) {
594
+ var tmp;
595
+ if (element instanceof Struct) {
596
+ tmp = element.h1n_1.r() ? element.m1n(VOID, VOID, listOf(new Constructor(emptyList(), emptyList()))) : element;
597
+ } else {
598
+ tmp = element;
599
+ }
600
+ var transformed = tmp;
601
+ return transformChildren(transformed, transformer);
602
+ }
603
+ function ScalaIrEmitter$emit$lambda$lambda(this$0) {
604
+ return function (it) {
605
+ return sanitizeEnum(this$0, it);
606
+ };
607
+ }
608
+ function ScalaIrEmitter$emit$lambda_1(this$0) {
609
+ return function (element, transformer) {
610
+ var tmp;
611
+ if (element instanceof Enum) {
612
+ tmp = withLabelField(element, ScalaIrEmitter$emit$lambda$lambda(this$0), true, new RawExpression('label'));
613
+ } else {
614
+ tmp = element;
615
+ }
616
+ var transformed = tmp;
617
+ return transformChildren(transformed, transformer);
618
+ };
619
+ }
620
+ function ScalaIrEmitter$emit$lambda_2(expr, tr) {
621
+ var tmp;
622
+ var tmp_0;
623
+ var tmp_1;
624
+ if (expr instanceof FunctionCall) {
625
+ tmp_1 = expr.y1l_1.t1l() === 'toString';
626
+ } else {
627
+ tmp_1 = false;
628
+ }
629
+ if (tmp_1) {
630
+ tmp_0 = !(expr.w1l_1 == null);
631
+ } else {
632
+ tmp_0 = false;
633
+ }
634
+ if (tmp_0) {
635
+ var tmp0_safe_receiver = expr.w1l_1;
636
+ var tmp_2;
637
+ if (tmp0_safe_receiver == null) {
638
+ tmp_2 = null;
639
+ } else {
640
+ // Inline function 'kotlin.let' call
641
+ tmp_2 = tr.v1t(tmp0_safe_receiver);
642
+ }
643
+ tmp = new FieldCall(tmp_2, Companion_getInstance().o1h('toString'));
644
+ } else {
645
+ tmp = transformChildren_1(expr, tr);
646
+ }
647
+ return tmp;
648
+ }
649
+ function ScalaIrEmitter$emitClient$lambda(this$0) {
650
+ return function (it) {
651
+ return 'import ' + this$0.l1v().or_1 + '.model.' + it.nu_1;
652
+ };
653
+ }
654
+ function ScalaIrEmitter$emitClient$lambda_0(this$0) {
655
+ return function (it) {
656
+ return 'import ' + this$0.l1v().or_1 + '.endpoint.' + it.gp_1.n1();
657
+ };
658
+ }
659
+ function ScalaIrEmitter$emitClient$lambda_1(this$0) {
660
+ return function (it) {
661
+ return 'import ' + this$0.l1v().or_1 + '.client.' + it.gp_1.n1() + 'Client';
662
+ };
663
+ }
664
+ function ScalaIrEmitter$buildImports$lambda(this$0) {
665
+ return function (it) {
666
+ return 'import ' + this$0.l1v().or_1 + '.model.' + it.nu_1;
667
+ };
668
+ }
669
+ function ScalaIrEmitter$addIdentityTypeToCall$lambda(element, transformer) {
670
+ var tmp;
671
+ if (element instanceof Struct) {
672
+ // Inline function 'kotlin.collections.map' call
673
+ var this_0 = element.j1n_1;
674
+ // Inline function 'kotlin.collections.mapTo' call
675
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
676
+ var _iterator__ex2g4s = this_0.t();
677
+ while (_iterator__ex2g4s.u()) {
678
+ var item = _iterator__ex2g4s.v();
679
+ var tmp_0;
680
+ var tmp_1;
681
+ if (item instanceof Custom) {
682
+ tmp_1 = endsWith(item.s1h_1, '.Call');
683
+ } else {
684
+ tmp_1 = false;
685
+ }
686
+ if (tmp_1) {
687
+ tmp_0 = item.k1m(VOID, listOf(new Custom('[A] =>> A')));
688
+ } else {
689
+ tmp_0 = item;
690
+ }
691
+ var tmp$ret$0 = tmp_0;
692
+ destination.x(tmp$ret$0);
693
+ }
694
+ tmp = element.m1n(VOID, VOID, VOID, destination);
695
+ } else {
696
+ tmp = element;
697
+ }
698
+ var transformed = tmp;
699
+ return transformChildren(transformed, transformer);
700
+ }
701
+ function ScalaIrEmitter$injectHandleFunction$lambda(element, transformer) {
702
+ var tmp;
703
+ if (element instanceof Interface) {
704
+ var tmp_0;
705
+ if (element.o1o_1.equals(Companion_getInstance().o1h('Handler')) || element.o1o_1.equals(Companion_getInstance().o1h('Call'))) {
706
+ var tmp0_typeParameters = listOf(new TypeParameter(new Custom('F[_]')));
707
+ // Inline function 'kotlin.collections.map' call
708
+ var this_0 = element.p1o_1;
709
+ // Inline function 'kotlin.collections.mapTo' call
710
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
711
+ var _iterator__ex2g4s = this_0.t();
712
+ while (_iterator__ex2g4s.u()) {
713
+ var item = _iterator__ex2g4s.v();
714
+ var tmp_1;
715
+ if (item instanceof Function) {
716
+ var tmp0_safe_receiver = item.y1j_1;
717
+ var tmp_2;
718
+ if (tmp0_safe_receiver == null) {
719
+ tmp_2 = null;
720
+ } else {
721
+ // Inline function 'kotlin.let' call
722
+ tmp_2 = new Custom('F', listOf(tmp0_safe_receiver));
723
+ }
724
+ var tmp2_returnType = tmp_2;
725
+ tmp_1 = item.d1k(VOID, VOID, VOID, tmp2_returnType, VOID, false);
726
+ } else {
727
+ tmp_1 = item;
728
+ }
729
+ var tmp$ret$2 = tmp_1;
730
+ destination.x(tmp$ret$2);
731
+ }
732
+ tmp_0 = element.v1o(VOID, destination, VOID, VOID, tmp0_typeParameters);
733
+ } else {
734
+ tmp_0 = element;
735
+ }
736
+ tmp = tmp_0;
737
+ } else {
738
+ tmp = element;
739
+ }
740
+ var transformed = tmp;
741
+ return transformChildren(transformed, transformer);
742
+ }
743
+ function ScalaIrEmitter$buildClientServerObjects$lambda(it) {
744
+ var tmp;
745
+ if (it instanceof Literal) {
746
+ tmp = it.jq_1;
747
+ } else {
748
+ if (it instanceof Param) {
749
+ tmp = '{' + it.np_1.n1() + '}';
750
+ } else {
751
+ noWhenBranchMatchedException();
752
+ }
753
+ }
754
+ return tmp;
755
+ }
756
+ function ScalaIrEmitter(packageName, emitShared) {
757
+ Companion_getInstance_0();
758
+ packageName = packageName === VOID ? Companion_instance_0.nr('community.flock.wirespec.generated') : packageName;
759
+ emitShared = emitShared === VOID ? Companion_instance_1.io() : emitShared;
760
+ this.y1z_1 = packageName;
761
+ this.z1z_1 = emitShared;
762
+ this.a20_1 = ScalaGenerator_instance;
763
+ this.b20_1 = FileExtension_Scala_getInstance();
764
+ this.c20_1 = '\nimport community.flock.wirespec.scala.Wirespec\nimport scala.reflect.ClassTag\n';
765
+ var tmp = this;
766
+ tmp.d20_1 = lazy(ScalaIrEmitter$sanitizationConfig$delegate$lambda(this));
767
+ var tmp_0 = this;
768
+ tmp_0.e20_1 = new ScalaIrEmitter$shared$1();
769
+ }
770
+ protoOf(ScalaIrEmitter).l1v = function () {
771
+ return this.y1z_1;
772
+ };
773
+ protoOf(ScalaIrEmitter).n1u = function () {
774
+ return this.a20_1;
775
+ };
776
+ protoOf(ScalaIrEmitter).gq = function () {
777
+ return this.b20_1;
778
+ };
779
+ protoOf(ScalaIrEmitter).u1v = function () {
780
+ return this.e20_1;
781
+ };
782
+ protoOf(ScalaIrEmitter).o1u = function (module_0, logger) {
783
+ var tmp = emit.call(this, module_0, logger);
784
+ return withSharedSource(tmp, this.z1z_1, ScalaIrEmitter$emit$lambda(this));
785
+ };
786
+ protoOf(ScalaIrEmitter).wq = function (definition, module_0, logger) {
787
+ var file = emit_0.call(this, definition, module_0, logger);
788
+ return wrapWithPackage(file, this.l1v(), definition, new RawElement(this.c20_1), Companion_instance.sq(module_0));
789
+ };
790
+ protoOf(ScalaIrEmitter).wp = function (type, module_0) {
791
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
792
+ var this_0 = sanitizeNames(convertWithValidation(type, module_0), _get_sanitizationConfig__sns434(this));
793
+ var scope = new TransformScope(this_0);
794
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
795
+ var tmp = scope;
796
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
797
+ var this_1 = scope.a1u_1;
798
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
799
+ // Inline function 'kotlin.apply' call
800
+ var this_2 = new TransformerBuilder();
801
+ this_2.f1h(ScalaIrEmitter$emit$lambda_0);
802
+ var tmp$ret$2 = this_2.g1h();
803
+ tmp.a1u_1 = transform(this_1, tmp$ret$2);
804
+ var tmp_0 = scope.a1u_1;
805
+ return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
806
+ };
807
+ protoOf(ScalaIrEmitter).kr = function (enum_0, module_0) {
808
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
809
+ var this_0 = sanitizeNames(convert_0(enum_0), _get_sanitizationConfig__sns434(this));
810
+ var scope = new TransformScope(this_0);
811
+ // Inline function 'community.flock.wirespec.ir.core.TransformScope.matchingElements' call
812
+ var tmp = scope;
813
+ // Inline function 'community.flock.wirespec.ir.core.transformMatchingElements' call
814
+ var this_1 = scope.a1u_1;
815
+ // Inline function 'community.flock.wirespec.ir.core.transformer' call
816
+ // Inline function 'kotlin.apply' call
817
+ var this_2 = new TransformerBuilder();
818
+ this_2.f1h(ScalaIrEmitter$emit$lambda_1(this));
819
+ var tmp$ret$2 = this_2.g1h();
820
+ tmp.a1u_1 = transform(this_1, tmp$ret$2);
821
+ var tmp_0 = scope.a1u_1;
822
+ return isInterface(tmp_0, Element) ? tmp_0 : THROW_CCE();
823
+ };
824
+ protoOf(ScalaIrEmitter).ar = function (union) {
825
+ return sanitizeNames(convert_1(union), _get_sanitizationConfig__sns434(this));
826
+ };
827
+ protoOf(ScalaIrEmitter).fr = function (refined) {
828
+ var file = sanitizeNames(convert_2(refined), _get_sanitizationConfig__sns434(this));
829
+ // Inline function 'community.flock.wirespec.ir.core.findElement' call
830
+ // Inline function 'kotlin.collections.filterIsInstance' call
831
+ var tmp0 = file.s1m();
832
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
833
+ var destination = ArrayList_init_$Create$();
834
+ var _iterator__ex2g4s = tmp0.t();
835
+ while (_iterator__ex2g4s.u()) {
836
+ var element = _iterator__ex2g4s.v();
837
+ if (element instanceof Struct) {
838
+ destination.x(element);
839
+ }
840
+ }
841
+ var tmp$ret$2 = firstOrNull_0(destination);
842
+ var struct = ensureNotNull(tmp$ret$2);
843
+ // Inline function 'kotlin.collections.map' call
844
+ var this_0 = struct.h1n_1;
845
+ // Inline function 'kotlin.collections.mapTo' call
846
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
847
+ var _iterator__ex2g4s_0 = this_0.t();
848
+ while (_iterator__ex2g4s_0.u()) {
849
+ var item = _iterator__ex2g4s_0.v();
850
+ var tmp$ret$3 = item.r1n(VOID, VOID, true);
851
+ destination_0.x(tmp$ret$3);
852
+ }
853
+ var tmp = destination_0;
854
+ // Inline function 'kotlin.collections.map' call
855
+ var this_1 = struct.k1n_1;
856
+ // Inline function 'kotlin.collections.mapTo' call
857
+ var destination_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
858
+ var _iterator__ex2g4s_1 = this_1.t();
859
+ while (_iterator__ex2g4s_1.u()) {
860
+ var item_0 = _iterator__ex2g4s_1.v();
861
+ var tmp_0;
862
+ if (item_0 instanceof Function) {
863
+ tmp_0 = item_0.d1k(VOID, VOID, VOID, VOID, VOID, VOID, VOID, true);
864
+ } else {
865
+ tmp_0 = item_0;
866
+ }
867
+ var tmp$ret$6 = tmp_0;
868
+ destination_1.x(tmp$ret$6);
869
+ }
870
+ // Inline function 'community.flock.wirespec.ir.core.transform' call
871
+ var this_2 = struct.m1n(VOID, tmp, VOID, VOID, destination_1);
872
+ var scope = new TransformScope(this_2);
873
+ scope.i1u(ScalaIrEmitter$emit$lambda_2);
874
+ var tmp_1 = scope.a1u_1;
875
+ var updatedStruct = isInterface(tmp_1, Element) ? tmp_1 : THROW_CCE();
876
+ return new File(Companion_getInstance().o1h(sanitize(this, refined.dr_1)), listOf(updatedStruct));
877
+ };
878
+ protoOf(ScalaIrEmitter).lr = function (endpoint) {
879
+ var imports = buildImports(this, endpoint);
880
+ var file = convert_3(endpoint);
881
+ // Inline function 'community.flock.wirespec.ir.core.findElement' call
882
+ // Inline function 'kotlin.collections.filterIsInstance' call
883
+ var tmp0 = file.s1m();
884
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
885
+ var destination = ArrayList_init_$Create$();
886
+ var _iterator__ex2g4s = tmp0.t();
887
+ while (_iterator__ex2g4s.u()) {
888
+ var element = _iterator__ex2g4s.v();
889
+ if (element instanceof Namespace) {
890
+ destination.x(element);
891
+ }
892
+ }
893
+ var tmp$ret$2 = firstOrNull_0(destination);
894
+ var endpointNamespace = ensureNotNull(tmp$ret$2);
895
+ var flattened = flattenNestedStructs(endpointNamespace);
896
+ var requestIsObject = isRequestObject(this, flattened);
897
+ // Inline function 'kotlin.let' call
898
+ var ns = injectHandleFunction(this, flattened);
899
+ var body = buildClientServerObjects(this, endpoint, requestIsObject, ns);
900
+ var sanitized = sanitizeNames(new File(Companion_getInstance().o1h(sanitize(this, endpoint.gp_1)), listOf(body)), _get_sanitizationConfig__sns434(this));
901
+ var tmp;
902
+ // Inline function 'kotlin.text.isNotEmpty' call
903
+ if (charSequenceLength(imports) > 0) {
904
+ tmp = sanitized.u1m(VOID, plus_0(listOf(new RawElement(imports)), sanitized.r1m_1));
905
+ } else {
906
+ tmp = sanitized;
907
+ }
908
+ return tmp;
909
+ };
910
+ protoOf(ScalaIrEmitter).zq = function (channel) {
911
+ var imports = buildImports(this, channel);
912
+ var file = sanitizeNames(convert_4(channel), _get_sanitizationConfig__sns434(this));
913
+ var tmp;
914
+ // Inline function 'kotlin.text.isNotEmpty' call
915
+ if (charSequenceLength(imports) > 0) {
916
+ tmp = file.u1m(VOID, plus_0(listOf(new RawElement(imports)), file.r1m_1));
917
+ } else {
918
+ tmp = file;
919
+ }
920
+ return tmp;
921
+ };
922
+ protoOf(ScalaIrEmitter).r1u = function (endpoint) {
923
+ var imports = buildImports(this, endpoint);
924
+ var endpointImport = 'import ' + this.l1v().or_1 + '.endpoint.' + endpoint.gp_1.n1();
925
+ // Inline function 'kotlin.collections.filter' call
926
+ var tmp0 = listOf_0([imports, endpointImport]);
927
+ // Inline function 'kotlin.collections.filterTo' call
928
+ var destination = ArrayList_init_$Create$();
929
+ var _iterator__ex2g4s = tmp0.t();
930
+ while (_iterator__ex2g4s.u()) {
931
+ var element = _iterator__ex2g4s.v();
932
+ // Inline function 'kotlin.text.isNotEmpty' call
933
+ if (charSequenceLength(element) > 0) {
934
+ destination.x(element);
935
+ }
936
+ }
937
+ var allImports = joinToString(destination, '\n');
938
+ var file = addIdentityTypeToCall(this, sanitizeNames(emitEndpointClient.call(this, endpoint), _get_sanitizationConfig__sns434(this)));
939
+ var subPackageName = plus_1(this.l1v(), 'client');
940
+ var tmp = Companion_getInstance().o1h(subPackageName.qr() + file.q1m_1.u1l());
941
+ // Inline function 'kotlin.collections.buildList' call
942
+ // Inline function 'kotlin.collections.buildListInternal' call
943
+ // Inline function 'kotlin.apply' call
944
+ var this_0 = ArrayList_init_$Create$();
945
+ this_0.x(new Package(subPackageName.or_1));
946
+ this_0.x(new RawElement(this.c20_1));
947
+ // Inline function 'kotlin.text.isNotEmpty' call
948
+ if (charSequenceLength(allImports) > 0) {
949
+ this_0.x(new RawElement(allImports));
950
+ }
951
+ this_0.e1(file.r1m_1);
952
+ var tmp$ret$8 = this_0.o5();
953
+ return new File(tmp, tmp$ret$8);
954
+ };
955
+ protoOf(ScalaIrEmitter).q1u = function (endpoints, logger) {
956
+ // Inline function 'kotlin.collections.flatMap' call
957
+ // Inline function 'kotlin.collections.flatMapTo' call
958
+ var destination = ArrayList_init_$Create$();
959
+ var _iterator__ex2g4s = endpoints.t();
960
+ while (_iterator__ex2g4s.u()) {
961
+ var element = _iterator__ex2g4s.v();
962
+ var list = importReferences(element);
963
+ addAll(destination, list);
964
+ }
965
+ // Inline function 'kotlin.collections.distinctBy' call
966
+ var set = HashSet_init_$Create$();
967
+ var list_0 = ArrayList_init_$Create$();
968
+ var _iterator__ex2g4s_0 = destination.t();
969
+ while (_iterator__ex2g4s_0.u()) {
970
+ var e = _iterator__ex2g4s_0.v();
971
+ var key = e.nu_1;
972
+ if (set.x(key)) {
973
+ list_0.x(e);
974
+ }
975
+ }
976
+ var tmp = list_0;
977
+ var imports = joinToString(tmp, '\n', VOID, VOID, VOID, VOID, ScalaIrEmitter$emitClient$lambda(this));
978
+ var endpointImports = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, ScalaIrEmitter$emitClient$lambda_0(this));
979
+ var clientImports = joinToString(endpoints, '\n', VOID, VOID, VOID, VOID, ScalaIrEmitter$emitClient$lambda_1(this));
980
+ // Inline function 'kotlin.collections.filter' call
981
+ var tmp0 = listOf_0([imports, endpointImports, clientImports]);
982
+ // Inline function 'kotlin.collections.filterTo' call
983
+ var destination_0 = ArrayList_init_$Create$();
984
+ var _iterator__ex2g4s_1 = tmp0.t();
985
+ while (_iterator__ex2g4s_1.u()) {
986
+ var element_0 = _iterator__ex2g4s_1.v();
987
+ // Inline function 'kotlin.text.isNotEmpty' call
988
+ if (charSequenceLength(element_0) > 0) {
989
+ destination_0.x(element_0);
990
+ }
991
+ }
992
+ var allImports = joinToString(destination_0, '\n');
993
+ var file = addIdentityTypeToCall(this, sanitizeNames(emitClient.call(this, endpoints, logger), _get_sanitizationConfig__sns434(this)));
994
+ var tmp_0 = Companion_getInstance().o1h(this.l1v().qr() + file.q1m_1.u1l());
995
+ // Inline function 'kotlin.collections.buildList' call
996
+ // Inline function 'kotlin.collections.buildListInternal' call
997
+ // Inline function 'kotlin.apply' call
998
+ var this_0 = ArrayList_init_$Create$();
999
+ this_0.x(new Package(this.l1v().or_1));
1000
+ this_0.x(new RawElement(this.c20_1));
1001
+ // Inline function 'kotlin.text.isNotEmpty' call
1002
+ if (charSequenceLength(allImports) > 0) {
1003
+ this_0.x(new RawElement(allImports));
1004
+ }
1005
+ this_0.e1(file.r1m_1);
1006
+ var tmp$ret$13 = this_0.o5();
1007
+ return new File(tmp_0, tmp$ret$13);
1008
+ };
1009
+ //region block: post-declaration
1010
+ protoOf(ScalaIrEmitter).qn = emit_1;
1011
+ //endregion
1012
+ //region block: exports
1013
+ export {
1014
+ ScalaIrEmitter as ScalaIrEmitterytuwlk19c8ah,
1015
+ };
1016
+ //endregion
1017
+
1018
+ //# sourceMappingURL=wirespec-src-compiler-emitters-scala.mjs.map