@flock/wirespec 0.11.8 → 0.12.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 (100) hide show
  1. package/arrow-arrow-annotations.mjs +4 -0
  2. package/{kotlinx-io-kotlinx-io-bytestring.js.map → arrow-arrow-annotations.mjs.map} +1 -1
  3. package/arrow-arrow-atomic.mjs +43 -0
  4. package/arrow-arrow-atomic.mjs.map +1 -0
  5. package/arrow-arrow-continuations.mjs +18 -0
  6. package/{kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map → arrow-arrow-continuations.mjs.map} +1 -1
  7. package/arrow-arrow-core.mjs +532 -0
  8. package/arrow-arrow-core.mjs.map +1 -0
  9. package/clikt-clikt.mjs +6648 -0
  10. package/clikt-clikt.mjs.map +1 -0
  11. package/colormath-root-colormath.mjs +1696 -0
  12. package/colormath-root-colormath.mjs.map +1 -0
  13. package/kotlin-kotlin-stdlib.mjs +13106 -0
  14. package/kotlin-kotlin-stdlib.mjs.map +1 -0
  15. package/kotlin-openapi-bindings.mjs +13769 -0
  16. package/kotlin-openapi-bindings.mjs.map +1 -0
  17. package/kotlin-rgxgen.mjs +4298 -0
  18. package/kotlin-rgxgen.mjs.map +1 -0
  19. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs +4 -0
  20. package/{arrow-arrow-annotations.js.map → kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map} +1 -1
  21. package/kotlinx-io-kotlinx-io-bytestring.mjs +4 -0
  22. package/{kotlin-kotlin-test.js.map → kotlinx-io-kotlinx-io-bytestring.mjs.map} +1 -1
  23. package/kotlinx-io-kotlinx-io-core.mjs +2201 -0
  24. package/kotlinx-io-kotlinx-io-core.mjs.map +1 -0
  25. package/kotlinx-serialization-kotlinx-serialization-core.mjs +5880 -0
  26. package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -0
  27. package/kotlinx-serialization-kotlinx-serialization-json.mjs +5109 -0
  28. package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  29. package/markdown.mjs +6753 -0
  30. package/markdown.mjs.map +1 -0
  31. package/mordant-mordant.mjs +11839 -0
  32. package/mordant-mordant.mjs.map +1 -0
  33. package/package.json +4 -6
  34. package/wirespec-bin.mjs +18 -0
  35. package/wirespec-src-compiler-core.mjs +8313 -0
  36. package/wirespec-src-compiler-core.mjs.map +1 -0
  37. package/wirespec-src-compiler-lib.mjs +2565 -0
  38. package/wirespec-src-compiler-lib.mjs.map +1 -0
  39. package/wirespec-src-converter-avro.mjs +1933 -0
  40. package/wirespec-src-converter-avro.mjs.map +1 -0
  41. package/wirespec-src-converter-openapi.mjs +5301 -0
  42. package/wirespec-src-converter-openapi.mjs.map +1 -0
  43. package/wirespec-src-plugin-arguments.mjs +587 -0
  44. package/wirespec-src-plugin-arguments.mjs.map +1 -0
  45. package/wirespec-src-plugin-cli.mjs +1487 -0
  46. package/wirespec-src-plugin-cli.mjs.map +1 -0
  47. package/wirespec-src-plugin-npm.d.ts +485 -466
  48. package/wirespec-src-plugin-npm.mjs +622 -0
  49. package/wirespec-src-plugin-npm.mjs.map +1 -0
  50. package/wirespec-src-tools-generator.mjs +284 -0
  51. package/wirespec-src-tools-generator.mjs.map +1 -0
  52. package/arrow-arrow-annotations.js +0 -15
  53. package/arrow-arrow-atomic.js +0 -55
  54. package/arrow-arrow-atomic.js.map +0 -1
  55. package/arrow-arrow-continuations.js +0 -30
  56. package/arrow-arrow-continuations.js.map +0 -1
  57. package/arrow-arrow-core.js +0 -410
  58. package/arrow-arrow-core.js.map +0 -1
  59. package/clikt-clikt.js +0 -6713
  60. package/clikt-clikt.js.map +0 -1
  61. package/colormath-root-colormath.js +0 -1727
  62. package/colormath-root-colormath.js.map +0 -1
  63. package/kotlin-kotlin-stdlib.js +0 -13263
  64. package/kotlin-kotlin-stdlib.js.map +0 -1
  65. package/kotlin-kotlin-test.js +0 -15
  66. package/kotlin-openapi-bindings.js +0 -13787
  67. package/kotlin-openapi-bindings.js.map +0 -1
  68. package/kotlin-rgxgen.js +0 -4315
  69. package/kotlin-rgxgen.js.map +0 -1
  70. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +0 -15
  71. package/kotlinx-io-kotlinx-io-bytestring.js +0 -15
  72. package/kotlinx-io-kotlinx-io-core.js +0 -2219
  73. package/kotlinx-io-kotlinx-io-core.js.map +0 -1
  74. package/kotlinx-serialization-kotlinx-serialization-core.js +0 -5914
  75. package/kotlinx-serialization-kotlinx-serialization-core.js.map +0 -1
  76. package/kotlinx-serialization-kotlinx-serialization-json.js +0 -5126
  77. package/kotlinx-serialization-kotlinx-serialization-json.js.map +0 -1
  78. package/markdown.js +0 -6768
  79. package/markdown.js.map +0 -1
  80. package/mordant-mordant.js +0 -11981
  81. package/mordant-mordant.js.map +0 -1
  82. package/resources-library.js +0 -15
  83. package/resources-library.js.map +0 -1
  84. package/wirespec-bin.js +0 -3
  85. package/wirespec-src-compiler-core.js +0 -7894
  86. package/wirespec-src-compiler-core.js.map +0 -1
  87. package/wirespec-src-compiler-lib.js +0 -2603
  88. package/wirespec-src-compiler-lib.js.map +0 -1
  89. package/wirespec-src-converter-avro.js +0 -1369
  90. package/wirespec-src-converter-avro.js.map +0 -1
  91. package/wirespec-src-converter-openapi.js +0 -5366
  92. package/wirespec-src-converter-openapi.js.map +0 -1
  93. package/wirespec-src-plugin-arguments.js +0 -640
  94. package/wirespec-src-plugin-arguments.js.map +0 -1
  95. package/wirespec-src-plugin-cli.js +0 -1222
  96. package/wirespec-src-plugin-cli.js.map +0 -1
  97. package/wirespec-src-plugin-npm.js +0 -480
  98. package/wirespec-src-plugin-npm.js.map +0 -1
  99. package/wirespec-src-tools-generator.js +0 -306
  100. package/wirespec-src-tools-generator.js.map +0 -1
@@ -0,0 +1,1487 @@
1
+ import {
2
+ CliktError136b5l5psfi1n as CliktError,
3
+ subcommands3iz66ruo6cdc as subcommands,
4
+ NoOpCliktCommand2adtfdm68nv09 as NoOpCliktCommand,
5
+ option2wnxma00ykjjp as option,
6
+ choice1qx2pgx161pnc as choice,
7
+ multiple1ilt3bwdbyd8l as multiple,
8
+ argument2zdhc640dnlyc as argument,
9
+ choiceie3147xkuo29 as choice_0,
10
+ CliktCommand1a5aj7xujka26 as CliktCommand,
11
+ default2v6m45aspyoyr as default_0,
12
+ flag3dod1qr8no54f as flag,
13
+ } from './clikt-clikt.mjs';
14
+ import {
15
+ captureStack1fzi4aczwc4hg as captureStack,
16
+ protoOf180f3jzyo7rfj as protoOf,
17
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
18
+ VOID7hggqo3abtya as VOID,
19
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
20
+ Unit_instance14hm69wy3kr8u as Unit_instance,
21
+ noWhenBranchMatchedException2a6r7ubxgky5j as noWhenBranchMatchedException,
22
+ first28gmhyvs4kf06 as first,
23
+ mapCapacity1h45rc3eh9p2l as mapCapacity,
24
+ coerceAtLeast2bkz8m9ik7hep as coerceAtLeast,
25
+ LinkedHashMap_init_$Create$snys8oz8txtu as LinkedHashMap_init_$Create$,
26
+ THROW_CCE2g6jy02ryeudk as THROW_CCE,
27
+ isCharSequence1ju9jr1w86plq as isCharSequence,
28
+ trim11nh7r46at6sx as trim,
29
+ toString1pkumu07cwy4m as toString,
30
+ Enum3alwj03lh1n41 as Enum,
31
+ asSequence2phdjljfh9jhx as asSequence,
32
+ filter184huxd00uyfg as filter,
33
+ mapsbvh18eqox7a as map,
34
+ toListx6x8nvfmvvht as toList,
35
+ _Char___init__impl__6a9atx367vrx0avsvbg as _Char___init__impl__6a9atx,
36
+ substringAfterLast3r0t0my8cpqhk as substringAfterLast,
37
+ objectCreate1ve4bgxiu4x98 as objectCreate,
38
+ hashCodeq5arwsb9dgti as hashCode,
39
+ equals2au1ep9vhcato as equals,
40
+ dropLastlqc2oyv04br0 as dropLast,
41
+ KProperty1ca4yb4wlo496 as KProperty1,
42
+ getPropertyCallableRef1ajb9in178r5r as getPropertyCallableRef,
43
+ ArrayList_init_$Create$2rimpp4x9tjd3 as ArrayList_init_$Create$,
44
+ addAll1k27qatfgp3k5 as addAll,
45
+ ensureNotNull1e947j3ixpazm as ensureNotNull,
46
+ joinToString1cxrrlmo0chqs as joinToString,
47
+ to2cs3ny02qtbcb as to,
48
+ collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault,
49
+ ArrayList_init_$Create$3m1kyiqequwm5 as ArrayList_init_$Create$_0,
50
+ first58ocm7j58k3q as first_0,
51
+ charSequenceLength3278n89t01tmv as charSequenceLength,
52
+ charSequenceGet1vxk1y5n17t1z as charSequenceGet,
53
+ toString14fd7g605f91p as toString_0,
54
+ numberRangeToNumber25vse2rgp6rs8 as numberRangeToNumber,
55
+ copyToArray2j022khrow2yi as copyToArray,
56
+ charArrayOf27f4r3dozbrk1 as charArrayOf,
57
+ split3d3yeauc4rm2n as split,
58
+ emptyList1g2z5xcrvp2zy as emptyList,
59
+ isInterface3d6p8outrmvmk as isInterface,
60
+ IllegalStateException_init_$Create$1nm9y6jd3c9iy as IllegalStateException_init_$Create$,
61
+ isArray1hxjqtqy632bc as isArray,
62
+ } from './kotlin-kotlin-stdlib.mjs';
63
+ import {
64
+ FileExtension_Wirespec_getInstance19818qj53f25i as FileExtension_Wirespec_getInstance,
65
+ FileExtension_JSON_getInstance2b5cqly6h8zzl as FileExtension_JSON_getInstance,
66
+ Companion_instance16jo4jh8p2erh as Companion_instance,
67
+ WirespecFile3w32rdf742u1e as WirespecFile,
68
+ FilePath19g13s23dhifl as FilePath,
69
+ Directory2pzela5ei9b8y as Directory,
70
+ DirectoryPath2csdb6gzs7bpq as DirectoryPath,
71
+ plus1pp1y4l1xu22u as plus,
72
+ CompilerArguments27p1etc1665zg as CompilerArguments,
73
+ values39f22etrsivck as values,
74
+ JsonFiley161rolw5619 as JsonFile,
75
+ Language_Wirespec_getInstance1zl47mdevd656 as Language_Wirespec_getInstance,
76
+ ConverterArgumentsa8xc45eyvf51 as ConverterArguments,
77
+ Companion_instance29usj1v156zfd as Companion_instance_0,
78
+ _DirectoryPath___init__impl__5bzkjd1ktpd1ghksag0 as _DirectoryPath___init__impl__5bzkjd,
79
+ _DirectoryPath___get_value__impl__hdy2e31yc2tub9sv1l0 as _DirectoryPath___get_value__impl__hdy2e3,
80
+ _FileName___init__impl__nzn12e2ttezdy3facli as _FileName___init__impl__nzn12e,
81
+ _FileName___get_value__impl__3u4cz62y98r2mblb9vx as _FileName___get_value__impl__3u4cz6,
82
+ FileExtension_Java_getInstance2y5b2sxkahmzv as FileExtension_Java_getInstance,
83
+ JavaFile2mgokrcrqy4af as JavaFile,
84
+ FileExtension_Kotlin_getInstance33a993g70gip4 as FileExtension_Kotlin_getInstance,
85
+ KotlinFile128o120wpkhp9 as KotlinFile,
86
+ FileExtension_Scala_getInstanceheb2yniip135 as FileExtension_Scala_getInstance,
87
+ ScalaFile3m6vfgr0c9tmw as ScalaFile,
88
+ FileExtension_TypeScript_getInstance327v4uq0judmp as FileExtension_TypeScript_getInstance,
89
+ TypeScriptFile32l40p54f6anx as TypeScriptFile,
90
+ plus27fzpr8q3yphw as plus_0,
91
+ } from './wirespec-src-plugin-arguments.mjs';
92
+ import {
93
+ Companion_instance38d4g4yp9m5as as Companion_instance_1,
94
+ PackageName35p0zgv8tekor as PackageName,
95
+ Level_ERROR_getInstance2j4e9tt9l6uqw as Level_ERROR_getInstance,
96
+ Level_DEBUG_getInstance1db63unvt37e0 as Level_DEBUG_getInstance,
97
+ Level_INFO_getInstance2xs4l97ty5roh as Level_INFO_getInstance,
98
+ Level_WARN_getInstanceocut4pt1mmfe as Level_WARN_getInstance,
99
+ compile23ox110m1aeoz as compile,
100
+ Companion_getInstance3exl5179osn9k as Companion_getInstance,
101
+ Emitted3cm6ez40hij29 as Emitted,
102
+ Logger1cwdyrq5itr5l as Logger,
103
+ get_spec3cnzsbb1ufwje as get_spec,
104
+ HasLanguageSpec1fo5x3q6dcifj as HasLanguageSpec,
105
+ JavaEmitter1iajkiqm8e1w2 as JavaEmitter,
106
+ KotlinEmitter3u2bd89c6zjpn as KotlinEmitter,
107
+ ScalaEmittergcrbho15xuc5 as ScalaEmitter,
108
+ TypeScriptEmitter15xnhgx1fp785 as TypeScriptEmitter,
109
+ WirespecEmitterzy8hsjgf4ddx as WirespecEmitter,
110
+ parse3fl6l5wpdax7w as parse,
111
+ Definition175ejj0ddy3gi as Definition,
112
+ get_logger18kl6wyy7pz6k as get_logger,
113
+ NoLoggero51bdi3we1s0 as NoLogger,
114
+ } from './wirespec-src-compiler-core.mjs';
115
+ import {
116
+ nonEmptySetOf3p7fhmt51pz4b as nonEmptySetOf,
117
+ NonEmptySet1rtvr2guloo52 as NonEmptySet,
118
+ toNonEmptySetOrNull1tjnd9jrkd4bs as toNonEmptySetOrNull,
119
+ _NonEmptySet___get_elements__impl__g09gj93rk9dtepr20b0 as _NonEmptySet___get_elements__impl__g09gj9,
120
+ toNonEmptyListOrNull2ovnnazjb3msz as toNonEmptyListOrNull,
121
+ DefaultRaisevd10gc79qxh8 as DefaultRaise,
122
+ Right351sh2v8odavg as Right,
123
+ nonFatalOrThrow35agffkx4bbtz as nonFatalOrThrow,
124
+ raisedOrRethrow397oyvsdde7oq as raisedOrRethrow,
125
+ Left2oemzq1tpcg4i as Left,
126
+ RaiseCancellationException3n5raogfhbd1l as RaiseCancellationException,
127
+ NonEmptyList3ak25ihy2gcvs as NonEmptyList,
128
+ nonEmptyListOf17xawqyzwrlrt as nonEmptyListOf,
129
+ Companion_instancel37dvvdi0gn2 as Companion_instance_2,
130
+ right2w60qw9uivnyr as right,
131
+ left3pixsqou14wpr as left,
132
+ } from './arrow-arrow-core.mjs';
133
+ import {
134
+ Path21qufdfgaayly as Path,
135
+ get_SystemFileSystemcqw7gp4jhbc7 as get_SystemFileSystem,
136
+ buffered3kq86cdmguv3h as buffered,
137
+ readString2nvggcfaijfhd as readString,
138
+ buffered1hqdy4i9j28ez as buffered_0,
139
+ writeString33ca4btrgctw7 as writeString,
140
+ } from './kotlinx-io-kotlinx-io-core.mjs';
141
+ import {
142
+ OpenAPIV2Parser_instance1xcejlvmy4a3a as OpenAPIV2Parser_instance,
143
+ OpenAPIV3Parser_instance292ngistbqurv as OpenAPIV3Parser_instance,
144
+ OpenAPIV2Emitter_getInstance339m3dn2m5b6v as OpenAPIV2Emitter_getInstance,
145
+ OpenAPIV3Emitter_getInstanceja53nca07ivb as OpenAPIV3Emitter_getInstance,
146
+ } from './wirespec-src-converter-openapi.mjs';
147
+ import { AvroParser_instance25ibqzb3yimhc as AvroParser_instance } from './wirespec-src-converter-avro.mjs';
148
+ import { produce3go8okyj7e8u0 as produce } from './wirespec-src-compiler-lib.mjs';
149
+ //region block: imports
150
+ var imul = Math.imul;
151
+ //endregion
152
+ //region block: pre-declaration
153
+ initMetadataForClass(IsNotAFileOrDirectory, 'IsNotAFileOrDirectory', VOID, CliktError);
154
+ initMetadataForClass(SpecificFile, 'SpecificFile', VOID, CliktError);
155
+ initMetadataForClass(WirespecFileError, 'WirespecFileError', WirespecFileError, SpecificFile);
156
+ initMetadataForClass(OutputShouldBeADirectory, 'OutputShouldBeADirectory', OutputShouldBeADirectory, CliktError);
157
+ initMetadataForClass(ThisShouldNeverHappen, 'ThisShouldNeverHappen', ThisShouldNeverHappen, CliktError);
158
+ initMetadataForClass(ConvertNeedsAFile, 'ConvertNeedsAFile', ConvertNeedsAFile, CliktError);
159
+ initMetadataForClass(JSONFileError, 'JSONFileError', JSONFileError, SpecificFile);
160
+ initMetadataForClass(CannotAccessFileOrDirectory, 'CannotAccessFileOrDirectory', VOID, CliktError);
161
+ initMetadataForClass(ChooseALogLevel, 'ChooseALogLevel', ChooseALogLevel, CliktError);
162
+ initMetadataForCompanion(Companion);
163
+ initMetadataForClass(WirespecCli, 'WirespecCli', WirespecCli, NoOpCliktCommand);
164
+ initMetadataForClass(CommonOptions, 'CommonOptions', VOID, CliktCommand);
165
+ initMetadataForClass(Compile, 'Compile', VOID, CommonOptions);
166
+ initMetadataForClass(Convert, 'Convert', VOID, CommonOptions);
167
+ initMetadataForClass(Options, 'Options', VOID, Enum);
168
+ initMetadataForClass(WirespecResult, 'WirespecResult');
169
+ initMetadataForClass(compile$context$1$1);
170
+ initMetadataForClass(wirespec$1, VOID, VOID, VOID, [HasLanguageSpec]);
171
+ initMetadataForClass(parser$1, VOID, VOID, VOID, [HasLanguageSpec, NoLogger]);
172
+ //endregion
173
+ function IsNotAFileOrDirectory(input) {
174
+ CliktError.call(this, 'Input is not a file or directory: ' + input + '.');
175
+ captureStack(this, IsNotAFileOrDirectory);
176
+ }
177
+ function WirespecFileError() {
178
+ SpecificFile.call(this, FileExtension_Wirespec_getInstance());
179
+ captureStack(this, WirespecFileError);
180
+ }
181
+ function OutputShouldBeADirectory() {
182
+ CliktError.call(this, 'Output should be a directory.');
183
+ captureStack(this, OutputShouldBeADirectory);
184
+ }
185
+ function ThisShouldNeverHappen() {
186
+ CliktError.call(this, 'This should never happen.');
187
+ captureStack(this, ThisShouldNeverHappen);
188
+ }
189
+ function ConvertNeedsAFile() {
190
+ CliktError.call(this, 'To convert, please specify a file.');
191
+ captureStack(this, ConvertNeedsAFile);
192
+ }
193
+ function JSONFileError() {
194
+ SpecificFile.call(this, FileExtension_JSON_getInstance());
195
+ captureStack(this, JSONFileError);
196
+ }
197
+ function CannotAccessFileOrDirectory(input) {
198
+ CliktError.call(this, 'Cannot access file or directory: ' + input + '.');
199
+ captureStack(this, CannotAccessFileOrDirectory);
200
+ }
201
+ function ChooseALogLevel() {
202
+ CliktError.call(this, 'Choose one of these log levels: ' + Companion_instance_1.toString() + '.');
203
+ captureStack(this, ChooseALogLevel);
204
+ }
205
+ function SpecificFile(extension) {
206
+ CliktError.call(this, 'No ' + extension.o2_1 + ' file found');
207
+ captureStack(this, SpecificFile);
208
+ }
209
+ function Companion() {
210
+ }
211
+ protoOf(Companion).u49 = function (compile, convert) {
212
+ return subcommands(new WirespecCli(), [new Compile(compile), new Convert(convert)]);
213
+ };
214
+ var Companion_instance_3;
215
+ function Companion_getInstance_0() {
216
+ return Companion_instance_3;
217
+ }
218
+ function WirespecCli() {
219
+ NoOpCliktCommand.call(this, VOID, VOID, 'wirespec');
220
+ }
221
+ function _get_languages__ojonze($this) {
222
+ return $this.t4a_1.z43($this, languages$factory_0());
223
+ }
224
+ function run$handleError(p0) {
225
+ handleError(p0);
226
+ }
227
+ function Compile$run$lambda(it) {
228
+ return read(it);
229
+ }
230
+ function Compile$run$lambda_0(file, string) {
231
+ write(file, string);
232
+ return Unit_instance;
233
+ }
234
+ function Compile$run$handleError$ref() {
235
+ return function (p0) {
236
+ run$handleError(p0);
237
+ return Unit_instance;
238
+ };
239
+ }
240
+ function Compile(compiler) {
241
+ CommonOptions.call(this);
242
+ this.s4a_1 = compiler;
243
+ this.t4a_1 = multiple(choice(option(this, Options_Language_getInstance().w4a_1.slice(), 'Language'), Companion_instance.r2d(), VOID, true), VOID, true).k44(this, languages$factory());
244
+ }
245
+ protoOf(Compile).o3u = function () {
246
+ var it = this.v4b(this.u4b());
247
+ var tmp;
248
+ if (it == null) {
249
+ throw new IsNotAFileOrDirectory(null);
250
+ } else {
251
+ if (it instanceof DirectoryPath) {
252
+ tmp = wirespecFiles(new Directory(it.d2d_1));
253
+ } else {
254
+ if (it instanceof FilePath) {
255
+ var tmp_0;
256
+ if (it.l2d_1.p2_1 === 4) {
257
+ tmp_0 = nonEmptySetOf(new WirespecFile(it), []);
258
+ } else {
259
+ throw new WirespecFileError();
260
+ }
261
+ tmp = tmp_0;
262
+ } else {
263
+ noWhenBranchMatchedException();
264
+ }
265
+ }
266
+ }
267
+ var input = tmp;
268
+ var it_0 = this.x4b(this.w4b(), true);
269
+ var tmp_1;
270
+ if (it_0 == null) {
271
+ tmp_1 = new Directory(plus(first(new NonEmptySet(input)).o2d_1, '/out'));
272
+ } else {
273
+ if (it_0 instanceof DirectoryPath) {
274
+ tmp_1 = new Directory(it_0.d2d_1);
275
+ } else {
276
+ if (it_0 instanceof FilePath) {
277
+ throw new OutputShouldBeADirectory();
278
+ } else {
279
+ noWhenBranchMatchedException();
280
+ }
281
+ }
282
+ }
283
+ var output = tmp_1;
284
+ var tmp_2 = Compile$run$lambda;
285
+ var tmp_3 = Compile$run$lambda_0;
286
+ var tmp_4 = Compile$run$handleError$ref();
287
+ var tmp1_elvis_lhs = toNonEmptySetOrNull(_get_languages__ojonze(this));
288
+ var tmp_5;
289
+ var tmp_6 = tmp1_elvis_lhs;
290
+ if ((tmp_6 == null ? null : new NonEmptySet(tmp_6)) == null) {
291
+ throw new ThisShouldNeverHappen();
292
+ } else {
293
+ tmp_5 = tmp1_elvis_lhs;
294
+ }
295
+ var tmp0 = new CompilerArguments(input, output, tmp_2, tmp_3, tmp_4, tmp_5, new PackageName(this.y4b()), this.a4c(this.z4b()), this.m48(), this.b4c());
296
+ // Inline function 'kotlin.let' call
297
+ this.s4a_1(tmp0);
298
+ };
299
+ function _get_format__qlarck($this) {
300
+ return $this.a4d_1.z43($this, format$factory_0());
301
+ }
302
+ function _get_languages__ojonze_0($this) {
303
+ return $this.b4d_1.z43($this, languages$factory_2());
304
+ }
305
+ function run$handleError_0(p0) {
306
+ handleError(p0);
307
+ }
308
+ function Convert$run$lambda(it) {
309
+ return read(it);
310
+ }
311
+ function Convert$run$lambda_0(file, string) {
312
+ write(file, string);
313
+ return Unit_instance;
314
+ }
315
+ function Convert$run$handleError$ref() {
316
+ return function (p0) {
317
+ run$handleError_0(p0);
318
+ return Unit_instance;
319
+ };
320
+ }
321
+ function Convert(converter) {
322
+ CommonOptions.call(this);
323
+ this.z4c_1 = converter;
324
+ var tmp = this;
325
+ // Inline function 'com.github.ajalt.clikt.parameters.types.enum' call
326
+ var this_0 = argument(this, VOID, 'Input format');
327
+ // Inline function 'kotlin.enumValues' call
328
+ // Inline function 'kotlin.collections.associateBy' call
329
+ var this_1 = values();
330
+ var capacity = coerceAtLeast(mapCapacity(this_1.length), 16);
331
+ // Inline function 'kotlin.collections.associateByTo' call
332
+ var destination = LinkedHashMap_init_$Create$(capacity);
333
+ var inductionVariable = 0;
334
+ var last = this_1.length;
335
+ while (inductionVariable < last) {
336
+ var element = this_1[inductionVariable];
337
+ inductionVariable = inductionVariable + 1 | 0;
338
+ // Inline function 'com.github.ajalt.clikt.parameters.types.enum.<anonymous>' call
339
+ // Inline function 'com.github.ajalt.clikt.parameters.types.enum.<anonymous>' call
340
+ var tmp$ret$2 = element.o2_1;
341
+ destination.l2(tmp$ret$2, element);
342
+ }
343
+ tmp.a4d_1 = choice_0(this_0, destination, true).f43(this, format$factory());
344
+ this.b4d_1 = multiple(choice(option(this, Options_Language_getInstance().w4a_1.slice(), 'Language'), Companion_instance.r2d(), VOID, true)).k44(this, languages$factory_1());
345
+ }
346
+ protoOf(Convert).o3u = function () {
347
+ var it = this.v4b(this.u4b());
348
+ var tmp;
349
+ if (it == null) {
350
+ throw new IsNotAFileOrDirectory(null);
351
+ } else {
352
+ if (it instanceof DirectoryPath) {
353
+ throw new ConvertNeedsAFile();
354
+ } else {
355
+ if (it instanceof FilePath) {
356
+ var tmp_0;
357
+ if (it.l2d_1.p2_1 === 5) {
358
+ tmp_0 = new JsonFile(it);
359
+ } else {
360
+ throw new JSONFileError();
361
+ }
362
+ tmp = tmp_0;
363
+ } else {
364
+ noWhenBranchMatchedException();
365
+ }
366
+ }
367
+ }
368
+ var input = tmp;
369
+ var it_0 = this.x4b(this.w4b(), true);
370
+ var tmp_1;
371
+ if (it_0 == null) {
372
+ tmp_1 = new Directory(plus(input.o2d_1, '/out'));
373
+ } else {
374
+ if (it_0 instanceof DirectoryPath) {
375
+ tmp_1 = new Directory(it_0.d2d_1);
376
+ } else {
377
+ if (it_0 instanceof FilePath) {
378
+ throw new OutputShouldBeADirectory();
379
+ } else {
380
+ noWhenBranchMatchedException();
381
+ }
382
+ }
383
+ }
384
+ var output = tmp_1;
385
+ var tmp_2 = _get_format__qlarck(this);
386
+ var tmp_3 = Convert$run$lambda;
387
+ var tmp_4 = Convert$run$lambda_0;
388
+ var tmp_5 = Convert$run$handleError$ref();
389
+ var tmp1_elvis_lhs = toNonEmptySetOrNull(_get_languages__ojonze_0(this));
390
+ var tmp_6;
391
+ var tmp_7 = tmp1_elvis_lhs;
392
+ if ((tmp_7 == null ? null : new NonEmptySet(tmp_7)) == null) {
393
+ tmp_6 = nonEmptySetOf(Language_Wirespec_getInstance(), []);
394
+ } else {
395
+ tmp_6 = tmp1_elvis_lhs;
396
+ }
397
+ var tmp0 = new ConverterArguments(tmp_2, input, output, tmp_3, tmp_4, tmp_5, tmp_6, new PackageName(this.y4b()), this.a4c(this.z4b()), this.m48(), this.b4c());
398
+ // Inline function 'kotlin.let' call
399
+ this.z4c_1(tmp0);
400
+ };
401
+ function CommonOptions() {
402
+ CliktCommand.call(this);
403
+ this.o4b_1 = option(this, Options_Input_getInstance().w4a_1.slice(), 'Input').k44(this, inputPath$factory());
404
+ this.p4b_1 = option(this, Options_Output_getInstance().w4a_1.slice(), 'Output').k44(this, outputPath$factory());
405
+ this.q4b_1 = default_0(option(this, Options_PackageName_getInstance().w4a_1.slice(), 'Package name'), 'community.flock.wirespec.generated').k44(this, packageName$factory());
406
+ this.r4b_1 = default_0(option(this, Options_LogLevel_getInstance().w4a_1.slice(), 'Log level: ' + Companion_instance_1.toString()), Level_ERROR_getInstance().toString()).k44(this, logLevel$factory());
407
+ this.s4b_1 = flag(option(this, Options_Shared_getInstance().w4a_1.slice(), 'Generate shared wirespec code'), [], false).k44(this, shared$factory());
408
+ this.t4b_1 = flag(option(this, Options_Strict_getInstance().w4a_1.slice(), 'Strict mode'), []).k44(this, strict$factory());
409
+ }
410
+ protoOf(CommonOptions).u4b = function () {
411
+ return this.o4b_1.z43(this, inputPath$factory_0());
412
+ };
413
+ protoOf(CommonOptions).w4b = function () {
414
+ return this.p4b_1.z43(this, outputPath$factory_0());
415
+ };
416
+ protoOf(CommonOptions).y4b = function () {
417
+ return this.q4b_1.z43(this, packageName$factory_0());
418
+ };
419
+ protoOf(CommonOptions).z4b = function () {
420
+ return this.r4b_1.z43(this, logLevel$factory_0());
421
+ };
422
+ protoOf(CommonOptions).m48 = function () {
423
+ return this.s4b_1.z43(this, shared$factory_0());
424
+ };
425
+ protoOf(CommonOptions).b4c = function () {
426
+ return this.t4b_1.z43(this, strict$factory_0());
427
+ };
428
+ protoOf(CommonOptions).x4b = function (input, createIfNotExists_0) {
429
+ var tmp;
430
+ if (input == null) {
431
+ tmp = null;
432
+ } else {
433
+ // Inline function 'kotlin.let' call
434
+ // Inline function 'community.flock.wirespec.plugin.cli.CommonOptions.getFullPath.<anonymous>' call
435
+ var path = createIfNotExists(Path(input), createIfNotExists_0);
436
+ var tmp0_elvis_lhs = get_SystemFileSystem().g49(path);
437
+ var tmp_0;
438
+ if (tmp0_elvis_lhs == null) {
439
+ throw new CannotAccessFileOrDirectory(input);
440
+ } else {
441
+ tmp_0 = tmp0_elvis_lhs;
442
+ }
443
+ var meta = tmp_0;
444
+ var tmp_1;
445
+ if (meta.j49_1) {
446
+ tmp_1 = new DirectoryPath(_DirectoryPath___init__impl__5bzkjd(input));
447
+ } else if (meta.i49_1) {
448
+ tmp_1 = Companion_instance_0.f2d(input);
449
+ } else {
450
+ throw new IsNotAFileOrDirectory(input);
451
+ }
452
+ tmp = tmp_1;
453
+ }
454
+ return tmp;
455
+ };
456
+ protoOf(CommonOptions).v4b = function (input, createIfNotExists, $super) {
457
+ createIfNotExists = createIfNotExists === VOID ? false : createIfNotExists;
458
+ return $super === VOID ? this.x4b(input, createIfNotExists) : $super.x4b.call(this, input, createIfNotExists);
459
+ };
460
+ protoOf(CommonOptions).a4c = function (_this__u8e3s4) {
461
+ // Inline function 'kotlin.text.trim' call
462
+ // Inline function 'kotlin.text.uppercase' call
463
+ // Inline function 'kotlin.js.asDynamic' call
464
+ var tmp;
465
+ switch (toString(trim(isCharSequence(_this__u8e3s4) ? _this__u8e3s4 : THROW_CCE())).toUpperCase()) {
466
+ case 'DEBUG':
467
+ tmp = Level_DEBUG_getInstance();
468
+ break;
469
+ case 'INFO':
470
+ tmp = Level_INFO_getInstance();
471
+ break;
472
+ case 'WARN':
473
+ tmp = Level_WARN_getInstance();
474
+ break;
475
+ case 'ERROR':
476
+ tmp = Level_ERROR_getInstance();
477
+ break;
478
+ default:
479
+ throw new ChooseALogLevel();
480
+ }
481
+ return tmp;
482
+ };
483
+ var Options_Input_instance;
484
+ var Options_Output_instance;
485
+ var Options_Language_instance;
486
+ var Options_PackageName_instance;
487
+ var Options_LogLevel_instance;
488
+ var Options_Shared_instance;
489
+ var Options_Strict_instance;
490
+ var Options_entriesInitialized;
491
+ function Options_initEntries() {
492
+ if (Options_entriesInitialized)
493
+ return Unit_instance;
494
+ Options_entriesInitialized = true;
495
+ Options_Input_instance = new Options('Input', 0, ['-i', '--input']);
496
+ Options_Output_instance = new Options('Output', 1, ['-o', '--output']);
497
+ Options_Language_instance = new Options('Language', 2, ['-l', '--language']);
498
+ Options_PackageName_instance = new Options('PackageName', 3, ['-p', '--package']);
499
+ Options_LogLevel_instance = new Options('LogLevel', 4, ['--log-level']);
500
+ Options_Shared_instance = new Options('Shared', 5, ['--shared']);
501
+ Options_Strict_instance = new Options('Strict', 6, ['--strict']);
502
+ }
503
+ function Options(name, ordinal, flags) {
504
+ Enum.call(this, name, ordinal);
505
+ this.w4a_1 = flags;
506
+ }
507
+ function wirespecFiles(_this__u8e3s4) {
508
+ var tmp0 = Path(_DirectoryPath___get_value__impl__hdy2e3(_this__u8e3s4.e2d_1));
509
+ // Inline function 'kotlin.let' call
510
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespecFiles.stub_for_inlining' call
511
+ var tmp$ret$1 = get_SystemFileSystem().h49(tmp0);
512
+ var tmp = asSequence(tmp$ret$1);
513
+ var tmp_0 = filter(tmp, isRegularFile$ref());
514
+ var tmp_1 = filter(tmp_0, isWirespecFile$ref());
515
+ var tmp_2 = map(tmp_1, wirespecFiles$lambda);
516
+ var tmp_3 = map(tmp_2, wirespecFiles$lambda_0);
517
+ var tmp_4 = map(tmp_3, wirespecFiles$lambda_1(_this__u8e3s4));
518
+ var tmp0_elvis_lhs = toNonEmptySetOrNull(toList(map(tmp_4, WirespecFile$_init_$ref_cj1n5j())));
519
+ var tmp_5;
520
+ var tmp_6 = tmp0_elvis_lhs;
521
+ if ((tmp_6 == null ? null : new NonEmptySet(tmp_6)) == null) {
522
+ throw new WirespecFileError();
523
+ } else {
524
+ tmp_5 = tmp0_elvis_lhs;
525
+ }
526
+ return tmp_5;
527
+ }
528
+ function read(_this__u8e3s4) {
529
+ // Inline function 'kotlin.let' call
530
+ // Inline function 'community.flock.wirespec.plugin.cli.read.<anonymous>' call
531
+ var it = Path(_this__u8e3s4.o2d_1.toString());
532
+ return readString(buffered(get_SystemFileSystem().d49(it)));
533
+ }
534
+ function write(_this__u8e3s4, string) {
535
+ // Inline function 'kotlin.also' call
536
+ var this_0 = Path(_this__u8e3s4.o2d_1.toString());
537
+ // Inline function 'community.flock.wirespec.plugin.cli.write.<anonymous>' call
538
+ var tmp0_safe_receiver = this_0.m49();
539
+ if (tmp0_safe_receiver == null)
540
+ null;
541
+ else
542
+ createIfNotExists(tmp0_safe_receiver);
543
+ // Inline function 'kotlin.let' call
544
+ // Inline function 'community.flock.wirespec.plugin.cli.write.<anonymous>' call
545
+ // Inline function 'kotlin.apply' call
546
+ var this_1 = buffered_0(get_SystemFileSystem().f49(this_0));
547
+ // Inline function 'community.flock.wirespec.plugin.cli.write.<anonymous>.<anonymous>' call
548
+ writeString(this_1, string);
549
+ this_1.p8();
550
+ return Unit_instance;
551
+ }
552
+ function handleError(string) {
553
+ throw new CliktError(string);
554
+ }
555
+ function createIfNotExists(_this__u8e3s4, create) {
556
+ create = create === VOID ? true : create;
557
+ // Inline function 'kotlin.also' call
558
+ // Inline function 'community.flock.wirespec.plugin.cli.createIfNotExists.<anonymous>' call
559
+ if (create && !get_SystemFileSystem().b49(_this__u8e3s4)) {
560
+ get_SystemFileSystem().c49(_this__u8e3s4, true);
561
+ }
562
+ return _this__u8e3s4;
563
+ }
564
+ function isWirespecFile(path) {
565
+ return get_extension(path) === FileExtension_Wirespec_getInstance().i2d_1;
566
+ }
567
+ function isRegularFile(path) {
568
+ var tmp0_safe_receiver = get_SystemFileSystem().g49(path);
569
+ return (tmp0_safe_receiver == null ? null : tmp0_safe_receiver.i49_1) === true;
570
+ }
571
+ function get_extension(_this__u8e3s4) {
572
+ return substringAfterLast(_this__u8e3s4.q2(), _Char___init__impl__6a9atx(46), '');
573
+ }
574
+ function WirespecResult_init_$Init$(pair, $this) {
575
+ WirespecResult.call($this, pair.ke_1, pair.le_1);
576
+ return $this;
577
+ }
578
+ function WirespecResult_init_$Create$(pair) {
579
+ return WirespecResult_init_$Init$(pair, objectCreate(protoOf(WirespecResult)));
580
+ }
581
+ function WirespecResult(file, emitted) {
582
+ this.c4d_1 = file;
583
+ this.d4d_1 = emitted;
584
+ }
585
+ protoOf(WirespecResult).yd = function () {
586
+ return this.c4d_1;
587
+ };
588
+ protoOf(WirespecResult).zd = function () {
589
+ return this.d4d_1;
590
+ };
591
+ protoOf(WirespecResult).toString = function () {
592
+ return 'WirespecResult(file=' + toString(this.c4d_1) + ', emitted=' + this.d4d_1.toString() + ')';
593
+ };
594
+ protoOf(WirespecResult).hashCode = function () {
595
+ var result = hashCode(this.c4d_1);
596
+ result = imul(result, 31) + this.d4d_1.hashCode() | 0;
597
+ return result;
598
+ };
599
+ protoOf(WirespecResult).equals = function (other) {
600
+ if (this === other)
601
+ return true;
602
+ if (!(other instanceof WirespecResult))
603
+ return false;
604
+ var tmp0_other_with_cast = other instanceof WirespecResult ? other : THROW_CCE();
605
+ if (!equals(this.c4d_1, tmp0_other_with_cast.c4d_1))
606
+ return false;
607
+ if (!this.d4d_1.equals(tmp0_other_with_cast.d4d_1))
608
+ return false;
609
+ return true;
610
+ };
611
+ function isRegularFile$ref() {
612
+ var l = function (p0) {
613
+ return isRegularFile(p0);
614
+ };
615
+ l.callableName = 'isRegularFile';
616
+ return l;
617
+ }
618
+ function isWirespecFile$ref() {
619
+ var l = function (p0) {
620
+ return isWirespecFile(p0);
621
+ };
622
+ l.callableName = 'isWirespecFile';
623
+ return l;
624
+ }
625
+ function wirespecFiles$lambda(it) {
626
+ return it.q2();
627
+ }
628
+ function wirespecFiles$lambda_0(it) {
629
+ return dropLast(it, FileExtension_Wirespec_getInstance().i2d_1.length + 1 | 0);
630
+ }
631
+ function wirespecFiles$lambda_1($this_wirespecFiles) {
632
+ return function (it) {
633
+ return new FilePath($this_wirespecFiles.e2d_1, _FileName___init__impl__nzn12e(it));
634
+ };
635
+ }
636
+ function WirespecFile$_init_$ref_cj1n5j() {
637
+ var l = function (p0) {
638
+ return new WirespecFile(p0);
639
+ };
640
+ l.callableName = '<init>';
641
+ return l;
642
+ }
643
+ function Options_Input_getInstance() {
644
+ Options_initEntries();
645
+ return Options_Input_instance;
646
+ }
647
+ function Options_Output_getInstance() {
648
+ Options_initEntries();
649
+ return Options_Output_instance;
650
+ }
651
+ function Options_Language_getInstance() {
652
+ Options_initEntries();
653
+ return Options_Language_instance;
654
+ }
655
+ function Options_PackageName_getInstance() {
656
+ Options_initEntries();
657
+ return Options_PackageName_instance;
658
+ }
659
+ function Options_LogLevel_getInstance() {
660
+ Options_initEntries();
661
+ return Options_LogLevel_instance;
662
+ }
663
+ function Options_Shared_getInstance() {
664
+ Options_initEntries();
665
+ return Options_Shared_instance;
666
+ }
667
+ function Options_Strict_getInstance() {
668
+ Options_initEntries();
669
+ return Options_Strict_instance;
670
+ }
671
+ function languages$factory() {
672
+ return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
673
+ return _get_languages__ojonze(receiver);
674
+ }, null);
675
+ }
676
+ function languages$factory_0() {
677
+ return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
678
+ return _get_languages__ojonze(receiver);
679
+ }, null);
680
+ }
681
+ function format$factory() {
682
+ return getPropertyCallableRef('format', 1, KProperty1, function (receiver) {
683
+ return _get_format__qlarck(receiver);
684
+ }, null);
685
+ }
686
+ function languages$factory_1() {
687
+ return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
688
+ return _get_languages__ojonze_0(receiver);
689
+ }, null);
690
+ }
691
+ function format$factory_0() {
692
+ return getPropertyCallableRef('format', 1, KProperty1, function (receiver) {
693
+ return _get_format__qlarck(receiver);
694
+ }, null);
695
+ }
696
+ function languages$factory_2() {
697
+ return getPropertyCallableRef('languages', 1, KProperty1, function (receiver) {
698
+ return _get_languages__ojonze_0(receiver);
699
+ }, null);
700
+ }
701
+ function inputPath$factory() {
702
+ return getPropertyCallableRef('inputPath', 1, KProperty1, function (receiver) {
703
+ return receiver.u4b();
704
+ }, null);
705
+ }
706
+ function outputPath$factory() {
707
+ return getPropertyCallableRef('outputPath', 1, KProperty1, function (receiver) {
708
+ return receiver.w4b();
709
+ }, null);
710
+ }
711
+ function packageName$factory() {
712
+ return getPropertyCallableRef('packageName', 1, KProperty1, function (receiver) {
713
+ return receiver.y4b();
714
+ }, null);
715
+ }
716
+ function logLevel$factory() {
717
+ return getPropertyCallableRef('logLevel', 1, KProperty1, function (receiver) {
718
+ return receiver.z4b();
719
+ }, null);
720
+ }
721
+ function shared$factory() {
722
+ return getPropertyCallableRef('shared', 1, KProperty1, function (receiver) {
723
+ return receiver.m48();
724
+ }, null);
725
+ }
726
+ function strict$factory() {
727
+ return getPropertyCallableRef('strict', 1, KProperty1, function (receiver) {
728
+ return receiver.b4c();
729
+ }, null);
730
+ }
731
+ function inputPath$factory_0() {
732
+ return getPropertyCallableRef('inputPath', 1, KProperty1, function (receiver) {
733
+ return receiver.u4b();
734
+ }, null);
735
+ }
736
+ function outputPath$factory_0() {
737
+ return getPropertyCallableRef('outputPath', 1, KProperty1, function (receiver) {
738
+ return receiver.w4b();
739
+ }, null);
740
+ }
741
+ function packageName$factory_0() {
742
+ return getPropertyCallableRef('packageName', 1, KProperty1, function (receiver) {
743
+ return receiver.y4b();
744
+ }, null);
745
+ }
746
+ function logLevel$factory_0() {
747
+ return getPropertyCallableRef('logLevel', 1, KProperty1, function (receiver) {
748
+ return receiver.z4b();
749
+ }, null);
750
+ }
751
+ function shared$factory_0() {
752
+ return getPropertyCallableRef('shared', 1, KProperty1, function (receiver) {
753
+ return receiver.m48();
754
+ }, null);
755
+ }
756
+ function strict$factory_0() {
757
+ return getPropertyCallableRef('strict', 1, KProperty1, function (receiver) {
758
+ return receiver.b4c();
759
+ }, null);
760
+ }
761
+ function compile_0(arguments_0) {
762
+ var context = compile$lambda(arguments_0);
763
+ // Inline function 'arrow.core.NonEmptySet.flatMap' call
764
+ var this_0 = arguments_0.i2c_1;
765
+ // Inline function 'kotlin.collections.flatMap' call
766
+ var tmp0 = _NonEmptySet___get_elements__impl__g09gj9(this_0);
767
+ // Inline function 'kotlin.collections.flatMapTo' call
768
+ var destination = ArrayList_init_$Create$();
769
+ var _iterator__ex2g4s = tmp0.g();
770
+ while (_iterator__ex2g4s.h()) {
771
+ var element = _iterator__ex2g4s.i();
772
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>' call
773
+ var list = wirespec(context(element, arguments_0.j2c_1));
774
+ addAll(destination, list);
775
+ }
776
+ // Inline function 'kotlin.let' call
777
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>' call
778
+ var it = ensureNotNull(toNonEmptyListOrNull(destination));
779
+ // Inline function 'arrow.core.raise.either' call
780
+ // Inline function 'arrow.core.raise.fold' call
781
+ // Inline function 'kotlin.contracts.contract' call
782
+ // Inline function 'arrow.core.raise.fold' call
783
+ // Inline function 'kotlin.contracts.contract' call
784
+ var raise = new DefaultRaise(false);
785
+ var tmp;
786
+ try {
787
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
788
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>.<anonymous>' call
789
+ var res = raise.ml(it);
790
+ raise.il();
791
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
792
+ tmp = new Right(res);
793
+ } catch ($p) {
794
+ var tmp_0;
795
+ if ($p instanceof RaiseCancellationException) {
796
+ var e = $p;
797
+ raise.il();
798
+ // Inline function 'arrow.core.raise.either.<anonymous>' call
799
+ var it_0 = raisedOrRethrow(e, raise);
800
+ tmp_0 = new Left(it_0);
801
+ } else {
802
+ if ($p instanceof Error) {
803
+ var e_0 = $p;
804
+ raise.il();
805
+ throw nonFatalOrThrow(e_0);
806
+ } else {
807
+ throw $p;
808
+ }
809
+ }
810
+ tmp = tmp_0;
811
+ }
812
+ // Inline function 'kotlin.let' call
813
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>' call
814
+ var either = tmp;
815
+ if (either instanceof Right) {
816
+ // Inline function 'arrow.core.NonEmptyList.flatMap' call
817
+ var this_1 = either.pk_1;
818
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>.<anonymous>' call
819
+ var destruct = this_1.uk_1;
820
+ var file = destruct.yd();
821
+ var results = destruct.zd();
822
+ // Inline function 'arrow.core.NonEmptyList.map' call
823
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>.<anonymous>.<anonymous>' call
824
+ var destruct_0 = results.uk_1;
825
+ var name = destruct_0.yd();
826
+ var result = destruct_0.zd();
827
+ var tmp_1 = to(file.p2d(_FileName___init__impl__nzn12e(name)), result);
828
+ // Inline function 'kotlin.collections.map' call
829
+ var this_2 = results.vk_1;
830
+ // Inline function 'kotlin.collections.mapTo' call
831
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
832
+ var _iterator__ex2g4s_0 = this_2.g();
833
+ while (_iterator__ex2g4s_0.h()) {
834
+ var item = _iterator__ex2g4s_0.i();
835
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>.<anonymous>.<anonymous>' call
836
+ var name_0 = item.yd();
837
+ var result_0 = item.zd();
838
+ var tmp$ret$14 = to(file.p2d(_FileName___init__impl__nzn12e(name_0)), result_0);
839
+ destination_0.e(tmp$ret$14);
840
+ }
841
+ var tmp_2 = (new NonEmptyList(tmp_1, destination_0)).sk();
842
+ // Inline function 'kotlin.collections.flatMap' call
843
+ var tmp0_0 = this_1.vk_1;
844
+ // Inline function 'kotlin.collections.flatMapTo' call
845
+ var destination_1 = ArrayList_init_$Create$();
846
+ var _iterator__ex2g4s_1 = tmp0_0.g();
847
+ while (_iterator__ex2g4s_1.h()) {
848
+ var element_0 = _iterator__ex2g4s_1.i();
849
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>.<anonymous>' call
850
+ var file_0 = element_0.yd();
851
+ var results_0 = element_0.zd();
852
+ // Inline function 'arrow.core.NonEmptyList.map' call
853
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>.<anonymous>.<anonymous>' call
854
+ var destruct_1 = results_0.uk_1;
855
+ var name_1 = destruct_1.yd();
856
+ var result_1 = destruct_1.zd();
857
+ var tmp_3 = to(file_0.p2d(_FileName___init__impl__nzn12e(name_1)), result_1);
858
+ // Inline function 'kotlin.collections.map' call
859
+ var this_3 = results_0.vk_1;
860
+ // Inline function 'kotlin.collections.mapTo' call
861
+ var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_3, 10));
862
+ var _iterator__ex2g4s_2 = this_3.g();
863
+ while (_iterator__ex2g4s_2.h()) {
864
+ var item_0 = _iterator__ex2g4s_2.i();
865
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>.<anonymous>.<anonymous>' call
866
+ var name_2 = item_0.yd();
867
+ var result_2 = item_0.zd();
868
+ var tmp$ret$20 = to(file_0.p2d(_FileName___init__impl__nzn12e(name_2)), result_2);
869
+ destination_2.e(tmp$ret$20);
870
+ }
871
+ var list_0 = new NonEmptyList(tmp_3, destination_2);
872
+ addAll(destination_1, list_0);
873
+ }
874
+ // Inline function 'kotlin.collections.forEach' call
875
+ var _iterator__ex2g4s_3 = tmp_2.zk(destination_1).g();
876
+ while (_iterator__ex2g4s_3.h()) {
877
+ var element_1 = _iterator__ex2g4s_3.i();
878
+ // Inline function 'community.flock.wirespec.plugin.cli.compile.<anonymous>.<anonymous>' call
879
+ var file_1 = element_1.yd();
880
+ var result_3 = element_1.zd();
881
+ arguments_0.l2c_1(file_1, result_3);
882
+ }
883
+ } else {
884
+ if (either instanceof Left) {
885
+ arguments_0.m2c_1(joinToString(either.jk_1, VOID, VOID, VOID, VOID, VOID, compile$lambda_0));
886
+ } else {
887
+ noWhenBranchMatchedException();
888
+ }
889
+ }
890
+ return Unit_instance;
891
+ }
892
+ function wirespec(_this__u8e3s4) {
893
+ // Inline function 'arrow.core.NonEmptyList.map' call
894
+ var this_0 = emitters(_this__u8e3s4.e4d(), _this__u8e3s4.y4b(), _this__u8e3s4.l2g());
895
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>' call
896
+ var destruct = this_0.uk_1;
897
+ var emitter = destruct.yd();
898
+ var file = destruct.zd();
899
+ var errorOrResults = compile(new wirespec$1(_this__u8e3s4, emitter), _this__u8e3s4.s1b());
900
+ var tmp;
901
+ if (emitter.j23_1) {
902
+ // Inline function 'arrow.core.Either.map' call
903
+ // Inline function 'kotlin.contracts.contract' call
904
+ // Inline function 'arrow.core.flatMap' call
905
+ // Inline function 'kotlin.contracts.contract' call
906
+ var tmp_0;
907
+ if (errorOrResults instanceof Right) {
908
+ // Inline function 'arrow.core.Either.map.<anonymous>' call
909
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.<anonymous>' call
910
+ var it = errorOrResults.pk_1;
911
+ var tmp$ret$0 = to(file, it);
912
+ tmp_0 = new Right(tmp$ret$0);
913
+ } else {
914
+ if (errorOrResults instanceof Left) {
915
+ tmp_0 = errorOrResults;
916
+ } else {
917
+ noWhenBranchMatchedException();
918
+ }
919
+ }
920
+ tmp = tmp_0;
921
+ } else {
922
+ // Inline function 'arrow.core.Either.map' call
923
+ // Inline function 'kotlin.contracts.contract' call
924
+ // Inline function 'arrow.core.flatMap' call
925
+ // Inline function 'kotlin.contracts.contract' call
926
+ var tmp_1;
927
+ if (errorOrResults instanceof Right) {
928
+ // Inline function 'arrow.core.Either.map.<anonymous>' call
929
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.<anonymous>' call
930
+ var it_0 = errorOrResults.pk_1;
931
+ var tmp$ret$4 = to(file, nonEmptyListOf(new Emitted(Companion_getInstance().c25(_FileName___get_value__impl__3u4cz6(_this__u8e3s4.l2g()(FileExtension_Wirespec_getInstance()).k2d_1)), first_0(it_0).n26_1), []));
932
+ tmp_1 = new Right(tmp$ret$4);
933
+ } else {
934
+ if (errorOrResults instanceof Left) {
935
+ tmp_1 = errorOrResults;
936
+ } else {
937
+ noWhenBranchMatchedException();
938
+ }
939
+ }
940
+ tmp = tmp_1;
941
+ }
942
+ // Inline function 'arrow.core.Either.map' call
943
+ // Inline function 'kotlin.contracts.contract' call
944
+ // Inline function 'arrow.core.flatMap' call
945
+ var this_1 = tmp;
946
+ // Inline function 'kotlin.contracts.contract' call
947
+ var tmp_2;
948
+ if (this_1 instanceof Right) {
949
+ // Inline function 'arrow.core.Either.map.<anonymous>' call
950
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.stub_for_inlining' call
951
+ var p0 = this_1.pk_1;
952
+ var tmp$ret$8 = WirespecResult_init_$Create$(p0);
953
+ tmp_2 = new Right(tmp$ret$8);
954
+ } else {
955
+ if (this_1 instanceof Left) {
956
+ tmp_2 = this_1;
957
+ } else {
958
+ noWhenBranchMatchedException();
959
+ }
960
+ }
961
+ var tmp_3 = tmp_2;
962
+ // Inline function 'kotlin.collections.map' call
963
+ var this_2 = this_0.vk_1;
964
+ // Inline function 'kotlin.collections.mapTo' call
965
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_2, 10));
966
+ var _iterator__ex2g4s = this_2.g();
967
+ while (_iterator__ex2g4s.h()) {
968
+ var item = _iterator__ex2g4s.i();
969
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>' call
970
+ var emitter_0 = item.yd();
971
+ var file_0 = item.zd();
972
+ var errorOrResults_0 = compile(new wirespec$1(_this__u8e3s4, emitter_0), _this__u8e3s4.s1b());
973
+ var tmp_4;
974
+ if (emitter_0.j23_1) {
975
+ // Inline function 'arrow.core.Either.map' call
976
+ // Inline function 'kotlin.contracts.contract' call
977
+ // Inline function 'arrow.core.flatMap' call
978
+ // Inline function 'kotlin.contracts.contract' call
979
+ var tmp_5;
980
+ if (errorOrResults_0 instanceof Right) {
981
+ // Inline function 'arrow.core.Either.map.<anonymous>' call
982
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.<anonymous>' call
983
+ var it_1 = errorOrResults_0.pk_1;
984
+ var tmp$ret$13 = to(file_0, it_1);
985
+ tmp_5 = new Right(tmp$ret$13);
986
+ } else {
987
+ if (errorOrResults_0 instanceof Left) {
988
+ tmp_5 = errorOrResults_0;
989
+ } else {
990
+ noWhenBranchMatchedException();
991
+ }
992
+ }
993
+ tmp_4 = tmp_5;
994
+ } else {
995
+ // Inline function 'arrow.core.Either.map' call
996
+ // Inline function 'kotlin.contracts.contract' call
997
+ // Inline function 'arrow.core.flatMap' call
998
+ // Inline function 'kotlin.contracts.contract' call
999
+ var tmp_6;
1000
+ if (errorOrResults_0 instanceof Right) {
1001
+ // Inline function 'arrow.core.Either.map.<anonymous>' call
1002
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.<anonymous>' call
1003
+ var it_2 = errorOrResults_0.pk_1;
1004
+ var tmp$ret$17 = to(file_0, nonEmptyListOf(new Emitted(Companion_getInstance().c25(_FileName___get_value__impl__3u4cz6(_this__u8e3s4.l2g()(FileExtension_Wirespec_getInstance()).k2d_1)), first_0(it_2).n26_1), []));
1005
+ tmp_6 = new Right(tmp$ret$17);
1006
+ } else {
1007
+ if (errorOrResults_0 instanceof Left) {
1008
+ tmp_6 = errorOrResults_0;
1009
+ } else {
1010
+ noWhenBranchMatchedException();
1011
+ }
1012
+ }
1013
+ tmp_4 = tmp_6;
1014
+ }
1015
+ // Inline function 'arrow.core.Either.map' call
1016
+ // Inline function 'kotlin.contracts.contract' call
1017
+ // Inline function 'arrow.core.flatMap' call
1018
+ var this_3 = tmp_4;
1019
+ // Inline function 'kotlin.contracts.contract' call
1020
+ var tmp_7;
1021
+ if (this_3 instanceof Right) {
1022
+ // Inline function 'arrow.core.Either.map.<anonymous>' call
1023
+ // Inline function 'community.flock.wirespec.plugin.cli.wirespec.<anonymous>.stub_for_inlining' call
1024
+ var p0_0 = this_3.pk_1;
1025
+ var tmp$ret$21 = WirespecResult_init_$Create$(p0_0);
1026
+ tmp_7 = new Right(tmp$ret$21);
1027
+ } else {
1028
+ if (this_3 instanceof Left) {
1029
+ tmp_7 = this_3;
1030
+ } else {
1031
+ noWhenBranchMatchedException();
1032
+ }
1033
+ }
1034
+ var tmp$ret$25 = tmp_7;
1035
+ destination.e(tmp$ret$25);
1036
+ }
1037
+ return new NonEmptyList(tmp_3, destination);
1038
+ }
1039
+ function compile$context$1$1($arguments, $file, $output) {
1040
+ this.j4d_1 = $arguments;
1041
+ this.k4d_1 = $file;
1042
+ this.f4d_1 = $arguments.n2c_1;
1043
+ var tmp = this;
1044
+ var tmp0_elvis_lhs = $arguments.o2c_1;
1045
+ tmp.g4d_1 = tmp0_elvis_lhs == null ? new PackageName('community.flock.wirespec.generated') : tmp0_elvis_lhs;
1046
+ this.h4d_1 = out($file, $arguments.o2c_1, $output);
1047
+ this.i4d_1 = new Logger($arguments.p2c_1);
1048
+ }
1049
+ protoOf(compile$context$1$1).e4d = function () {
1050
+ return this.f4d_1;
1051
+ };
1052
+ protoOf(compile$context$1$1).y4b = function () {
1053
+ return this.g4d_1;
1054
+ };
1055
+ protoOf(compile$context$1$1).l2g = function () {
1056
+ return this.h4d_1;
1057
+ };
1058
+ protoOf(compile$context$1$1).y22 = function () {
1059
+ return this.i4d_1;
1060
+ };
1061
+ protoOf(compile$context$1$1).s1b = function () {
1062
+ return this.j4d_1.k2c_1(this.k4d_1);
1063
+ };
1064
+ function compile$lambda($arguments) {
1065
+ return function (file, output) {
1066
+ return new compile$context$1$1($arguments, file, output);
1067
+ };
1068
+ }
1069
+ function compile$lambda_0(it) {
1070
+ return it.g9();
1071
+ }
1072
+ function wirespec$1($this_wirespec, $emitter) {
1073
+ this.l4d_1 = $this_wirespec.y22();
1074
+ this.m4d_1 = $emitter;
1075
+ }
1076
+ protoOf(wirespec$1).y22 = function () {
1077
+ return this.l4d_1;
1078
+ };
1079
+ protoOf(wirespec$1).i23 = function () {
1080
+ return this.m4d_1;
1081
+ };
1082
+ function convert(arguments_0) {
1083
+ var packageName = arguments_0.z2c_1;
1084
+ var jsonFile = arguments_0.t2c_1;
1085
+ var tmp;
1086
+ switch (arguments_0.s2c_1.p2_1) {
1087
+ case 0:
1088
+ tmp = OpenAPIV2Parser$parse$ref(OpenAPIV2Parser_instance);
1089
+ break;
1090
+ case 1:
1091
+ tmp = OpenAPIV3Parser$parse$ref(OpenAPIV3Parser_instance);
1092
+ break;
1093
+ case 2:
1094
+ tmp = AvroParser$parse$ref(AvroParser_instance);
1095
+ break;
1096
+ default:
1097
+ noWhenBranchMatchedException();
1098
+ break;
1099
+ }
1100
+ var ast = tmp(arguments_0.v2c_1(jsonFile), arguments_0.c2d_1);
1101
+ var path = out(jsonFile, packageName, arguments_0.u2c_1);
1102
+ // Inline function 'arrow.core.NonEmptyList.map' call
1103
+ var this_0 = emitters(arguments_0.y2c_1, packageName == null ? new PackageName('community.flock.wirespec.generated') : packageName, path);
1104
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>' call
1105
+ var destruct = this_0.uk_1;
1106
+ var emitter = destruct.yd();
1107
+ var file = destruct.zd();
1108
+ var results = emitter.k23(ast, new Logger(arguments_0.a2d_1));
1109
+ var tmp_0;
1110
+ if (emitter.j23_1) {
1111
+ tmp_0 = to(file, results);
1112
+ } else {
1113
+ // Inline function 'kotlin.text.replaceFirstChar' call
1114
+ var this_1 = _FileName___get_value__impl__3u4cz6(jsonFile.o2d_1.k2d_1);
1115
+ var tmp_1;
1116
+ // Inline function 'kotlin.text.isNotEmpty' call
1117
+ if (charSequenceLength(this_1) > 0) {
1118
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>.stub_for_inlining' call
1119
+ // Inline function 'kotlin.text.uppercase' call
1120
+ var this_2 = charSequenceGet(this_1, 0);
1121
+ // Inline function 'kotlin.js.asDynamic' call
1122
+ // Inline function 'kotlin.js.unsafeCast' call
1123
+ var tmp$ret$4 = toString_0(this_2).toUpperCase();
1124
+ var tmp_2 = toString(tmp$ret$4);
1125
+ // Inline function 'kotlin.text.substring' call
1126
+ // Inline function 'kotlin.js.asDynamic' call
1127
+ tmp_1 = tmp_2 + this_1.substring(1);
1128
+ } else {
1129
+ tmp_1 = this_1;
1130
+ }
1131
+ var tmp$ret$7 = tmp_1;
1132
+ tmp_0 = to(file, nonEmptyListOf(new Emitted(tmp$ret$7, first_0(results).n26_1), []));
1133
+ }
1134
+ // Inline function 'kotlin.let' call
1135
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>.stub_for_inlining' call
1136
+ var p0 = tmp_0;
1137
+ var tmp_3 = WirespecResult_init_$Create$(p0);
1138
+ // Inline function 'kotlin.collections.map' call
1139
+ var this_3 = this_0.vk_1;
1140
+ // Inline function 'kotlin.collections.mapTo' call
1141
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_3, 10));
1142
+ var _iterator__ex2g4s = this_3.g();
1143
+ while (_iterator__ex2g4s.h()) {
1144
+ var item = _iterator__ex2g4s.i();
1145
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>' call
1146
+ var emitter_0 = item.yd();
1147
+ var file_0 = item.zd();
1148
+ var results_0 = emitter_0.k23(ast, new Logger(arguments_0.a2d_1));
1149
+ var tmp_4;
1150
+ if (emitter_0.j23_1) {
1151
+ tmp_4 = to(file_0, results_0);
1152
+ } else {
1153
+ // Inline function 'kotlin.text.replaceFirstChar' call
1154
+ var this_4 = _FileName___get_value__impl__3u4cz6(jsonFile.o2d_1.k2d_1);
1155
+ var tmp_5;
1156
+ // Inline function 'kotlin.text.isNotEmpty' call
1157
+ if (charSequenceLength(this_4) > 0) {
1158
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>.stub_for_inlining' call
1159
+ // Inline function 'kotlin.text.uppercase' call
1160
+ var this_5 = charSequenceGet(this_4, 0);
1161
+ // Inline function 'kotlin.js.asDynamic' call
1162
+ // Inline function 'kotlin.js.unsafeCast' call
1163
+ var tmp$ret$15 = toString_0(this_5).toUpperCase();
1164
+ var tmp_6 = toString(tmp$ret$15);
1165
+ // Inline function 'kotlin.text.substring' call
1166
+ // Inline function 'kotlin.js.asDynamic' call
1167
+ tmp_5 = tmp_6 + this_4.substring(1);
1168
+ } else {
1169
+ tmp_5 = this_4;
1170
+ }
1171
+ var tmp$ret$18 = tmp_5;
1172
+ tmp_4 = to(file_0, nonEmptyListOf(new Emitted(tmp$ret$18, first_0(results_0).n26_1), []));
1173
+ }
1174
+ // Inline function 'kotlin.let' call
1175
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>.stub_for_inlining' call
1176
+ var p0_0 = tmp_4;
1177
+ var tmp$ret$21 = WirespecResult_init_$Create$(p0_0);
1178
+ destination.e(tmp$ret$21);
1179
+ }
1180
+ // Inline function 'arrow.core.NonEmptyList.flatMap' call
1181
+ var this_6 = new NonEmptyList(tmp_3, destination);
1182
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>' call
1183
+ var destruct_0 = this_6.uk_1;
1184
+ var file_1 = destruct_0.yd();
1185
+ var results_1 = destruct_0.zd();
1186
+ // Inline function 'arrow.core.NonEmptyList.map' call
1187
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>.<anonymous>' call
1188
+ var destruct_1 = results_1.uk_1;
1189
+ var name = destruct_1.yd();
1190
+ var result = destruct_1.zd();
1191
+ var tmp_7 = to(file_1.p2d(_FileName___init__impl__nzn12e(name)), result);
1192
+ // Inline function 'kotlin.collections.map' call
1193
+ var this_7 = results_1.vk_1;
1194
+ // Inline function 'kotlin.collections.mapTo' call
1195
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_7, 10));
1196
+ var _iterator__ex2g4s_0 = this_7.g();
1197
+ while (_iterator__ex2g4s_0.h()) {
1198
+ var item_0 = _iterator__ex2g4s_0.i();
1199
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>.<anonymous>' call
1200
+ var name_0 = item_0.yd();
1201
+ var result_0 = item_0.zd();
1202
+ var tmp$ret$26 = to(file_1.p2d(_FileName___init__impl__nzn12e(name_0)), result_0);
1203
+ destination_0.e(tmp$ret$26);
1204
+ }
1205
+ var tmp_8 = (new NonEmptyList(tmp_7, destination_0)).sk();
1206
+ // Inline function 'kotlin.collections.flatMap' call
1207
+ var tmp0 = this_6.vk_1;
1208
+ // Inline function 'kotlin.collections.flatMapTo' call
1209
+ var destination_1 = ArrayList_init_$Create$();
1210
+ var _iterator__ex2g4s_1 = tmp0.g();
1211
+ while (_iterator__ex2g4s_1.h()) {
1212
+ var element = _iterator__ex2g4s_1.i();
1213
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>' call
1214
+ var file_2 = element.yd();
1215
+ var results_2 = element.zd();
1216
+ // Inline function 'arrow.core.NonEmptyList.map' call
1217
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>.<anonymous>' call
1218
+ var destruct_2 = results_2.uk_1;
1219
+ var name_1 = destruct_2.yd();
1220
+ var result_1 = destruct_2.zd();
1221
+ var tmp_9 = to(file_2.p2d(_FileName___init__impl__nzn12e(name_1)), result_1);
1222
+ // Inline function 'kotlin.collections.map' call
1223
+ var this_8 = results_2.vk_1;
1224
+ // Inline function 'kotlin.collections.mapTo' call
1225
+ var destination_2 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_8, 10));
1226
+ var _iterator__ex2g4s_2 = this_8.g();
1227
+ while (_iterator__ex2g4s_2.h()) {
1228
+ var item_1 = _iterator__ex2g4s_2.i();
1229
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>.<anonymous>' call
1230
+ var name_2 = item_1.yd();
1231
+ var result_2 = item_1.zd();
1232
+ var tmp$ret$32 = to(file_2.p2d(_FileName___init__impl__nzn12e(name_2)), result_2);
1233
+ destination_2.e(tmp$ret$32);
1234
+ }
1235
+ var list = new NonEmptyList(tmp_9, destination_2);
1236
+ addAll(destination_1, list);
1237
+ }
1238
+ var _iterator__ex2g4s_3 = tmp_8.zk(destination_1).g();
1239
+ while (_iterator__ex2g4s_3.h()) {
1240
+ var element_0 = _iterator__ex2g4s_3.i();
1241
+ // Inline function 'community.flock.wirespec.plugin.cli.convert.<anonymous>' call
1242
+ var file_3 = element_0.yd();
1243
+ var result_3 = element_0.zd();
1244
+ arguments_0.w2c_1(file_3, result_3);
1245
+ }
1246
+ return Unit_instance;
1247
+ }
1248
+ function OpenAPIV2Parser$parse$ref($boundThis) {
1249
+ var l = function (p0, p1) {
1250
+ return $boundThis.o2b(p0, p1);
1251
+ };
1252
+ l.callableName = 'parse';
1253
+ return l;
1254
+ }
1255
+ function OpenAPIV3Parser$parse$ref($boundThis) {
1256
+ var l = function (p0, p1) {
1257
+ return $boundThis.o2b(p0, p1);
1258
+ };
1259
+ l.callableName = 'parse';
1260
+ return l;
1261
+ }
1262
+ function AvroParser$parse$ref($boundThis) {
1263
+ var l = function (p0, p1) {
1264
+ return $boundThis.o2b(p0, p1);
1265
+ };
1266
+ l.callableName = 'parse';
1267
+ return l;
1268
+ }
1269
+ function main(args) {
1270
+ // Inline function 'kotlin.collections.mapNotNull' call
1271
+ var tmp0 = numberRangeToNumber(0, 20);
1272
+ // Inline function 'kotlin.collections.mapNotNullTo' call
1273
+ var destination = ArrayList_init_$Create$();
1274
+ // Inline function 'kotlin.collections.forEach' call
1275
+ var inductionVariable = tmp0.d1_1;
1276
+ var last = tmp0.e1_1;
1277
+ if (inductionVariable <= last)
1278
+ do {
1279
+ var element = inductionVariable;
1280
+ inductionVariable = inductionVariable + 1 | 0;
1281
+ // Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
1282
+ // Inline function 'community.flock.wirespec.plugin.cli.main.stub_for_inlining' call
1283
+ var p0 = element;
1284
+ var tmp0_safe_receiver = orNull(args, p0);
1285
+ if (tmp0_safe_receiver == null)
1286
+ null;
1287
+ else {
1288
+ // Inline function 'kotlin.let' call
1289
+ // Inline function 'kotlin.collections.mapNotNullTo.<anonymous>.<anonymous>' call
1290
+ destination.e(tmp0_safe_receiver);
1291
+ }
1292
+ }
1293
+ while (!(element === last));
1294
+ // Inline function 'kotlin.collections.toTypedArray' call
1295
+ var tmp4 = copyToArray(destination);
1296
+ var tmp = Companion_instance_3;
1297
+ var tmp_0 = compile$ref();
1298
+ // Inline function 'kotlin.let' call
1299
+ // Inline function 'community.flock.wirespec.plugin.cli.main.stub_for_inlining' call
1300
+ tmp.u49(tmp_0, convert$ref()).n3u(tmp4);
1301
+ }
1302
+ function out(_this__u8e3s4, packageName, output) {
1303
+ return out$lambda(output, packageName, _this__u8e3s4);
1304
+ }
1305
+ function emitters(_this__u8e3s4, packageName, path) {
1306
+ // Inline function 'arrow.core.NonEmptySet.map' call
1307
+ // Inline function 'kotlin.collections.map' call
1308
+ var this_0 = _NonEmptySet___get_elements__impl__g09gj9(_this__u8e3s4);
1309
+ // Inline function 'kotlin.collections.mapTo' call
1310
+ var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1311
+ var _iterator__ex2g4s = this_0.g();
1312
+ while (_iterator__ex2g4s.h()) {
1313
+ var item = _iterator__ex2g4s.i();
1314
+ // Inline function 'community.flock.wirespec.plugin.cli.emitters.<anonymous>' call
1315
+ var tmp;
1316
+ switch (item.p2_1) {
1317
+ case 0:
1318
+ tmp = to(new JavaEmitter(packageName), new JavaFile(path(FileExtension_Java_getInstance())));
1319
+ break;
1320
+ case 1:
1321
+ tmp = to(new KotlinEmitter(packageName), new KotlinFile(path(FileExtension_Kotlin_getInstance())));
1322
+ break;
1323
+ case 2:
1324
+ tmp = to(new ScalaEmitter(packageName), new ScalaFile(path(FileExtension_Scala_getInstance())));
1325
+ break;
1326
+ case 3:
1327
+ tmp = to(new TypeScriptEmitter(), new TypeScriptFile(path(FileExtension_TypeScript_getInstance())));
1328
+ break;
1329
+ case 4:
1330
+ tmp = to(new WirespecEmitter(), new WirespecFile(path(FileExtension_Wirespec_getInstance())));
1331
+ break;
1332
+ case 5:
1333
+ tmp = to(OpenAPIV2Emitter_getInstance(), new JsonFile(path(FileExtension_JSON_getInstance())));
1334
+ break;
1335
+ case 6:
1336
+ tmp = to(OpenAPIV3Emitter_getInstance(), new JsonFile(path(FileExtension_JSON_getInstance())));
1337
+ break;
1338
+ default:
1339
+ noWhenBranchMatchedException();
1340
+ break;
1341
+ }
1342
+ var tmp$ret$0 = tmp;
1343
+ destination.e(tmp$ret$0);
1344
+ }
1345
+ return ensureNotNull(toNonEmptyListOrNull(destination));
1346
+ }
1347
+ function compile$ref() {
1348
+ var l = function (p0) {
1349
+ compile_0(p0);
1350
+ return Unit_instance;
1351
+ };
1352
+ l.callableName = 'compile';
1353
+ return l;
1354
+ }
1355
+ function convert$ref() {
1356
+ var l = function (p0) {
1357
+ convert(p0);
1358
+ return Unit_instance;
1359
+ };
1360
+ l.callableName = 'convert';
1361
+ return l;
1362
+ }
1363
+ function out$lambda($output, $packageName, $this_out) {
1364
+ return function (extension) {
1365
+ var tmp0_safe_receiver = $packageName;
1366
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.m28_1;
1367
+ // Inline function 'kotlin.collections.orEmpty' call
1368
+ var tmp0_elvis_lhs = tmp1_safe_receiver == null ? null : split(tmp1_safe_receiver, charArrayOf([_Char___init__impl__6a9atx(46)]));
1369
+ var tmp$ret$0 = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs;
1370
+ var dir = plus_0($output.e2d_1, '/' + joinToString(tmp$ret$0, '/'));
1371
+ return $this_out.o2d_1.n2d(dir, VOID, extension);
1372
+ };
1373
+ }
1374
+ function cli(args) {
1375
+ main(args);
1376
+ }
1377
+ function parser(source) {
1378
+ var tmp0_safe_receiver = parse(new parser$1(), source).ok();
1379
+ var tmp;
1380
+ if (tmp0_safe_receiver == null) {
1381
+ tmp = null;
1382
+ } else {
1383
+ // Inline function 'kotlin.collections.filterIsInstance' call
1384
+ // Inline function 'kotlin.collections.filterIsInstanceTo' call
1385
+ var destination = ArrayList_init_$Create$();
1386
+ var _iterator__ex2g4s = tmp0_safe_receiver.g();
1387
+ while (_iterator__ex2g4s.h()) {
1388
+ var element = _iterator__ex2g4s.i();
1389
+ if (!(element == null) ? isInterface(element, Definition) : false) {
1390
+ destination.e(element);
1391
+ }
1392
+ }
1393
+ tmp = destination;
1394
+ }
1395
+ var tmp1_safe_receiver = tmp;
1396
+ var tmp_0;
1397
+ if (tmp1_safe_receiver == null) {
1398
+ tmp_0 = null;
1399
+ } else {
1400
+ // Inline function 'kotlin.collections.map' call
1401
+ // Inline function 'kotlin.collections.mapTo' call
1402
+ var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(tmp1_safe_receiver, 10));
1403
+ var _iterator__ex2g4s_0 = tmp1_safe_receiver.g();
1404
+ while (_iterator__ex2g4s_0.h()) {
1405
+ var item = _iterator__ex2g4s_0.i();
1406
+ // Inline function 'community.flock.wirespec.plugin.cli.parser.<anonymous>' call
1407
+ var tmp$ret$2 = produce(item);
1408
+ destination_0.e(tmp$ret$2);
1409
+ }
1410
+ tmp_0 = destination_0;
1411
+ }
1412
+ var tmp2_safe_receiver = tmp_0;
1413
+ var tmp_1;
1414
+ if (tmp2_safe_receiver == null) {
1415
+ tmp_1 = null;
1416
+ } else {
1417
+ // Inline function 'kotlin.collections.toTypedArray' call
1418
+ tmp_1 = copyToArray(tmp2_safe_receiver);
1419
+ }
1420
+ var tmp3_elvis_lhs = tmp_1;
1421
+ var tmp_2;
1422
+ if (tmp3_elvis_lhs == null) {
1423
+ var message = 'Cannot parse source';
1424
+ throw IllegalStateException_init_$Create$(toString(message));
1425
+ } else {
1426
+ tmp_2 = tmp3_elvis_lhs;
1427
+ }
1428
+ return tmp_2;
1429
+ }
1430
+ function parser$1() {
1431
+ }
1432
+ function get_nodeArgs() {
1433
+ _init_properties_CommandLineArguments_kt__b5v7hl();
1434
+ return nodeArgs;
1435
+ }
1436
+ var nodeArgs;
1437
+ function orNull(_this__u8e3s4, idx) {
1438
+ _init_properties_CommandLineArguments_kt__b5v7hl();
1439
+ // Inline function 'arrow.core.Companion.catch' call
1440
+ // Inline function 'arrow.core.raise.catch' call
1441
+ var tmp;
1442
+ try {
1443
+ // Inline function 'arrow.core.Companion.catch.<anonymous>' call
1444
+ // Inline function 'community.flock.wirespec.plugin.utils.orNull.<anonymous>' call
1445
+ var tmp$ret$0 = get_nodeArgs()[idx];
1446
+ tmp = right(tmp$ret$0);
1447
+ } catch ($p) {
1448
+ var tmp_0;
1449
+ if ($p instanceof Error) {
1450
+ var t = $p;
1451
+ // Inline function 'arrow.core.Companion.catch.<anonymous>' call
1452
+ var it = nonFatalOrThrow(t);
1453
+ tmp_0 = left(it);
1454
+ } else {
1455
+ throw $p;
1456
+ }
1457
+ tmp = tmp_0;
1458
+ }
1459
+ return tmp.ok();
1460
+ }
1461
+ var properties_initialized_CommandLineArguments_kt_ekn5uh;
1462
+ function _init_properties_CommandLineArguments_kt__b5v7hl() {
1463
+ if (!properties_initialized_CommandLineArguments_kt_ekn5uh) {
1464
+ properties_initialized_CommandLineArguments_kt_ekn5uh = true;
1465
+ var tmp = process.argv.slice(2);
1466
+ nodeArgs = (!(tmp == null) ? isArray(tmp) : false) ? tmp : THROW_CCE();
1467
+ }
1468
+ }
1469
+ //region block: post-declaration
1470
+ protoOf(wirespec$1).h23 = get_spec;
1471
+ protoOf(parser$1).h23 = get_spec;
1472
+ protoOf(parser$1).y22 = get_logger;
1473
+ //endregion
1474
+ //region block: init
1475
+ Companion_instance_3 = new Companion();
1476
+ //endregion
1477
+ //region block: exports
1478
+ export {
1479
+ cli as cli,
1480
+ parser as parser,
1481
+ };
1482
+ export {
1483
+ main as main18ozy59zvnjcv,
1484
+ };
1485
+ //endregion
1486
+
1487
+ //# sourceMappingURL=wirespec-src-plugin-cli.mjs.map