git-digger 1.1.26

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.
@@ -0,0 +1,797 @@
1
+ (function (_, kotlin_kotlin, kotlin_com_zegreatrob_tools_digger_model, kotlin_org_jetbrains_kotlinx_kotlinx_datetime) {
2
+ 'use strict';
3
+ //region block: imports
4
+ var imul = Math.imul;
5
+ var emptyList = kotlin_kotlin.$_$.t4;
6
+ var lastOrNull = kotlin_kotlin.$_$.m5;
7
+ var listOf = kotlin_kotlin.$_$.r5;
8
+ var to = kotlin_kotlin.$_$.cd;
9
+ var plus = kotlin_kotlin.$_$.c6;
10
+ var numberRangeToNumber = kotlin_kotlin.$_$.p8;
11
+ var slice = kotlin_kotlin.$_$.j6;
12
+ var VOID = kotlin_kotlin.$_$.g;
13
+ var protoOf = kotlin_kotlin.$_$.w8;
14
+ var getStringHashCode = kotlin_kotlin.$_$.z7;
15
+ var hashCode = kotlin_kotlin.$_$.a8;
16
+ var THROW_CCE = kotlin_kotlin.$_$.hc;
17
+ var equals = kotlin_kotlin.$_$.u7;
18
+ var classMeta = kotlin_kotlin.$_$.s7;
19
+ var setMetadataFor = kotlin_kotlin.$_$.x8;
20
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.h4;
21
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.l;
22
+ var Unit_instance = kotlin_kotlin.$_$.k3;
23
+ var firstOrNull = kotlin_kotlin.$_$.x4;
24
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.m;
25
+ var maxOrNull = kotlin_kotlin.$_$.v5;
26
+ var Contribution = kotlin_com_zegreatrob_tools_digger_model.$_$.a;
27
+ var listOf_0 = kotlin_kotlin.$_$.s5;
28
+ var plus_0 = kotlin_kotlin.$_$.b6;
29
+ var addAll = kotlin_kotlin.$_$.y3;
30
+ var toSet = kotlin_kotlin.$_$.z6;
31
+ var sorted = kotlin_kotlin.$_$.n6;
32
+ var toList = kotlin_kotlin.$_$.u6;
33
+ var joinToString = kotlin_kotlin.$_$.g5;
34
+ var compareTo = kotlin_kotlin.$_$.t7;
35
+ var sortedWith = kotlin_kotlin.$_$.m6;
36
+ var getOrNull = kotlin_kotlin.$_$.b5;
37
+ var Comparator = kotlin_kotlin.$_$.yb;
38
+ var compareValues = kotlin_kotlin.$_$.f7;
39
+ var split = kotlin_kotlin.$_$.fb;
40
+ var charSequenceLength = kotlin_kotlin.$_$.q7;
41
+ var Companion_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_datetime.$_$.b;
42
+ var isCharSequence = kotlin_kotlin.$_$.g8;
43
+ var trim = kotlin_kotlin.$_$.sb;
44
+ var toString = kotlin_kotlin.$_$.z8;
45
+ var reversed = kotlin_kotlin.$_$.f6;
46
+ var last = kotlin_kotlin.$_$.p5;
47
+ var Regex_init_$Create$ = kotlin_kotlin.$_$.u;
48
+ var objectMeta = kotlin_kotlin.$_$.v8;
49
+ var RuntimeException_init_$Create$ = kotlin_kotlin.$_$.o1;
50
+ var contains = kotlin_kotlin.$_$.ca;
51
+ var mapOf = kotlin_kotlin.$_$.u5;
52
+ var RegexOption_IGNORE_CASE_getInstance = kotlin_kotlin.$_$.h;
53
+ var RegexOption_MULTILINE_getInstance = kotlin_kotlin.$_$.i;
54
+ var setOf = kotlin_kotlin.$_$.h6;
55
+ var Regex = kotlin_kotlin.$_$.y9;
56
+ var firstOrNull_0 = kotlin_kotlin.$_$.ha;
57
+ var lastIndexOf = kotlin_kotlin.$_$.ta;
58
+ var Char = kotlin_kotlin.$_$.vb;
59
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.s1;
60
+ var mapNotNull = kotlin_kotlin.$_$.u9;
61
+ var toList_0 = kotlin_kotlin.$_$.x9;
62
+ var maxOrNull_0 = kotlin_kotlin.$_$.w9;
63
+ var get = kotlin_kotlin.$_$.ja;
64
+ var toIntOrNull = kotlin_kotlin.$_$.mb;
65
+ var Companion_instance = kotlin_kotlin.$_$.f3;
66
+ var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.w1;
67
+ var createFailure = kotlin_kotlin.$_$.uc;
68
+ var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.z1;
69
+ var _Result___get_isFailure__impl__jpiriv = kotlin_kotlin.$_$.x1;
70
+ var Enum = kotlin_kotlin.$_$.zb;
71
+ var first = kotlin_kotlin.$_$.y4;
72
+ var copyToArray = kotlin_kotlin.$_$.p4;
73
+ var json = kotlin_kotlin.$_$.o8;
74
+ //endregion
75
+ //region block: pre-declaration
76
+ setMetadataFor(CommitInspectionResult, 'CommitInspectionResult', classMeta);
77
+ setMetadataFor(CommitRef, 'CommitRef', classMeta);
78
+ setMetadataFor(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', classMeta, VOID, [Comparator]);
79
+ setMetadataFor(DiggerCore, 'DiggerCore', classMeta);
80
+ setMetadataFor(DiggerGitWrapper, 'DiggerGitWrapper', classMeta);
81
+ setMetadataFor(MessageDigResult, 'MessageDigResult', classMeta);
82
+ setMetadataFor(Defaults, 'Defaults', objectMeta);
83
+ setMetadataFor(MessageDigger, 'MessageDigger', classMeta, VOID, VOID, MessageDigger);
84
+ setMetadataFor(SemverType, 'SemverType', classMeta, Enum);
85
+ setMetadataFor(TagRef, 'TagRef', classMeta);
86
+ //endregion
87
+ function allContributionCommits(_this__u8e3s4) {
88
+ var tagList = _this__u8e3s4.m17();
89
+ // Inline function 'kotlin.collections.fold' call
90
+ var this_0 = _this__u8e3s4.n17();
91
+ var accumulator = emptyList();
92
+ var tmp0_iterator = this_0.r();
93
+ while (tmp0_iterator.s()) {
94
+ var element = tmp0_iterator.u();
95
+ // Inline function 'com.zegreatrob.tools.digger.core.allContributionCommits.<anonymous>' call
96
+ var acc = accumulator;
97
+ // Inline function 'kotlin.collections.find' call
98
+ var tmp$ret$1;
99
+ $l$block: {
100
+ // Inline function 'kotlin.collections.firstOrNull' call
101
+ var tmp0_iterator_0 = tagList.r();
102
+ while (tmp0_iterator_0.s()) {
103
+ var element_0 = tmp0_iterator_0.u();
104
+ // Inline function 'com.zegreatrob.tools.digger.core.allContributionCommits.<anonymous>.<anonymous>' call
105
+ if (element_0.p17_1 === element.r17_1) {
106
+ tmp$ret$1 = element_0;
107
+ break $l$block;
108
+ }
109
+ }
110
+ tmp$ret$1 = null;
111
+ }
112
+ var tag = tmp$ret$1;
113
+ var tmp;
114
+ if (!(tag == null)) {
115
+ tmp = plus(acc, to(tag, listOf(element)));
116
+ } else {
117
+ var lastPair = lastOrNull(acc);
118
+ var lastList = lastPair == null ? null : lastPair.z5_1;
119
+ var tmp_0;
120
+ if (!(lastList == null)) {
121
+ var tmp_1 = slice(acc, numberRangeToNumber(0, acc.l() - 2 | 0));
122
+ // Inline function 'kotlin.collections.plusElement' call
123
+ var tmp$ret$3 = plus(lastList, element);
124
+ tmp_0 = plus(tmp_1, lastPair.kf(VOID, tmp$ret$3));
125
+ } else {
126
+ tmp_0 = plus(acc, to(null, listOf(element)));
127
+ }
128
+ tmp = tmp_0;
129
+ }
130
+ accumulator = tmp;
131
+ }
132
+ return accumulator;
133
+ }
134
+ function CommitInspectionResult(storyId, ease, authors, semver) {
135
+ this.w17_1 = storyId;
136
+ this.x17_1 = ease;
137
+ this.y17_1 = authors;
138
+ this.z17_1 = semver;
139
+ }
140
+ protoOf(CommitInspectionResult).toString = function () {
141
+ return 'CommitInspectionResult(storyId=' + this.w17_1 + ', ease=' + this.x17_1 + ', authors=' + this.y17_1 + ', semver=' + this.z17_1 + ')';
142
+ };
143
+ protoOf(CommitInspectionResult).hashCode = function () {
144
+ var result = this.w17_1 == null ? 0 : getStringHashCode(this.w17_1);
145
+ result = imul(result, 31) + (this.x17_1 == null ? 0 : this.x17_1) | 0;
146
+ result = imul(result, 31) + hashCode(this.y17_1) | 0;
147
+ result = imul(result, 31) + (this.z17_1 == null ? 0 : this.z17_1.hashCode()) | 0;
148
+ return result;
149
+ };
150
+ protoOf(CommitInspectionResult).equals = function (other) {
151
+ if (this === other)
152
+ return true;
153
+ if (!(other instanceof CommitInspectionResult))
154
+ return false;
155
+ var tmp0_other_with_cast = other instanceof CommitInspectionResult ? other : THROW_CCE();
156
+ if (!(this.w17_1 == tmp0_other_with_cast.w17_1))
157
+ return false;
158
+ if (!(this.x17_1 == tmp0_other_with_cast.x17_1))
159
+ return false;
160
+ if (!equals(this.y17_1, tmp0_other_with_cast.y17_1))
161
+ return false;
162
+ if (!equals(this.z17_1, tmp0_other_with_cast.z17_1))
163
+ return false;
164
+ return true;
165
+ };
166
+ function CommitRef(id, authorEmail, committerEmail, dateTime, fullMessage) {
167
+ this.r17_1 = id;
168
+ this.s17_1 = authorEmail;
169
+ this.t17_1 = committerEmail;
170
+ this.u17_1 = dateTime;
171
+ this.v17_1 = fullMessage;
172
+ }
173
+ protoOf(CommitRef).toString = function () {
174
+ return 'CommitRef(id=' + this.r17_1 + ', authorEmail=' + this.s17_1 + ', committerEmail=' + this.t17_1 + ', dateTime=' + this.u17_1 + ', fullMessage=' + this.v17_1 + ')';
175
+ };
176
+ protoOf(CommitRef).hashCode = function () {
177
+ var result = getStringHashCode(this.r17_1);
178
+ result = imul(result, 31) + getStringHashCode(this.s17_1) | 0;
179
+ result = imul(result, 31) + getStringHashCode(this.t17_1) | 0;
180
+ result = imul(result, 31) + this.u17_1.hashCode() | 0;
181
+ result = imul(result, 31) + getStringHashCode(this.v17_1) | 0;
182
+ return result;
183
+ };
184
+ protoOf(CommitRef).equals = function (other) {
185
+ if (this === other)
186
+ return true;
187
+ if (!(other instanceof CommitRef))
188
+ return false;
189
+ var tmp0_other_with_cast = other instanceof CommitRef ? other : THROW_CCE();
190
+ if (!(this.r17_1 === tmp0_other_with_cast.r17_1))
191
+ return false;
192
+ if (!(this.s17_1 === tmp0_other_with_cast.s17_1))
193
+ return false;
194
+ if (!(this.t17_1 === tmp0_other_with_cast.t17_1))
195
+ return false;
196
+ if (!this.u17_1.equals(tmp0_other_with_cast.u17_1))
197
+ return false;
198
+ if (!(this.v17_1 === tmp0_other_with_cast.v17_1))
199
+ return false;
200
+ return true;
201
+ };
202
+ function contribution(_this__u8e3s4, commitRefs) {
203
+ // Inline function 'kotlin.collections.map' call
204
+ // Inline function 'kotlin.collections.mapTo' call
205
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(commitRefs, 10));
206
+ var tmp0_iterator = commitRefs.r();
207
+ while (tmp0_iterator.s()) {
208
+ var item = tmp0_iterator.u();
209
+ // Inline function 'com.zegreatrob.tools.digger.core.contribution.<anonymous>' call
210
+ var tmp$ret$0 = commitInspectionResult(item, _this__u8e3s4.g18(item.v17_1));
211
+ destination.o(tmp$ret$0);
212
+ }
213
+ var messageDigResults = destination;
214
+ var lastCommit = firstOrNull(commitRefs);
215
+ var firstCommit = lastOrNull(commitRefs);
216
+ var tmp1_elvis_lhs = lastCommit == null ? null : lastCommit.r17_1;
217
+ var tmp7_lastCommit = tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs;
218
+ var tmp3_elvis_lhs = firstCommit == null ? null : firstCommit.r17_1;
219
+ var tmp8_firstCommit = tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs;
220
+ var tmp9_authors = allAuthors(messageDigResults);
221
+ var tmp10_dateTime = lastCommit == null ? null : lastCommit.u17_1;
222
+ var tmp11_firstCommitDateTime = firstCommit == null ? null : firstCommit.u17_1;
223
+ // Inline function 'kotlin.collections.mapNotNull' call
224
+ // Inline function 'kotlin.collections.mapNotNullTo' call
225
+ var destination_0 = ArrayList_init_$Create$_0();
226
+ // Inline function 'kotlin.collections.forEach' call
227
+ var tmp0_iterator_0 = messageDigResults.r();
228
+ while (tmp0_iterator_0.s()) {
229
+ var element = tmp0_iterator_0.u();
230
+ // Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
231
+ // Inline function 'com.zegreatrob.tools.digger.core.contribution.<anonymous>' call
232
+ var tmp0_safe_receiver = element.x17_1;
233
+ if (tmp0_safe_receiver == null)
234
+ null;
235
+ else {
236
+ // Inline function 'kotlin.let' call
237
+ // Inline function 'kotlin.contracts.contract' call
238
+ destination_0.o(tmp0_safe_receiver);
239
+ }
240
+ }
241
+ var tmp12_ease = maxOrNull(destination_0);
242
+ var tmp13_storyId = mergedStoryIds(messageDigResults);
243
+ // Inline function 'kotlin.collections.mapNotNull' call
244
+ // Inline function 'kotlin.collections.mapNotNullTo' call
245
+ var destination_1 = ArrayList_init_$Create$_0();
246
+ // Inline function 'kotlin.collections.forEach' call
247
+ var tmp0_iterator_1 = messageDigResults.r();
248
+ while (tmp0_iterator_1.s()) {
249
+ var element_0 = tmp0_iterator_1.u();
250
+ // Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
251
+ // Inline function 'com.zegreatrob.tools.digger.core.contribution.<anonymous>' call
252
+ var tmp0_safe_receiver_0 = element_0.z17_1;
253
+ if (tmp0_safe_receiver_0 == null)
254
+ null;
255
+ else {
256
+ // Inline function 'kotlin.let' call
257
+ // Inline function 'kotlin.contracts.contract' call
258
+ destination_1.o(tmp0_safe_receiver_0);
259
+ }
260
+ }
261
+ var tmp6_safe_receiver = highestPrioritySemver(destination_1);
262
+ var tmp14_semver = tmp6_safe_receiver == null ? null : tmp6_safe_receiver.toString();
263
+ // Inline function 'kotlin.collections.count' call
264
+ var tmp15_commitCount = commitRefs.l();
265
+ return new Contribution(tmp7_lastCommit, tmp8_firstCommit, tmp9_authors, tmp15_commitCount, tmp10_dateTime, tmp11_firstCommitDateTime, tmp12_ease, tmp13_storyId, tmp14_semver, null, null, null);
266
+ }
267
+ function commitInspectionResult(_this__u8e3s4, digResult) {
268
+ return new CommitInspectionResult(digResult.h18_1, digResult.i18_1, plus_0(listOf_0([_this__u8e3s4.t17_1, _this__u8e3s4.s17_1]), digResult.j18_1), digResult.k18_1);
269
+ }
270
+ function allAuthors(messageDigResults) {
271
+ // Inline function 'kotlin.collections.map' call
272
+ // Inline function 'kotlin.collections.flatMap' call
273
+ // Inline function 'kotlin.collections.flatMapTo' call
274
+ var destination = ArrayList_init_$Create$_0();
275
+ var tmp0_iterator = messageDigResults.r();
276
+ while (tmp0_iterator.s()) {
277
+ var element = tmp0_iterator.u();
278
+ var list = element.y17_1;
279
+ addAll(destination, list);
280
+ }
281
+ // Inline function 'kotlin.collections.mapTo' call
282
+ var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(destination, 10));
283
+ var tmp0_iterator_0 = destination.r();
284
+ while (tmp0_iterator_0.s()) {
285
+ var item = tmp0_iterator_0.u();
286
+ // Inline function 'com.zegreatrob.tools.digger.core.allAuthors.<anonymous>' call
287
+ // Inline function 'kotlin.text.lowercase' call
288
+ // Inline function 'kotlin.js.asDynamic' call
289
+ var tmp$ret$5 = item.toLowerCase();
290
+ destination_0.o(tmp$ret$5);
291
+ }
292
+ return toList(sorted(toSet(destination_0)));
293
+ }
294
+ function mergedStoryIds(messageDigResults) {
295
+ // Inline function 'kotlin.let' call
296
+ // Inline function 'kotlin.collections.mapNotNull' call
297
+ // Inline function 'kotlin.collections.mapNotNullTo' call
298
+ var destination = ArrayList_init_$Create$_0();
299
+ // Inline function 'kotlin.collections.forEach' call
300
+ var tmp0_iterator = messageDigResults.r();
301
+ while (tmp0_iterator.s()) {
302
+ var element = tmp0_iterator.u();
303
+ // Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
304
+ var tmp0_safe_receiver = element.w17_1;
305
+ if (tmp0_safe_receiver == null)
306
+ null;
307
+ else {
308
+ // Inline function 'kotlin.let' call
309
+ // Inline function 'kotlin.contracts.contract' call
310
+ destination.o(tmp0_safe_receiver);
311
+ }
312
+ }
313
+ // Inline function 'kotlin.contracts.contract' call
314
+ // Inline function 'com.zegreatrob.tools.digger.core.mergedStoryIds.<anonymous>' call
315
+ var tmp;
316
+ // Inline function 'kotlin.collections.isNotEmpty' call
317
+ if (!destination.y()) {
318
+ tmp = joinToString(sorted(toSet(destination)), ', ');
319
+ } else {
320
+ tmp = null;
321
+ }
322
+ return tmp;
323
+ }
324
+ function currentCommitTag(_this__u8e3s4) {
325
+ var tmp$ret$0;
326
+ $l$block_0: {
327
+ // Inline function 'kotlin.collections.maxByOrNull' call
328
+ var iterator = _this__u8e3s4.m17().r();
329
+ if (!iterator.s()) {
330
+ tmp$ret$0 = null;
331
+ break $l$block_0;
332
+ }
333
+ var maxElem = iterator.u();
334
+ if (!iterator.s()) {
335
+ tmp$ret$0 = maxElem;
336
+ break $l$block_0;
337
+ }
338
+ // Inline function 'com.zegreatrob.tools.digger.core.currentCommitTag.<anonymous>' call
339
+ var maxValue = maxElem.q17_1;
340
+ do {
341
+ var e = iterator.u();
342
+ // Inline function 'com.zegreatrob.tools.digger.core.currentCommitTag.<anonymous>' call
343
+ var v = e.q17_1;
344
+ if (compareTo(maxValue, v) < 0) {
345
+ maxElem = e;
346
+ maxValue = v;
347
+ }
348
+ }
349
+ while (iterator.s());
350
+ tmp$ret$0 = maxElem;
351
+ }
352
+ var firstTag = tmp$ret$0;
353
+ var headCommitId = _this__u8e3s4.l18();
354
+ var tmp;
355
+ if (!((firstTag == null ? null : firstTag.p17_1) === headCommitId)) {
356
+ tmp = null;
357
+ } else {
358
+ tmp = firstTag;
359
+ }
360
+ return tmp;
361
+ }
362
+ function currentContributionCommits(_this__u8e3s4) {
363
+ var tag = previousTag(_this__u8e3s4);
364
+ var tmp;
365
+ if (tag == null) {
366
+ tmp = _this__u8e3s4.n17();
367
+ } else {
368
+ return _this__u8e3s4.m18(tag.o17_1, 'HEAD');
369
+ }
370
+ return tmp;
371
+ }
372
+ function previousTag(_this__u8e3s4) {
373
+ // Inline function 'kotlin.collections.sortedByDescending' call
374
+ var this_0 = _this__u8e3s4.m17();
375
+ // Inline function 'kotlin.comparisons.compareByDescending' call
376
+ var tmp = previousTag$lambda;
377
+ var tmp$ret$0 = new sam$kotlin_Comparator$0(tmp);
378
+ var tagList = sortedWith(this_0, tmp$ret$0);
379
+ var tag = firstOrNull(tagList);
380
+ var tmp_0;
381
+ if ((tag == null ? null : tag.p17_1) === _this__u8e3s4.l18()) {
382
+ tmp_0 = getOrNull(tagList, 1);
383
+ } else {
384
+ tmp_0 = tag;
385
+ }
386
+ return tmp_0;
387
+ }
388
+ function sam$kotlin_Comparator$0(function_0) {
389
+ this.n18_1 = function_0;
390
+ }
391
+ protoOf(sam$kotlin_Comparator$0).r9 = function (a, b) {
392
+ return this.n18_1(a, b);
393
+ };
394
+ protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
395
+ return this.r9(a, b);
396
+ };
397
+ function previousTag$lambda(a, b) {
398
+ // Inline function 'kotlin.comparisons.compareValuesBy' call
399
+ // Inline function 'com.zegreatrob.tools.digger.core.previousTag.<anonymous>' call
400
+ var tmp = b.q17_1;
401
+ // Inline function 'com.zegreatrob.tools.digger.core.previousTag.<anonymous>' call
402
+ var tmp$ret$1 = a.q17_1;
403
+ return compareValues(tmp, tmp$ret$1);
404
+ }
405
+ function DiggerCore(label, gitWrapper, messageDigger) {
406
+ this.o18_1 = label;
407
+ this.p18_1 = gitWrapper;
408
+ this.q18_1 = messageDigger;
409
+ }
410
+ protoOf(DiggerCore).r18 = function () {
411
+ // Inline function 'kotlin.with' call
412
+ // Inline function 'kotlin.contracts.contract' call
413
+ // Inline function 'com.zegreatrob.tools.digger.core.DiggerCore.currentContributionData.<anonymous>' call
414
+ var $this$with = this.p18_1;
415
+ var currentCommitTag_0 = currentCommitTag($this$with);
416
+ var tmp = contribution(this.q18_1, currentContributionCommits($this$with));
417
+ var tmp_0 = currentCommitTag_0 == null ? null : currentCommitTag_0.o17_1;
418
+ return tmp.j17(VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, this.o18_1, tmp_0, currentCommitTag_0 == null ? null : currentCommitTag_0.q17_1);
419
+ };
420
+ protoOf(DiggerCore).s18 = function () {
421
+ // Inline function 'kotlin.collections.map' call
422
+ // Inline function 'kotlin.collections.map' call
423
+ var this_0 = allContributionCommits(this.p18_1);
424
+ // Inline function 'kotlin.collections.mapTo' call
425
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
426
+ var tmp0_iterator = this_0.r();
427
+ while (tmp0_iterator.s()) {
428
+ var item = tmp0_iterator.u();
429
+ // Inline function 'com.zegreatrob.tools.digger.core.DiggerCore.allContributionData.<anonymous>' call
430
+ var tmp$ret$0 = to(item.y5_1, contribution(this.q18_1, toList(item.z5_1)));
431
+ destination.o(tmp$ret$0);
432
+ }
433
+ // Inline function 'kotlin.collections.mapTo' call
434
+ var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(destination, 10));
435
+ var tmp0_iterator_0 = destination.r();
436
+ while (tmp0_iterator_0.s()) {
437
+ var item_0 = tmp0_iterator_0.u();
438
+ // Inline function 'com.zegreatrob.tools.digger.core.DiggerCore.allContributionData.<anonymous>' call
439
+ var tag = item_0.a6();
440
+ var contribution_0 = item_0.b6();
441
+ var tmp = tag == null ? null : tag.o17_1;
442
+ var tmp$ret$3 = contribution_0.j17(VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, this.o18_1, tmp, tag == null ? null : tag.q17_1);
443
+ destination_0.o(tmp$ret$3);
444
+ }
445
+ return destination_0;
446
+ };
447
+ function parseLog($this, outputText) {
448
+ // Inline function 'kotlin.collections.map' call
449
+ // Inline function 'kotlin.collections.filter' call
450
+ // Inline function 'kotlin.collections.filterTo' call
451
+ var this_0 = split(outputText, [$this.l17_1 + '\n']);
452
+ var destination = ArrayList_init_$Create$_0();
453
+ var tmp0_iterator = this_0.r();
454
+ while (tmp0_iterator.s()) {
455
+ var element = tmp0_iterator.u();
456
+ // Inline function 'com.zegreatrob.tools.digger.core.DiggerGitWrapper.parseLog.<anonymous>' call
457
+ // Inline function 'kotlin.text.isNotEmpty' call
458
+ if (charSequenceLength(element) > 0) {
459
+ destination.o(element);
460
+ }
461
+ }
462
+ // Inline function 'kotlin.collections.mapTo' call
463
+ var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(destination, 10));
464
+ var tmp0_iterator_0 = destination.r();
465
+ while (tmp0_iterator_0.s()) {
466
+ var item = tmp0_iterator_0.u();
467
+ // Inline function 'com.zegreatrob.tools.digger.core.DiggerGitWrapper.parseLog.<anonymous>' call
468
+ var elements = split(item, ['\n']);
469
+ var tmp$ret$4 = new CommitRef(elements.c1(0), elements.c1(1), elements.c1(2), Companion_getInstance().n16(elements.c1(3)), joinToString(elements.z1(4, elements.l()), '\n'));
470
+ destination_0.o(tmp$ret$4);
471
+ }
472
+ return destination_0;
473
+ }
474
+ function DiggerGitWrapper(workingDirectory) {
475
+ this.k17_1 = workingDirectory;
476
+ this.l17_1 = '--------!--------';
477
+ }
478
+ protoOf(DiggerGitWrapper).l18 = function () {
479
+ var outputText = runProcess(listOf_0(['git', '--no-pager', 'rev-parse', 'HEAD']), this.k17_1);
480
+ // Inline function 'kotlin.text.trim' call
481
+ return toString(trim(isCharSequence(outputText) ? outputText : THROW_CCE()));
482
+ };
483
+ protoOf(DiggerGitWrapper).m17 = function () {
484
+ var outputText = runProcess(listOf_0(['git', '--no-pager', 'tag', '--list', '--format=%(refname:strip=2),%(*objectname),%(creatordate:iso-strict)']), this.k17_1);
485
+ // Inline function 'kotlin.collections.mapNotNull' call
486
+ // Inline function 'kotlin.collections.mapNotNullTo' call
487
+ var this_0 = split(outputText, ['\n']);
488
+ var destination = ArrayList_init_$Create$_0();
489
+ // Inline function 'kotlin.collections.forEach' call
490
+ var tmp0_iterator = this_0.r();
491
+ while (tmp0_iterator.s()) {
492
+ var element = tmp0_iterator.u();
493
+ // Inline function 'kotlin.collections.mapNotNullTo.<anonymous>' call
494
+ // Inline function 'com.zegreatrob.tools.digger.core.DiggerGitWrapper.listTags.<anonymous>' call
495
+ var commaSplit = split(element, [',']);
496
+ var tmp;
497
+ if (commaSplit.l() >= 3) {
498
+ tmp = new TagRef(joinToString(commaSplit.z1(0, commaSplit.l() - 2 | 0), ''), reversed(commaSplit).c1(1), Companion_getInstance().n16(last(commaSplit)));
499
+ } else {
500
+ tmp = null;
501
+ }
502
+ var tmp0_safe_receiver = tmp;
503
+ if (tmp0_safe_receiver == null)
504
+ null;
505
+ else {
506
+ // Inline function 'kotlin.let' call
507
+ // Inline function 'kotlin.contracts.contract' call
508
+ destination.o(tmp0_safe_receiver);
509
+ }
510
+ }
511
+ var output = destination;
512
+ return output;
513
+ };
514
+ protoOf(DiggerGitWrapper).n17 = function () {
515
+ return parseLog(this, runProcess(listOf_0(['git', '--no-pager', 'log', '--format=%H%n%ae%n%ce%n%aI%n%B%n' + this.l17_1]), this.k17_1));
516
+ };
517
+ protoOf(DiggerGitWrapper).m18 = function (begin, end) {
518
+ return parseLog(this, runProcess(listOf_0(['git', '--no-pager', 'log', '--format=%H%n%ae%n%ce%n%aI%n%B%n' + this.l17_1, begin + '..' + end]), this.k17_1));
519
+ };
520
+ function MessageDigResult(storyId, ease, coauthors, semver) {
521
+ this.h18_1 = storyId;
522
+ this.i18_1 = ease;
523
+ this.j18_1 = coauthors;
524
+ this.k18_1 = semver;
525
+ }
526
+ protoOf(MessageDigResult).toString = function () {
527
+ return 'MessageDigResult(storyId=' + this.h18_1 + ', ease=' + this.i18_1 + ', coauthors=' + this.j18_1 + ', semver=' + this.k18_1 + ')';
528
+ };
529
+ protoOf(MessageDigResult).hashCode = function () {
530
+ var result = this.h18_1 == null ? 0 : getStringHashCode(this.h18_1);
531
+ result = imul(result, 31) + (this.i18_1 == null ? 0 : this.i18_1) | 0;
532
+ result = imul(result, 31) + hashCode(this.j18_1) | 0;
533
+ result = imul(result, 31) + (this.k18_1 == null ? 0 : this.k18_1.hashCode()) | 0;
534
+ return result;
535
+ };
536
+ protoOf(MessageDigResult).equals = function (other) {
537
+ if (this === other)
538
+ return true;
539
+ if (!(other instanceof MessageDigResult))
540
+ return false;
541
+ var tmp0_other_with_cast = other instanceof MessageDigResult ? other : THROW_CCE();
542
+ if (!(this.h18_1 == tmp0_other_with_cast.h18_1))
543
+ return false;
544
+ if (!(this.i18_1 == tmp0_other_with_cast.i18_1))
545
+ return false;
546
+ if (!equals(this.j18_1, tmp0_other_with_cast.j18_1))
547
+ return false;
548
+ if (!equals(this.k18_1, tmp0_other_with_cast.k18_1))
549
+ return false;
550
+ return true;
551
+ };
552
+ function Defaults() {
553
+ Defaults_instance = this;
554
+ this.t18_1 = Regex_init_$Create$('\\[major\\]');
555
+ this.u18_1 = Regex_init_$Create$('\\[minor\\]');
556
+ this.v18_1 = Regex_init_$Create$('\\[patch\\]');
557
+ this.w18_1 = Regex_init_$Create$('\\[none\\]');
558
+ this.x18_1 = Regex_init_$Create$('\\[(?<storyId>.*?)\\]');
559
+ this.y18_1 = Regex_init_$Create$('-(?<ease>[1-5])-');
560
+ }
561
+ var Defaults_instance;
562
+ function Defaults_getInstance() {
563
+ if (Defaults_instance == null)
564
+ new Defaults();
565
+ return Defaults_instance;
566
+ }
567
+ function MessageDigger(majorRegex, minorRegex, patchRegex, noneRegex, storyIdRegex, easeRegex) {
568
+ majorRegex = majorRegex === VOID ? Defaults_getInstance().t18_1 : majorRegex;
569
+ minorRegex = minorRegex === VOID ? Defaults_getInstance().u18_1 : minorRegex;
570
+ patchRegex = patchRegex === VOID ? Defaults_getInstance().v18_1 : patchRegex;
571
+ noneRegex = noneRegex === VOID ? Defaults_getInstance().w18_1 : noneRegex;
572
+ storyIdRegex = storyIdRegex === VOID ? Defaults_getInstance().x18_1 : storyIdRegex;
573
+ easeRegex = easeRegex === VOID ? Defaults_getInstance().y18_1 : easeRegex;
574
+ if (!contains(storyIdRegex.d8_1, '?<storyId>')) {
575
+ throw RuntimeException_init_$Create$('StoryIdRegex must include a storyId group. The regex was: ' + storyIdRegex.d8_1);
576
+ }
577
+ if (!contains(easeRegex.d8_1, '?<ease>')) {
578
+ throw RuntimeException_init_$Create$('EaseRegex must include an ease group. The regex was: ' + easeRegex.d8_1);
579
+ }
580
+ this.a18_1 = mapOf([to('major', majorRegex), to('minor', minorRegex), to('patch', patchRegex), to('none', noneRegex)]);
581
+ var tmp = this;
582
+ // Inline function 'kotlin.collections.map' call
583
+ var this_0 = this.a18_1;
584
+ // Inline function 'kotlin.collections.mapTo' call
585
+ var destination = ArrayList_init_$Create$(this_0.l());
586
+ // Inline function 'kotlin.collections.iterator' call
587
+ var tmp0_iterator = this_0.l2().r();
588
+ while (tmp0_iterator.s()) {
589
+ var item = tmp0_iterator.u();
590
+ // Inline function 'com.zegreatrob.tools.digger.core.MessageDigger.allSemverRegex.<anonymous>' call
591
+ // Inline function 'kotlin.collections.component1' call
592
+ var group = item.m2();
593
+ // Inline function 'kotlin.collections.component2' call
594
+ var regex = item.n2();
595
+ var tmp$ret$3 = '(?<' + group + '>' + cleaned(regex) + ')?';
596
+ destination.o(tmp$ret$3);
597
+ }
598
+ tmp.b18_1 = joinToString(destination, '');
599
+ this.c18_1 = '(' + cleaned(storyIdRegex) + ')?';
600
+ this.d18_1 = '(' + cleaned(easeRegex) + ')?';
601
+ this.e18_1 = '(Co-authored-by: .* <(?<coAuthors>.*)>)?';
602
+ this.f18_1 = new Regex(this.b18_1 + this.c18_1 + this.d18_1 + this.e18_1, setOf([RegexOption_IGNORE_CASE_getInstance(), RegexOption_MULTILINE_getInstance()]));
603
+ }
604
+ protoOf(MessageDigger).g18 = function (input) {
605
+ return messageDigResult(this.f18_1.m8(input));
606
+ };
607
+ function cleaned(_this__u8e3s4) {
608
+ var first = firstOrNull_0(_this__u8e3s4.d8_1);
609
+ var last = lastIndexOf(_this__u8e3s4.d8_1, '/');
610
+ var tmp;
611
+ var tmp_0 = first;
612
+ if (equals(tmp_0 == null ? null : new Char(tmp_0), new Char(_Char___init__impl__6a9atx(47)))) {
613
+ // Inline function 'kotlin.text.substring' call
614
+ // Inline function 'kotlin.js.asDynamic' call
615
+ tmp = _this__u8e3s4.d8_1.substring(1, last);
616
+ } else {
617
+ tmp = _this__u8e3s4.d8_1;
618
+ }
619
+ return tmp;
620
+ }
621
+ function messageDigResult(_this__u8e3s4) {
622
+ var tmp3_coauthors = toList_0(mapNotNull(_this__u8e3s4, messageDigResult$lambda));
623
+ var tmp4_semver = maxOrNull_0(mapNotNull(_this__u8e3s4, messageDigResult$lambda_0));
624
+ var tmp$ret$1;
625
+ $l$block: {
626
+ // Inline function 'kotlin.sequences.firstNotNullOfOrNull' call
627
+ var tmp0_iterator = _this__u8e3s4.r();
628
+ while (tmp0_iterator.s()) {
629
+ var element = tmp0_iterator.u();
630
+ // Inline function 'com.zegreatrob.tools.digger.core.messageDigResult.<anonymous>' call
631
+ var result = get(element.d9(), 'storyId');
632
+ if (!(result == null)) {
633
+ tmp$ret$1 = result;
634
+ break $l$block;
635
+ }
636
+ }
637
+ tmp$ret$1 = null;
638
+ }
639
+ var tmp0_safe_receiver = tmp$ret$1;
640
+ var tmp5_storyId = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.c9_1;
641
+ var tmp$ret$3;
642
+ $l$block_0: {
643
+ // Inline function 'kotlin.sequences.firstNotNullOfOrNull' call
644
+ var tmp0_iterator_0 = _this__u8e3s4.r();
645
+ while (tmp0_iterator_0.s()) {
646
+ var element_0 = tmp0_iterator_0.u();
647
+ // Inline function 'com.zegreatrob.tools.digger.core.messageDigResult.<anonymous>' call
648
+ var result_0 = get(element_0.d9(), 'ease');
649
+ if (!(result_0 == null)) {
650
+ tmp$ret$3 = result_0;
651
+ break $l$block_0;
652
+ }
653
+ }
654
+ tmp$ret$3 = null;
655
+ }
656
+ var tmp1_safe_receiver = tmp$ret$3;
657
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.c9_1;
658
+ var tmp6_ease = tmp2_safe_receiver == null ? null : toIntOrNull(tmp2_safe_receiver);
659
+ return new MessageDigResult(tmp5_storyId, tmp6_ease, tmp3_coauthors, tmp4_semver);
660
+ }
661
+ function getSemver(it) {
662
+ return groupMatches(it, 'major') ? SemverType_Major_getInstance() : groupMatches(it, 'minor') ? SemverType_Minor_getInstance() : groupMatches(it, 'patch') ? SemverType_Patch_getInstance() : groupMatches(it, 'none') ? SemverType_None_getInstance() : null;
663
+ }
664
+ function groupMatches(_this__u8e3s4, groupName) {
665
+ // Inline function 'kotlin.Result.getOrNull' call
666
+ // Inline function 'kotlin.runCatching' call
667
+ var tmp;
668
+ try {
669
+ // Inline function 'kotlin.Companion.success' call
670
+ // Inline function 'com.zegreatrob.tools.digger.core.groupMatches.<anonymous>' call
671
+ var value = get(_this__u8e3s4.d9(), groupName);
672
+ tmp = _Result___init__impl__xyqfz8(value);
673
+ } catch ($p) {
674
+ var tmp_0;
675
+ if ($p instanceof Error) {
676
+ var e = $p;
677
+ // Inline function 'kotlin.Companion.failure' call
678
+ tmp_0 = _Result___init__impl__xyqfz8(createFailure(e));
679
+ } else {
680
+ throw $p;
681
+ }
682
+ tmp = tmp_0;
683
+ }
684
+ var this_0 = tmp;
685
+ var tmp_1;
686
+ if (_Result___get_isFailure__impl__jpiriv(this_0)) {
687
+ tmp_1 = null;
688
+ } else {
689
+ var tmp_2 = _Result___get_value__impl__bjfvqg(this_0);
690
+ tmp_1 = (tmp_2 == null ? true : !(tmp_2 == null)) ? tmp_2 : THROW_CCE();
691
+ }
692
+ return !(tmp_1 == null);
693
+ }
694
+ function highestPrioritySemver(_this__u8e3s4) {
695
+ return maxOrNull(_this__u8e3s4);
696
+ }
697
+ function messageDigResult$lambda(it) {
698
+ var tmp0_safe_receiver = get(it.d9(), 'coAuthors');
699
+ return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.c9_1;
700
+ }
701
+ function messageDigResult$lambda_0(it) {
702
+ return getSemver(it);
703
+ }
704
+ var SemverType_None_instance;
705
+ var SemverType_Patch_instance;
706
+ var SemverType_Minor_instance;
707
+ var SemverType_Major_instance;
708
+ var SemverType_entriesInitialized;
709
+ function SemverType_initEntries() {
710
+ if (SemverType_entriesInitialized)
711
+ return Unit_instance;
712
+ SemverType_entriesInitialized = true;
713
+ SemverType_None_instance = new SemverType('None', 0);
714
+ SemverType_Patch_instance = new SemverType('Patch', 1);
715
+ SemverType_Minor_instance = new SemverType('Minor', 2);
716
+ SemverType_Major_instance = new SemverType('Major', 3);
717
+ }
718
+ function SemverType(name, ordinal) {
719
+ Enum.call(this, name, ordinal);
720
+ }
721
+ function SemverType_None_getInstance() {
722
+ SemverType_initEntries();
723
+ return SemverType_None_instance;
724
+ }
725
+ function SemverType_Patch_getInstance() {
726
+ SemverType_initEntries();
727
+ return SemverType_Patch_instance;
728
+ }
729
+ function SemverType_Minor_getInstance() {
730
+ SemverType_initEntries();
731
+ return SemverType_Minor_instance;
732
+ }
733
+ function SemverType_Major_getInstance() {
734
+ SemverType_initEntries();
735
+ return SemverType_Major_instance;
736
+ }
737
+ function TagRef(name, commitId, dateTime) {
738
+ this.o17_1 = name;
739
+ this.p17_1 = commitId;
740
+ this.q17_1 = dateTime;
741
+ }
742
+ protoOf(TagRef).toString = function () {
743
+ return 'TagRef(name=' + this.o17_1 + ', commitId=' + this.p17_1 + ', dateTime=' + this.q17_1 + ')';
744
+ };
745
+ protoOf(TagRef).hashCode = function () {
746
+ var result = getStringHashCode(this.o17_1);
747
+ result = imul(result, 31) + getStringHashCode(this.p17_1) | 0;
748
+ result = imul(result, 31) + this.q17_1.hashCode() | 0;
749
+ return result;
750
+ };
751
+ protoOf(TagRef).equals = function (other) {
752
+ if (this === other)
753
+ return true;
754
+ if (!(other instanceof TagRef))
755
+ return false;
756
+ var tmp0_other_with_cast = other instanceof TagRef ? other : THROW_CCE();
757
+ if (!(this.o17_1 === tmp0_other_with_cast.o17_1))
758
+ return false;
759
+ if (!(this.p17_1 === tmp0_other_with_cast.p17_1))
760
+ return false;
761
+ if (!this.q17_1.equals(tmp0_other_with_cast.q17_1))
762
+ return false;
763
+ return true;
764
+ };
765
+ function get_childProcess() {
766
+ _init_properties_DiggerGitWrapper_js_kt__y3nj6a();
767
+ return childProcess;
768
+ }
769
+ var childProcess;
770
+ function runProcess(args, workingDirectory) {
771
+ _init_properties_DiggerGitWrapper_js_kt__y3nj6a();
772
+ var program = first(args);
773
+ // Inline function 'kotlin.collections.toTypedArray' call
774
+ var this_0 = args.z1(1, args.l());
775
+ var tmp$ret$0 = copyToArray(this_0);
776
+ var spawn = get_childProcess().spawnSync(program, tmp$ret$0, json([to('cwd', workingDirectory)]));
777
+ // Inline function 'kotlin.js.unsafeCast' call
778
+ var tmp0_safe_receiver = spawn.stdout;
779
+ return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.toString('utf8');
780
+ }
781
+ var properties_initialized_DiggerGitWrapper_js_kt_32wl58;
782
+ function _init_properties_DiggerGitWrapper_js_kt__y3nj6a() {
783
+ if (!properties_initialized_DiggerGitWrapper_js_kt_32wl58) {
784
+ properties_initialized_DiggerGitWrapper_js_kt_32wl58 = true;
785
+ childProcess = require('node:child_process');
786
+ }
787
+ }
788
+ //region block: exports
789
+ _.$_$ = _.$_$ || {};
790
+ _.$_$.a = DiggerCore;
791
+ _.$_$.b = DiggerGitWrapper;
792
+ _.$_$.c = MessageDigger;
793
+ //endregion
794
+ return _;
795
+ }(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./tools-digger-model.js'), require('./Kotlin-DateTime-library-kotlinx-datetime.js')));
796
+
797
+ //# sourceMappingURL=tools-digger-core.js.map