@glandais/vcyclist-engine 2.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,78 +25,89 @@
25
25
  'use strict';
26
26
  //region block: imports
27
27
  var imul = Math.imul;
28
- var protoOf = kotlin_kotlin.$_$.y5;
29
- var initMetadataForCompanion = kotlin_kotlin.$_$.k5;
28
+ var hypot = Math.hypot;
29
+ var sign = Math.sign;
30
+ var protoOf = kotlin_kotlin.$_$.t6;
31
+ var initMetadataForCompanion = kotlin_kotlin.$_$.f6;
30
32
  var VOID = kotlin_kotlin.$_$.a;
31
- var getNumberHashCode = kotlin_kotlin.$_$.f5;
32
- var equals = kotlin_kotlin.$_$.d5;
33
- var initMetadataForClass = kotlin_kotlin.$_$.j5;
34
- var toString = kotlin_kotlin.$_$.a6;
35
- var hashCode = kotlin_kotlin.$_$.i5;
36
- var getBooleanHashCode = kotlin_kotlin.$_$.e5;
37
- var CoroutineImpl = kotlin_kotlin.$_$.d4;
38
- var PointPerDistance_instance = kotlin_io_github_glandais_gpx.$_$.h;
39
- var ElevationStep_instance = kotlin_io_github_glandais_gpx.$_$.e;
40
- var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.o3;
41
- var Unit_instance = kotlin_kotlin.$_$.t;
42
- var PointPerSecond_instance = kotlin_io_github_glandais_gpx.$_$.i;
43
- var PathSimplifier_instance = kotlin_io_github_glandais_gpx.$_$.f;
44
- var initMetadataForCoroutine = kotlin_kotlin.$_$.l5;
45
- var initMetadataForObject = kotlin_kotlin.$_$.p5;
46
- var ArrayList_init_$Create$ = kotlin_kotlin.$_$.x;
47
- var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.m1;
48
- var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.w;
49
- var last = kotlin_kotlin.$_$.y2;
50
- var toIntArray = kotlin_kotlin.$_$.i3;
51
- var sortedWith = kotlin_kotlin.$_$.g3;
52
- var toMutableList = kotlin_kotlin.$_$.l3;
53
- var first = kotlin_kotlin.$_$.s2;
54
- var removeAll = kotlin_kotlin.$_$.c3;
55
- var numberRangeToNumber = kotlin_kotlin.$_$.u5;
56
- var collectionSizeOrDefault = kotlin_kotlin.$_$.j2;
57
- var Vector3D = kotlin_io_github_glandais_elevation.$_$.h;
58
- var emptyList = kotlin_kotlin.$_$.p2;
59
- var coerceIn = kotlin_kotlin.$_$.h6;
33
+ var getNumberHashCode = kotlin_kotlin.$_$.a6;
34
+ var equals = kotlin_kotlin.$_$.x5;
35
+ var initMetadataForClass = kotlin_kotlin.$_$.e6;
36
+ var toString = kotlin_kotlin.$_$.w6;
37
+ var hashCode = kotlin_kotlin.$_$.d6;
38
+ var getBooleanHashCode = kotlin_kotlin.$_$.z5;
39
+ var CoroutineImpl = kotlin_kotlin.$_$.s4;
40
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.y1;
41
+ var Unit_instance = kotlin_kotlin.$_$.f1;
42
+ var PointPerDistance_instance = kotlin_io_github_glandais_gpx.$_$.k;
43
+ var ElevationStep_instance = kotlin_io_github_glandais_gpx.$_$.h;
44
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.d4;
45
+ var PointPerSecond_instance = kotlin_io_github_glandais_gpx.$_$.l;
46
+ var PathSimplifier_instance = kotlin_io_github_glandais_gpx.$_$.i;
47
+ var initMetadataForCoroutine = kotlin_kotlin.$_$.g6;
48
+ var initMetadataForObject = kotlin_kotlin.$_$.k6;
49
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.i1;
50
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.h1;
51
+ var last = kotlin_kotlin.$_$.l3;
52
+ var toIntArray = kotlin_kotlin.$_$.w3;
53
+ var sortedWith = kotlin_kotlin.$_$.u3;
54
+ var toMutableList = kotlin_kotlin.$_$.z3;
55
+ var first = kotlin_kotlin.$_$.f3;
56
+ var removeAll = kotlin_kotlin.$_$.p3;
57
+ var numberRangeToNumber = kotlin_kotlin.$_$.p6;
58
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.v2;
59
+ var Vector3D = kotlin_io_github_glandais_elevation.$_$.g;
60
+ var emptyList = kotlin_kotlin.$_$.c3;
61
+ var coerceIn = kotlin_kotlin.$_$.d7;
60
62
  var DouglasPeucker_instance = kotlin_io_github_glandais_elevation.$_$.b;
61
- var FunctionAdapter = kotlin_kotlin.$_$.t4;
62
- var isInterface = kotlin_kotlin.$_$.r5;
63
- var Comparator = kotlin_kotlin.$_$.w7;
64
- var compareValues = kotlin_kotlin.$_$.m3;
65
- var until = kotlin_kotlin.$_$.l6;
66
- var Default_getInstance = kotlin_kotlin.$_$.p;
67
- var PointField_TEMPERATURE_getInstance = kotlin_io_github_glandais_gpx.$_$.j;
68
- var isNaN_0 = kotlin_kotlin.$_$.n8;
69
- var get_entries = kotlin_io_github_glandais_gpx.$_$.s;
70
- var Path = kotlin_io_github_glandais_gpx.$_$.r;
71
- var GpxParser_instance = kotlin_io_github_glandais_gpx.$_$.a;
72
- var copyToArray = kotlin_kotlin.$_$.o2;
73
- var firstTrackAsPath = kotlin_io_github_glandais_gpx.$_$.l;
74
- var tracksAsPaths = kotlin_io_github_glandais_gpx.$_$.o;
75
- var segmentsAsPaths = kotlin_io_github_glandais_gpx.$_$.m;
76
- var GpxWriter_instance = kotlin_io_github_glandais_gpx.$_$.b;
77
- var toList = kotlin_kotlin.$_$.k3;
78
- var toGpxDocument = kotlin_io_github_glandais_gpx.$_$.n;
79
- var Companion_getInstance = kotlin_kotlin.$_$.r;
80
- var numberToLong = kotlin_kotlin.$_$.q4;
63
+ var FunctionAdapter = kotlin_kotlin.$_$.l5;
64
+ var isInterface = kotlin_kotlin.$_$.m6;
65
+ var Comparator = kotlin_kotlin.$_$.u8;
66
+ var compareValues = kotlin_kotlin.$_$.b4;
67
+ var until = kotlin_kotlin.$_$.h7;
68
+ var Pair = kotlin_kotlin.$_$.b9;
69
+ var listOf = kotlin_kotlin.$_$.m3;
70
+ var Default_getInstance = kotlin_kotlin.$_$.a1;
71
+ var PointField_TEMPERATURE_getInstance = kotlin_io_github_glandais_gpx.$_$.c;
72
+ var isNaN_0 = kotlin_kotlin.$_$.p9;
73
+ var get_entries = kotlin_io_github_glandais_gpx.$_$.u;
74
+ var Path = kotlin_io_github_glandais_gpx.$_$.t;
75
+ var GpxParser_instance = kotlin_io_github_glandais_gpx.$_$.d;
76
+ var copyToArray = kotlin_kotlin.$_$.b3;
77
+ var firstTrackAsPath = kotlin_io_github_glandais_gpx.$_$.n;
78
+ var tracksAsPaths = kotlin_io_github_glandais_gpx.$_$.q;
79
+ var segmentsAsPaths = kotlin_io_github_glandais_gpx.$_$.o;
80
+ var GpxPathKind_TRACK_getInstance = kotlin_io_github_glandais_gpx.$_$.b;
81
+ var setOf = kotlin_kotlin.$_$.s3;
82
+ var GpxPathKind_ROUTE_getInstance = kotlin_io_github_glandais_gpx.$_$.a;
83
+ var GpxWriter_instance = kotlin_io_github_glandais_gpx.$_$.e;
84
+ var toList = kotlin_kotlin.$_$.y3;
85
+ var toGpxDocument = kotlin_io_github_glandais_gpx.$_$.p;
86
+ var Companion_getInstance = kotlin_kotlin.$_$.c1;
87
+ var numberToLong = kotlin_kotlin.$_$.h5;
81
88
  var GlobalScope_instance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a;
82
89
  var promise = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
83
- var Companion_getInstance_0 = kotlin_io_github_glandais_gpx.$_$.g;
84
- var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.o1;
85
- var CsvWriter_instance = kotlin_io_github_glandais_gpx.$_$.c;
86
- var firstOrNull = kotlin_kotlin.$_$.z6;
90
+ var Companion_getInstance_0 = kotlin_io_github_glandais_gpx.$_$.j;
91
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.a2;
92
+ var CsvWriter_instance = kotlin_io_github_glandais_gpx.$_$.f;
93
+ var firstOrNull = kotlin_kotlin.$_$.w7;
87
94
  var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.b;
88
- var Char = kotlin_kotlin.$_$.v7;
89
- var CsvOptions = kotlin_io_github_glandais_gpx.$_$.p;
90
- var JsonWriter_instance = kotlin_io_github_glandais_gpx.$_$.d;
91
- var JsonOptions = kotlin_io_github_glandais_gpx.$_$.q;
95
+ var Char = kotlin_kotlin.$_$.t8;
96
+ var CsvOptions = kotlin_io_github_glandais_gpx.$_$.r;
97
+ var JsonWriter_instance = kotlin_io_github_glandais_gpx.$_$.g;
98
+ var JsonOptions = kotlin_io_github_glandais_gpx.$_$.s;
92
99
  var toFitBytes = kotlin_io_github_glandais_fit.$_$.a;
93
- var toNumber = kotlin_kotlin.$_$.s4;
94
- var GpxWaypoint = kotlin_io_github_glandais_gpx.$_$.k;
95
- var THROW_CCE = kotlin_kotlin.$_$.g8;
100
+ var Companion_getInstance_1 = kotlin_kotlin.$_$.b1;
101
+ var DurationUnit_MILLISECONDS_getInstance = kotlin_kotlin.$_$.v;
102
+ var toDuration = kotlin_kotlin.$_$.s8;
103
+ var toFitBytes_0 = kotlin_io_github_glandais_fit.$_$.b;
104
+ var toNumber = kotlin_kotlin.$_$.k5;
105
+ var GpxWaypoint = kotlin_io_github_glandais_gpx.$_$.m;
106
+ var THROW_CCE = kotlin_kotlin.$_$.e9;
96
107
  var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h;
97
- var ElevationProvider = kotlin_io_github_glandais_elevation.$_$.e;
98
- var initMetadataForLambda = kotlin_kotlin.$_$.o5;
99
- var constructCallableReference = kotlin_kotlin.$_$.b5;
108
+ var ElevationProvider = kotlin_io_github_glandais_elevation.$_$.d;
109
+ var initMetadataForLambda = kotlin_kotlin.$_$.j6;
110
+ var constructCallableReference = kotlin_kotlin.$_$.u5;
100
111
  //endregion
101
112
  //region block: pre-declaration
102
113
  initMetadataForCompanion(Companion);
@@ -147,36 +158,36 @@
147
158
  //endregion
148
159
  function Companion() {
149
160
  Companion_instance = this;
150
- this.m1y_1 = new Bike();
161
+ this.DEFAULT_1 = new Bike();
151
162
  }
152
163
  var Companion_instance;
153
- function Companion_getInstance_1() {
164
+ function Companion_getInstance_2() {
154
165
  if (Companion_instance == null)
155
166
  new Companion();
156
167
  return Companion_instance;
157
168
  }
158
169
  function Bike(crr, inertiaFront, inertiaRear, wheelRadiusM, efficiency) {
159
- Companion_getInstance_1();
170
+ Companion_getInstance_2();
160
171
  crr = crr === VOID ? 0.004 : crr;
161
172
  inertiaFront = inertiaFront === VOID ? 0.05 : inertiaFront;
162
173
  inertiaRear = inertiaRear === VOID ? 0.07 : inertiaRear;
163
174
  wheelRadiusM = wheelRadiusM === VOID ? 0.7 : wheelRadiusM;
164
175
  efficiency = efficiency === VOID ? 0.976 : efficiency;
165
- this.n1y_1 = crr;
166
- this.o1y_1 = inertiaFront;
167
- this.p1y_1 = inertiaRear;
168
- this.q1y_1 = wheelRadiusM;
169
- this.r1y_1 = efficiency;
176
+ this.crr_1 = crr;
177
+ this.inertiaFront_1 = inertiaFront;
178
+ this.inertiaRear_1 = inertiaRear;
179
+ this.wheelRadiusM_1 = wheelRadiusM;
180
+ this.efficiency_1 = efficiency;
170
181
  }
171
182
  protoOf(Bike).toString = function () {
172
- return 'Bike(crr=' + this.n1y_1 + ', inertiaFront=' + this.o1y_1 + ', inertiaRear=' + this.p1y_1 + ', wheelRadiusM=' + this.q1y_1 + ', efficiency=' + this.r1y_1 + ')';
183
+ return 'Bike(crr=' + this.crr_1 + ', inertiaFront=' + this.inertiaFront_1 + ', inertiaRear=' + this.inertiaRear_1 + ', wheelRadiusM=' + this.wheelRadiusM_1 + ', efficiency=' + this.efficiency_1 + ')';
173
184
  };
174
185
  protoOf(Bike).hashCode = function () {
175
- var result = getNumberHashCode(this.n1y_1);
176
- result = imul(result, 31) + getNumberHashCode(this.o1y_1) | 0;
177
- result = imul(result, 31) + getNumberHashCode(this.p1y_1) | 0;
178
- result = imul(result, 31) + getNumberHashCode(this.q1y_1) | 0;
179
- result = imul(result, 31) + getNumberHashCode(this.r1y_1) | 0;
186
+ var result = getNumberHashCode(this.crr_1);
187
+ result = imul(result, 31) + getNumberHashCode(this.inertiaFront_1) | 0;
188
+ result = imul(result, 31) + getNumberHashCode(this.inertiaRear_1) | 0;
189
+ result = imul(result, 31) + getNumberHashCode(this.wheelRadiusM_1) | 0;
190
+ result = imul(result, 31) + getNumberHashCode(this.efficiency_1) | 0;
180
191
  return result;
181
192
  };
182
193
  protoOf(Bike).equals = function (other) {
@@ -184,41 +195,41 @@
184
195
  return true;
185
196
  if (!(other instanceof Bike))
186
197
  return false;
187
- if (!equals(this.n1y_1, other.n1y_1))
198
+ if (!equals(this.crr_1, other.crr_1))
188
199
  return false;
189
- if (!equals(this.o1y_1, other.o1y_1))
200
+ if (!equals(this.inertiaFront_1, other.inertiaFront_1))
190
201
  return false;
191
- if (!equals(this.p1y_1, other.p1y_1))
202
+ if (!equals(this.inertiaRear_1, other.inertiaRear_1))
192
203
  return false;
193
- if (!equals(this.q1y_1, other.q1y_1))
204
+ if (!equals(this.wheelRadiusM_1, other.wheelRadiusM_1))
194
205
  return false;
195
- if (!equals(this.r1y_1, other.r1y_1))
206
+ if (!equals(this.efficiency_1, other.efficiency_1))
196
207
  return false;
197
208
  return true;
198
209
  };
199
210
  function Course(path, cyclist, bike) {
200
- cyclist = cyclist === VOID ? Companion_getInstance_3().s1y_1 : cyclist;
201
- bike = bike === VOID ? Companion_getInstance_1().m1y_1 : bike;
202
- this.t1y_1 = path;
203
- this.u1y_1 = cyclist;
204
- this.v1y_1 = bike;
211
+ cyclist = cyclist === VOID ? Companion_getInstance_4().DEFAULT_1 : cyclist;
212
+ bike = bike === VOID ? Companion_getInstance_2().DEFAULT_1 : bike;
213
+ this.path_1 = path;
214
+ this.cyclist_1 = cyclist;
215
+ this.bike_1 = bike;
205
216
  }
206
- protoOf(Course).w1y = function (path, cyclist, bike) {
217
+ protoOf(Course).copy_yzntdp_k$ = function (path, cyclist, bike) {
207
218
  return new Course(path, cyclist, bike);
208
219
  };
209
- protoOf(Course).x1y = function (path, cyclist, bike, $super) {
210
- path = path === VOID ? this.t1y_1 : path;
211
- cyclist = cyclist === VOID ? this.u1y_1 : cyclist;
212
- bike = bike === VOID ? this.v1y_1 : bike;
213
- return $super === VOID ? this.w1y(path, cyclist, bike) : $super.w1y.call(this, path, cyclist, bike);
220
+ protoOf(Course).copy$default_mmxsnj_k$ = function (path, cyclist, bike, $super) {
221
+ path = path === VOID ? this.path_1 : path;
222
+ cyclist = cyclist === VOID ? this.cyclist_1 : cyclist;
223
+ bike = bike === VOID ? this.bike_1 : bike;
224
+ return $super === VOID ? this.copy_yzntdp_k$(path, cyclist, bike) : $super.copy_yzntdp_k$.call(this, path, cyclist, bike);
214
225
  };
215
226
  protoOf(Course).toString = function () {
216
- return 'Course(path=' + toString(this.t1y_1) + ', cyclist=' + this.u1y_1.toString() + ', bike=' + this.v1y_1.toString() + ')';
227
+ return 'Course(path=' + toString(this.path_1) + ', cyclist=' + this.cyclist_1.toString() + ', bike=' + this.bike_1.toString() + ')';
217
228
  };
218
229
  protoOf(Course).hashCode = function () {
219
- var result = hashCode(this.t1y_1);
220
- result = imul(result, 31) + this.u1y_1.hashCode() | 0;
221
- result = imul(result, 31) + this.v1y_1.hashCode() | 0;
230
+ var result = hashCode(this.path_1);
231
+ result = imul(result, 31) + this.cyclist_1.hashCode() | 0;
232
+ result = imul(result, 31) + this.bike_1.hashCode() | 0;
222
233
  return result;
223
234
  };
224
235
  protoOf(Course).equals = function (other) {
@@ -226,65 +237,65 @@
226
237
  return true;
227
238
  if (!(other instanceof Course))
228
239
  return false;
229
- if (!equals(this.t1y_1, other.t1y_1))
240
+ if (!equals(this.path_1, other.path_1))
230
241
  return false;
231
- if (!this.u1y_1.equals(other.u1y_1))
242
+ if (!this.cyclist_1.equals(other.cyclist_1))
232
243
  return false;
233
- if (!this.v1y_1.equals(other.v1y_1))
244
+ if (!this.bike_1.equals(other.bike_1))
234
245
  return false;
235
246
  return true;
236
247
  };
237
248
  function Companion_0() {
238
249
  Companion_instance_0 = this;
239
- this.y1y_1 = new PowerProviderConstant(280.0);
250
+ this.DEFAULT_CYCLIST_POWER_PROVIDER_1 = new PowerProviderConstant(280.0);
240
251
  }
241
252
  var Companion_instance_0;
242
- function Companion_getInstance_2() {
253
+ function Companion_getInstance_3() {
243
254
  if (Companion_instance_0 == null)
244
255
  new Companion_0();
245
256
  return Companion_instance_0;
246
257
  }
247
258
  function CoursePhysics(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
248
- Companion_getInstance_2();
259
+ Companion_getInstance_3();
249
260
  rhoProvider = rhoProvider === VOID ? RhoProviderDefault_instance : rhoProvider;
250
261
  aeroProvider = aeroProvider === VOID ? AeroProviderConstant_instance : aeroProvider;
251
262
  windProvider = windProvider === VOID ? WindProviderNone_instance : windProvider;
252
- cyclistPowerProvider = cyclistPowerProvider === VOID ? Companion_getInstance_2().y1y_1 : cyclistPowerProvider;
253
- this.z1y_1 = course;
254
- this.a1z_1 = rhoProvider;
255
- this.b1z_1 = aeroProvider;
256
- this.c1z_1 = windProvider;
257
- this.d1z_1 = cyclistPowerProvider;
263
+ cyclistPowerProvider = cyclistPowerProvider === VOID ? Companion_getInstance_3().DEFAULT_CYCLIST_POWER_PROVIDER_1 : cyclistPowerProvider;
264
+ this.course_1 = course;
265
+ this.rhoProvider_1 = rhoProvider;
266
+ this.aeroProvider_1 = aeroProvider;
267
+ this.windProvider_1 = windProvider;
268
+ this.cyclistPowerProvider_1 = cyclistPowerProvider;
258
269
  }
259
- protoOf(CoursePhysics).e1z = function () {
260
- return this.z1y_1.t1y_1;
270
+ protoOf(CoursePhysics).get_path_wos8ry_k$ = function () {
271
+ return this.course_1.path_1;
261
272
  };
262
- protoOf(CoursePhysics).f1z = function () {
263
- return this.z1y_1.u1y_1;
273
+ protoOf(CoursePhysics).get_cyclist_lkc0de_k$ = function () {
274
+ return this.course_1.cyclist_1;
264
275
  };
265
- protoOf(CoursePhysics).g1z = function () {
266
- return this.z1y_1.v1y_1;
276
+ protoOf(CoursePhysics).get_bike_wojgoa_k$ = function () {
277
+ return this.course_1.bike_1;
267
278
  };
268
- protoOf(CoursePhysics).h1z = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
279
+ protoOf(CoursePhysics).copy_ulppn1_k$ = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
269
280
  return new CoursePhysics(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
270
281
  };
271
- protoOf(CoursePhysics).i1z = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider, $super) {
272
- course = course === VOID ? this.z1y_1 : course;
273
- rhoProvider = rhoProvider === VOID ? this.a1z_1 : rhoProvider;
274
- aeroProvider = aeroProvider === VOID ? this.b1z_1 : aeroProvider;
275
- windProvider = windProvider === VOID ? this.c1z_1 : windProvider;
276
- cyclistPowerProvider = cyclistPowerProvider === VOID ? this.d1z_1 : cyclistPowerProvider;
277
- return $super === VOID ? this.h1z(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) : $super.h1z.call(this, course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
282
+ protoOf(CoursePhysics).copy$default_a3dskc_k$ = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider, $super) {
283
+ course = course === VOID ? this.course_1 : course;
284
+ rhoProvider = rhoProvider === VOID ? this.rhoProvider_1 : rhoProvider;
285
+ aeroProvider = aeroProvider === VOID ? this.aeroProvider_1 : aeroProvider;
286
+ windProvider = windProvider === VOID ? this.windProvider_1 : windProvider;
287
+ cyclistPowerProvider = cyclistPowerProvider === VOID ? this.cyclistPowerProvider_1 : cyclistPowerProvider;
288
+ return $super === VOID ? this.copy_ulppn1_k$(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) : $super.copy_ulppn1_k$.call(this, course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
278
289
  };
279
290
  protoOf(CoursePhysics).toString = function () {
280
- return 'CoursePhysics(course=' + this.z1y_1.toString() + ', rhoProvider=' + toString(this.a1z_1) + ', aeroProvider=' + toString(this.b1z_1) + ', windProvider=' + toString(this.c1z_1) + ', cyclistPowerProvider=' + toString(this.d1z_1) + ')';
291
+ return 'CoursePhysics(course=' + this.course_1.toString() + ', rhoProvider=' + toString(this.rhoProvider_1) + ', aeroProvider=' + toString(this.aeroProvider_1) + ', windProvider=' + toString(this.windProvider_1) + ', cyclistPowerProvider=' + toString(this.cyclistPowerProvider_1) + ')';
281
292
  };
282
293
  protoOf(CoursePhysics).hashCode = function () {
283
- var result = this.z1y_1.hashCode();
284
- result = imul(result, 31) + hashCode(this.a1z_1) | 0;
285
- result = imul(result, 31) + hashCode(this.b1z_1) | 0;
286
- result = imul(result, 31) + hashCode(this.c1z_1) | 0;
287
- result = imul(result, 31) + hashCode(this.d1z_1) | 0;
294
+ var result = this.course_1.hashCode();
295
+ result = imul(result, 31) + hashCode(this.rhoProvider_1) | 0;
296
+ result = imul(result, 31) + hashCode(this.aeroProvider_1) | 0;
297
+ result = imul(result, 31) + hashCode(this.windProvider_1) | 0;
298
+ result = imul(result, 31) + hashCode(this.cyclistPowerProvider_1) | 0;
288
299
  return result;
289
300
  };
290
301
  protoOf(CoursePhysics).equals = function (other) {
@@ -292,64 +303,64 @@
292
303
  return true;
293
304
  if (!(other instanceof CoursePhysics))
294
305
  return false;
295
- if (!this.z1y_1.equals(other.z1y_1))
306
+ if (!this.course_1.equals(other.course_1))
296
307
  return false;
297
- if (!equals(this.a1z_1, other.a1z_1))
308
+ if (!equals(this.rhoProvider_1, other.rhoProvider_1))
298
309
  return false;
299
- if (!equals(this.b1z_1, other.b1z_1))
310
+ if (!equals(this.aeroProvider_1, other.aeroProvider_1))
300
311
  return false;
301
- if (!equals(this.c1z_1, other.c1z_1))
312
+ if (!equals(this.windProvider_1, other.windProvider_1))
302
313
  return false;
303
- if (!equals(this.d1z_1, other.d1z_1))
314
+ if (!equals(this.cyclistPowerProvider_1, other.cyclistPowerProvider_1))
304
315
  return false;
305
316
  return true;
306
317
  };
307
318
  function Companion_1() {
308
319
  Companion_instance_1 = this;
309
- this.s1y_1 = new Cyclist();
320
+ this.DEFAULT_1 = new Cyclist();
310
321
  }
311
322
  var Companion_instance_1;
312
- function Companion_getInstance_3() {
323
+ function Companion_getInstance_4() {
313
324
  if (Companion_instance_1 == null)
314
325
  new Companion_1();
315
326
  return Companion_instance_1;
316
327
  }
317
328
  function Cyclist(massKg, maxBrakeG, cd, frontalAreaM2, maxLeanAngleDeg, maxSpeedKmH) {
318
- Companion_getInstance_3();
329
+ Companion_getInstance_4();
319
330
  massKg = massKg === VOID ? 80.0 : massKg;
320
331
  maxBrakeG = maxBrakeG === VOID ? 0.6 : maxBrakeG;
321
332
  cd = cd === VOID ? 0.7 : cd;
322
333
  frontalAreaM2 = frontalAreaM2 === VOID ? 0.5 : frontalAreaM2;
323
334
  maxLeanAngleDeg = maxLeanAngleDeg === VOID ? 35.0 : maxLeanAngleDeg;
324
335
  maxSpeedKmH = maxSpeedKmH === VOID ? 100.0 : maxSpeedKmH;
325
- this.j1z_1 = massKg;
326
- this.k1z_1 = maxBrakeG;
327
- this.l1z_1 = cd;
328
- this.m1z_1 = frontalAreaM2;
329
- this.n1z_1 = maxLeanAngleDeg;
330
- this.o1z_1 = maxSpeedKmH;
331
- }
332
- protoOf(Cyclist).p1z = function () {
336
+ this.massKg_1 = massKg;
337
+ this.maxBrakeG_1 = maxBrakeG;
338
+ this.cd_1 = cd;
339
+ this.frontalAreaM2__1 = frontalAreaM2;
340
+ this.maxLeanAngleDeg_1 = maxLeanAngleDeg;
341
+ this.maxSpeedKmH_1 = maxSpeedKmH;
342
+ }
343
+ protoOf(Cyclist).get_tanMaxLeanAngle_qqiag1_k$ = function () {
333
344
  // Inline function 'kotlin.math.tan' call
334
- var x = this.n1z_1 * 3.141592653589793 / 180.0;
345
+ var x = this.maxLeanAngleDeg_1 * 3.141592653589793 / 180.0;
335
346
  return Math.tan(x);
336
347
  };
337
- protoOf(Cyclist).q1z = function () {
338
- return this.k1z_1 * 9.8;
348
+ protoOf(Cyclist).get_maxBrakeMS2_nzouxw_k$ = function () {
349
+ return this.maxBrakeG_1 * 9.8;
339
350
  };
340
- protoOf(Cyclist).r1z = function () {
341
- return this.o1z_1 / 3.6;
351
+ protoOf(Cyclist).get_maxSpeedMS_xz2r7y_k$ = function () {
352
+ return this.maxSpeedKmH_1 / 3.6;
342
353
  };
343
354
  protoOf(Cyclist).toString = function () {
344
- return 'Cyclist(massKg=' + this.j1z_1 + ', maxBrakeG=' + this.k1z_1 + ', cd=' + this.l1z_1 + ', frontalAreaM2=' + this.m1z_1 + ', maxLeanAngleDeg=' + this.n1z_1 + ', maxSpeedKmH=' + this.o1z_1 + ')';
355
+ return 'Cyclist(massKg=' + this.massKg_1 + ', maxBrakeG=' + this.maxBrakeG_1 + ', cd=' + this.cd_1 + ', frontalAreaM2=' + this.frontalAreaM2__1 + ', maxLeanAngleDeg=' + this.maxLeanAngleDeg_1 + ', maxSpeedKmH=' + this.maxSpeedKmH_1 + ')';
345
356
  };
346
357
  protoOf(Cyclist).hashCode = function () {
347
- var result = getNumberHashCode(this.j1z_1);
348
- result = imul(result, 31) + getNumberHashCode(this.k1z_1) | 0;
349
- result = imul(result, 31) + getNumberHashCode(this.l1z_1) | 0;
350
- result = imul(result, 31) + getNumberHashCode(this.m1z_1) | 0;
351
- result = imul(result, 31) + getNumberHashCode(this.n1z_1) | 0;
352
- result = imul(result, 31) + getNumberHashCode(this.o1z_1) | 0;
358
+ var result = getNumberHashCode(this.massKg_1);
359
+ result = imul(result, 31) + getNumberHashCode(this.maxBrakeG_1) | 0;
360
+ result = imul(result, 31) + getNumberHashCode(this.cd_1) | 0;
361
+ result = imul(result, 31) + getNumberHashCode(this.frontalAreaM2__1) | 0;
362
+ result = imul(result, 31) + getNumberHashCode(this.maxLeanAngleDeg_1) | 0;
363
+ result = imul(result, 31) + getNumberHashCode(this.maxSpeedKmH_1) | 0;
353
364
  return result;
354
365
  };
355
366
  protoOf(Cyclist).equals = function (other) {
@@ -357,17 +368,17 @@
357
368
  return true;
358
369
  if (!(other instanceof Cyclist))
359
370
  return false;
360
- if (!equals(this.j1z_1, other.j1z_1))
371
+ if (!equals(this.massKg_1, other.massKg_1))
361
372
  return false;
362
- if (!equals(this.k1z_1, other.k1z_1))
373
+ if (!equals(this.maxBrakeG_1, other.maxBrakeG_1))
363
374
  return false;
364
- if (!equals(this.l1z_1, other.l1z_1))
375
+ if (!equals(this.cd_1, other.cd_1))
365
376
  return false;
366
- if (!equals(this.m1z_1, other.m1z_1))
377
+ if (!equals(this.frontalAreaM2__1, other.frontalAreaM2__1))
367
378
  return false;
368
- if (!equals(this.n1z_1, other.n1z_1))
379
+ if (!equals(this.maxLeanAngleDeg_1, other.maxLeanAngleDeg_1))
369
380
  return false;
370
- if (!equals(this.o1z_1, other.o1z_1))
381
+ if (!equals(this.maxSpeedKmH_1, other.maxSpeedKmH_1))
371
382
  return false;
372
383
  return true;
373
384
  };
@@ -375,17 +386,17 @@
375
386
  enabled = enabled === VOID ? true : enabled;
376
387
  toleranceM = toleranceM === VOID ? 10.0 : toleranceM;
377
388
  zExaggeration = zExaggeration === VOID ? 3.0 : zExaggeration;
378
- this.s1z_1 = enabled;
379
- this.t1z_1 = toleranceM;
380
- this.u1z_1 = zExaggeration;
389
+ this.enabled_1 = enabled;
390
+ this.toleranceM_1 = toleranceM;
391
+ this.zExaggeration_1 = zExaggeration;
381
392
  }
382
393
  protoOf(SimplifyPathOptions).toString = function () {
383
- return 'SimplifyPathOptions(enabled=' + this.s1z_1 + ', toleranceM=' + this.t1z_1 + ', zExaggeration=' + this.u1z_1 + ')';
394
+ return 'SimplifyPathOptions(enabled=' + this.enabled_1 + ', toleranceM=' + this.toleranceM_1 + ', zExaggeration=' + this.zExaggeration_1 + ')';
384
395
  };
385
396
  protoOf(SimplifyPathOptions).hashCode = function () {
386
- var result = getBooleanHashCode(this.s1z_1);
387
- result = imul(result, 31) + getNumberHashCode(this.t1z_1) | 0;
388
- result = imul(result, 31) + getNumberHashCode(this.u1z_1) | 0;
397
+ var result = getBooleanHashCode(this.enabled_1);
398
+ result = imul(result, 31) + getNumberHashCode(this.toleranceM_1) | 0;
399
+ result = imul(result, 31) + getNumberHashCode(this.zExaggeration_1) | 0;
389
400
  return result;
390
401
  };
391
402
  protoOf(SimplifyPathOptions).equals = function (other) {
@@ -393,46 +404,57 @@
393
404
  return true;
394
405
  if (!(other instanceof SimplifyPathOptions))
395
406
  return false;
396
- if (!(this.s1z_1 === other.s1z_1))
407
+ if (!(this.enabled_1 === other.enabled_1))
397
408
  return false;
398
- if (!equals(this.t1z_1, other.t1z_1))
409
+ if (!equals(this.toleranceM_1, other.toleranceM_1))
399
410
  return false;
400
- if (!equals(this.u1z_1, other.u1z_1))
411
+ if (!equals(this.zExaggeration_1, other.zExaggeration_1))
401
412
  return false;
402
413
  return true;
403
414
  };
404
415
  function Companion_2() {
405
416
  Companion_instance_2 = this;
406
- this.v1z_1 = new EnhanceOptions();
417
+ this.DEFAULT_1 = new EnhanceOptions();
407
418
  }
408
419
  var Companion_instance_2;
409
- function Companion_getInstance_4() {
420
+ function Companion_getInstance_5() {
410
421
  if (Companion_instance_2 == null)
411
422
  new Companion_2();
412
423
  return Companion_instance_2;
413
424
  }
414
425
  function EnhanceOptions(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath) {
415
- Companion_getInstance_4();
426
+ Companion_getInstance_5();
416
427
  fixElevation = fixElevation === VOID ? true : fixElevation;
417
428
  computeMaxSpeeds = computeMaxSpeeds === VOID ? true : computeMaxSpeeds;
418
429
  virtualizeTrack = virtualizeTrack === VOID ? true : virtualizeTrack;
419
430
  computeOnePointPerSecond = computeOnePointPerSecond === VOID ? true : computeOnePointPerSecond;
420
431
  simplifyPath = simplifyPath === VOID ? new SimplifyPathOptions() : simplifyPath;
421
- this.w1z_1 = fixElevation;
422
- this.x1z_1 = computeMaxSpeeds;
423
- this.y1z_1 = virtualizeTrack;
424
- this.z1z_1 = computeOnePointPerSecond;
425
- this.a20_1 = simplifyPath;
426
- }
432
+ this.fixElevation_1 = fixElevation;
433
+ this.computeMaxSpeeds_1 = computeMaxSpeeds;
434
+ this.virtualizeTrack_1 = virtualizeTrack;
435
+ this.computeOnePointPerSecond_1 = computeOnePointPerSecond;
436
+ this.simplifyPath_1 = simplifyPath;
437
+ }
438
+ protoOf(EnhanceOptions).copy_8buhav_k$ = function (fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath) {
439
+ return new EnhanceOptions(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath);
440
+ };
441
+ protoOf(EnhanceOptions).copy$default_9zz8ww_k$ = function (fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath, $super) {
442
+ fixElevation = fixElevation === VOID ? this.fixElevation_1 : fixElevation;
443
+ computeMaxSpeeds = computeMaxSpeeds === VOID ? this.computeMaxSpeeds_1 : computeMaxSpeeds;
444
+ virtualizeTrack = virtualizeTrack === VOID ? this.virtualizeTrack_1 : virtualizeTrack;
445
+ computeOnePointPerSecond = computeOnePointPerSecond === VOID ? this.computeOnePointPerSecond_1 : computeOnePointPerSecond;
446
+ simplifyPath = simplifyPath === VOID ? this.simplifyPath_1 : simplifyPath;
447
+ return $super === VOID ? this.copy_8buhav_k$(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath) : $super.copy_8buhav_k$.call(this, fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath);
448
+ };
427
449
  protoOf(EnhanceOptions).toString = function () {
428
- return 'EnhanceOptions(fixElevation=' + this.w1z_1 + ', computeMaxSpeeds=' + this.x1z_1 + ', virtualizeTrack=' + this.y1z_1 + ', computeOnePointPerSecond=' + this.z1z_1 + ', simplifyPath=' + this.a20_1.toString() + ')';
450
+ return 'EnhanceOptions(fixElevation=' + this.fixElevation_1 + ', computeMaxSpeeds=' + this.computeMaxSpeeds_1 + ', virtualizeTrack=' + this.virtualizeTrack_1 + ', computeOnePointPerSecond=' + this.computeOnePointPerSecond_1 + ', simplifyPath=' + this.simplifyPath_1.toString() + ')';
429
451
  };
430
452
  protoOf(EnhanceOptions).hashCode = function () {
431
- var result = getBooleanHashCode(this.w1z_1);
432
- result = imul(result, 31) + getBooleanHashCode(this.x1z_1) | 0;
433
- result = imul(result, 31) + getBooleanHashCode(this.y1z_1) | 0;
434
- result = imul(result, 31) + getBooleanHashCode(this.z1z_1) | 0;
435
- result = imul(result, 31) + this.a20_1.hashCode() | 0;
453
+ var result = getBooleanHashCode(this.fixElevation_1);
454
+ result = imul(result, 31) + getBooleanHashCode(this.computeMaxSpeeds_1) | 0;
455
+ result = imul(result, 31) + getBooleanHashCode(this.virtualizeTrack_1) | 0;
456
+ result = imul(result, 31) + getBooleanHashCode(this.computeOnePointPerSecond_1) | 0;
457
+ result = imul(result, 31) + this.simplifyPath_1.hashCode() | 0;
436
458
  return result;
437
459
  };
438
460
  protoOf(EnhanceOptions).equals = function (other) {
@@ -440,161 +462,166 @@
440
462
  return true;
441
463
  if (!(other instanceof EnhanceOptions))
442
464
  return false;
443
- if (!(this.w1z_1 === other.w1z_1))
465
+ if (!(this.fixElevation_1 === other.fixElevation_1))
444
466
  return false;
445
- if (!(this.x1z_1 === other.x1z_1))
467
+ if (!(this.computeMaxSpeeds_1 === other.computeMaxSpeeds_1))
446
468
  return false;
447
- if (!(this.y1z_1 === other.y1z_1))
469
+ if (!(this.virtualizeTrack_1 === other.virtualizeTrack_1))
448
470
  return false;
449
- if (!(this.z1z_1 === other.z1z_1))
471
+ if (!(this.computeOnePointPerSecond_1 === other.computeOnePointPerSecond_1))
450
472
  return false;
451
- if (!this.a20_1.equals(other.a20_1))
473
+ if (!this.simplifyPath_1.equals(other.simplifyPath_1))
452
474
  return false;
453
475
  return true;
454
476
  };
455
477
  function $enhanceCourseCOROUTINE$(_this__u8e3s4, course, options, elevationProvider, resultContinuation) {
456
478
  CoroutineImpl.call(this, resultContinuation);
457
- this.j20_1 = _this__u8e3s4;
458
- this.k20_1 = course;
459
- this.l20_1 = options;
460
- this.m20_1 = elevationProvider;
479
+ this._this__u8e3s4__1 = _this__u8e3s4;
480
+ this.course_1 = course;
481
+ this.options_1 = options;
482
+ this.elevationProvider_1 = elevationProvider;
461
483
  }
462
- protoOf($enhanceCourseCOROUTINE$).p6 = function () {
463
- var suspendResult = this.j6_1;
484
+ protoOf($enhanceCourseCOROUTINE$).doResume_5yljmg_k$ = function () {
485
+ var suspendResult = this.result_1;
464
486
  $sm: do
465
487
  try {
466
- var tmp = this.h6_1;
488
+ var tmp = this.state_1;
467
489
  switch (tmp) {
468
490
  case 0:
469
- this.i6_1 = 3;
470
- this.n20_1 = this.k20_1.e1z();
471
- this.n20_1 = PointPerDistance_instance.p1w(this.n20_1, -1.0, 30.0);
472
- if (this.l20_1.w1z_1 && !(this.m20_1 == null)) {
473
- this.h6_1 = 1;
474
- suspendResult = ElevationStep_instance.g1u(this.n20_1, this.m20_1, this);
491
+ this.exceptionState_1 = 3;
492
+ if (!(!this.options_1.fixElevation_1 || !(this.elevationProvider_1 == null))) {
493
+ var message = 'fixElevation = true but elevationProvider is null. Pass a provider, or set fixElevation = false (enhanceCourseDefault resolves this automatically).';
494
+ throw IllegalArgumentException_init_$Create$(toString(message));
495
+ }
496
+
497
+ this.path0__1 = this.course_1.get_path_wos8ry_k$();
498
+ this.path0__1 = PointPerDistance_instance.compute_7vlifv_k$(this.path0__1, -1.0, 30.0);
499
+ if (this.options_1.fixElevation_1 && !(this.elevationProvider_1 == null)) {
500
+ this.state_1 = 1;
501
+ suspendResult = ElevationStep_instance.fixElevation_nhpf8r_k$(this.path0__1, this.elevationProvider_1, this);
475
502
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
476
503
  return suspendResult;
477
504
  }
478
505
  continue $sm;
479
506
  } else {
480
- this.h6_1 = 2;
507
+ this.state_1 = 2;
481
508
  continue $sm;
482
509
  }
483
510
 
484
511
  case 1:
485
- this.n20_1 = suspendResult;
486
- this.h6_1 = 2;
512
+ this.path0__1 = suspendResult;
513
+ this.state_1 = 2;
487
514
  continue $sm;
488
515
  case 2:
489
- this.n20_1 = PointPerDistance_instance.p1w(this.n20_1, 1.0, 2.0);
490
- this.n20_1 = ElevationStep_instance.j1u(this.n20_1);
491
- var working = this.k20_1.i1z(this.k20_1.z1y_1.x1y(this.n20_1));
492
- if (this.l20_1.x1z_1 || this.l20_1.y1z_1) {
493
- MaxSpeedComputer_instance.t20(working.z1y_1);
516
+ this.path0__1 = PointPerDistance_instance.compute_7vlifv_k$(this.path0__1, 1.0, 2.0);
517
+ this.path0__1 = ElevationStep_instance.smoothElevation$default_3c035p_k$(this.path0__1);
518
+ var working = this.course_1.copy$default_a3dskc_k$(this.course_1.course_1.copy$default_mmxsnj_k$(this.path0__1));
519
+ if (this.options_1.computeMaxSpeeds_1 || this.options_1.virtualizeTrack_1) {
520
+ MaxSpeedComputer_instance.computeMaxSpeeds_jc4v4o_k$(working.course_1);
494
521
  }
495
522
 
496
- if (this.l20_1.y1z_1) {
497
- this.n20_1 = VirtualizeService_instance.v20(working);
498
- working = working.i1z(working.z1y_1.x1y(this.n20_1));
523
+ if (this.options_1.virtualizeTrack_1) {
524
+ this.path0__1 = VirtualizeService_instance.virtualizeTrack_tp3afi_k$(working);
525
+ working = working.copy$default_a3dskc_k$(working.course_1.copy$default_mmxsnj_k$(this.path0__1));
499
526
  }
500
527
 
501
- if (this.l20_1.z1z_1) {
502
- this.n20_1 = PointPerSecond_instance.v1w(this.n20_1);
528
+ if (this.options_1.computeOnePointPerSecond_1) {
529
+ this.path0__1 = PointPerSecond_instance.computeOnePointPerSecond_7sah9a_k$(this.path0__1);
503
530
  }
504
531
 
505
- if (this.l20_1.a20_1.s1z_1) {
506
- this.n20_1 = PathSimplifier_instance.d1w(this.n20_1, this.l20_1.a20_1.t1z_1, this.l20_1.a20_1.u1z_1);
532
+ if (this.options_1.simplifyPath_1.enabled_1) {
533
+ this.path0__1 = PathSimplifier_instance.simplify_gxhj7b_k$(this.path0__1, this.options_1.simplifyPath_1.toleranceM_1, this.options_1.simplifyPath_1.zExaggeration_1);
507
534
  }
508
535
 
509
- return this.n20_1;
536
+ return this.path0__1;
510
537
  case 3:
511
- throw this.k6_1;
538
+ throw this.exception_1;
512
539
  }
513
540
  } catch ($p) {
514
541
  var e = $p;
515
- if (this.i6_1 === 3) {
542
+ if (this.exceptionState_1 === 3) {
516
543
  throw e;
517
544
  } else {
518
- this.h6_1 = this.i6_1;
519
- this.k6_1 = e;
545
+ this.state_1 = this.exceptionState_1;
546
+ this.exception_1 = e;
520
547
  }
521
548
  }
522
549
  while (true);
523
550
  };
524
551
  function Enhancer() {
525
552
  }
526
- protoOf(Enhancer).w20 = function (path) {
553
+ protoOf(Enhancer).getDefaultCourse_gqi1xw_k$ = function (path) {
527
554
  return new CoursePhysics(new Course(path), RhoProviderEstimate_instance, AeroProviderConstant_instance, WindProviderNone_instance, new PowerProviderConstant(280.0));
528
555
  };
529
- protoOf(Enhancer).x20 = function (path, elevationProvider, options, $completion) {
530
- return this.y20(this.w20(path), options, elevationProvider, $completion);
556
+ protoOf(Enhancer).enhanceCourseDefault_jm937y_k$ = function (path, elevationProvider, options, $completion) {
557
+ return this.enhanceCourse_mout3j_k$(this.getDefaultCourse_gqi1xw_k$(path), options.copy$default_9zz8ww_k$(options.fixElevation_1 && !(elevationProvider == null)), elevationProvider, $completion);
531
558
  };
532
- protoOf(Enhancer).y20 = function (course, options, elevationProvider, $completion) {
559
+ protoOf(Enhancer).enhanceCourse_mout3j_k$ = function (course, options, elevationProvider, $completion) {
533
560
  var tmp = new $enhanceCourseCOROUTINE$(this, course, options, elevationProvider, $completion);
534
- tmp.j6_1 = Unit_instance;
535
- tmp.k6_1 = null;
536
- return tmp.p6();
561
+ tmp.result_1 = Unit_instance;
562
+ tmp.exception_1 = null;
563
+ return tmp.doResume_5yljmg_k$();
537
564
  };
538
565
  var Enhancer_instance;
539
566
  function Enhancer_getInstance() {
540
567
  return Enhancer_instance;
541
568
  }
542
569
  function Climb(startIndex, endIndex, startDistanceM, endDistanceM, startElevationM, endElevationM, positiveElevationM, negativeElevationM, parts) {
543
- this.z20_1 = startIndex;
544
- this.a21_1 = endIndex;
545
- this.b21_1 = startDistanceM;
546
- this.c21_1 = endDistanceM;
547
- this.d21_1 = startElevationM;
548
- this.e21_1 = endElevationM;
549
- this.f21_1 = positiveElevationM;
550
- this.g21_1 = negativeElevationM;
551
- this.h21_1 = parts;
552
- }
553
- protoOf(Climb).i21 = function () {
554
- return this.c21_1 - this.b21_1;
555
- };
556
- protoOf(Climb).j21 = function () {
557
- return this.e21_1 - this.d21_1;
558
- };
559
- protoOf(Climb).k21 = function () {
560
- return this.i21() === 0.0 ? 0.0 : this.j21() / this.i21();
561
- };
562
- protoOf(Climb).l21 = function () {
570
+ this.startIndex_1 = startIndex;
571
+ this.endIndex_1 = endIndex;
572
+ this.startDistanceM_1 = startDistanceM;
573
+ this.endDistanceM_1 = endDistanceM;
574
+ this.startElevationM_1 = startElevationM;
575
+ this.endElevationM_1 = endElevationM;
576
+ this.positiveElevationM_1 = positiveElevationM;
577
+ this.negativeElevationM_1 = negativeElevationM;
578
+ this.parts_1 = parts;
579
+ }
580
+ protoOf(Climb).get_lengthM_2aqrzy_k$ = function () {
581
+ return this.endDistanceM_1 - this.startDistanceM_1;
582
+ };
583
+ protoOf(Climb).get_elevationGainM_6kg9eu_k$ = function () {
584
+ return this.endElevationM_1 - this.startElevationM_1;
585
+ };
586
+ protoOf(Climb).get_averageGrade_oooweb_k$ = function () {
587
+ return this.get_lengthM_2aqrzy_k$() === 0.0 ? 0.0 : this.get_elevationGainM_6kg9eu_k$() / this.get_lengthM_2aqrzy_k$();
588
+ };
589
+ protoOf(Climb).get_climbingGrade_olocdd_k$ = function () {
563
590
  // Inline function 'kotlin.collections.filter' call
564
- var tmp0 = this.h21_1;
591
+ var tmp0 = this.parts_1;
565
592
  // Inline function 'kotlin.collections.filterTo' call
566
593
  var destination = ArrayList_init_$Create$();
567
- var _iterator__ex2g4s = tmp0.i();
568
- while (_iterator__ex2g4s.j()) {
569
- var element = _iterator__ex2g4s.k();
570
- if (element.j21() > 0) {
571
- destination.h(element);
594
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
595
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
596
+ var element = _iterator__ex2g4s.next_20eer_k$();
597
+ if (element.get_elevationGainM_6kg9eu_k$() > 0) {
598
+ destination.add_utx5q5_k$(element);
572
599
  }
573
600
  }
574
601
  // Inline function 'kotlin.collections.sumOf' call
575
602
  var sum = 0;
576
- var _iterator__ex2g4s_0 = destination.i();
577
- while (_iterator__ex2g4s_0.j()) {
578
- var element_0 = _iterator__ex2g4s_0.k();
603
+ var _iterator__ex2g4s_0 = destination.iterator_jk1svi_k$();
604
+ while (_iterator__ex2g4s_0.hasNext_bitz1p_k$()) {
605
+ var element_0 = _iterator__ex2g4s_0.next_20eer_k$();
579
606
  var tmp = sum;
580
- sum = tmp + element_0.i21();
607
+ sum = tmp + element_0.get_lengthM_2aqrzy_k$();
581
608
  }
582
609
  var climbingLength = sum;
583
- return climbingLength === 0.0 ? 0.0 : this.f21_1 / climbingLength;
610
+ return climbingLength === 0.0 ? 0.0 : this.positiveElevationM_1 / climbingLength;
584
611
  };
585
612
  protoOf(Climb).toString = function () {
586
- return 'Climb(startIndex=' + this.z20_1 + ', endIndex=' + this.a21_1 + ', startDistanceM=' + this.b21_1 + ', endDistanceM=' + this.c21_1 + ', startElevationM=' + this.d21_1 + ', endElevationM=' + this.e21_1 + ', positiveElevationM=' + this.f21_1 + ', negativeElevationM=' + this.g21_1 + ', parts=' + toString(this.h21_1) + ')';
613
+ return 'Climb(startIndex=' + this.startIndex_1 + ', endIndex=' + this.endIndex_1 + ', startDistanceM=' + this.startDistanceM_1 + ', endDistanceM=' + this.endDistanceM_1 + ', startElevationM=' + this.startElevationM_1 + ', endElevationM=' + this.endElevationM_1 + ', positiveElevationM=' + this.positiveElevationM_1 + ', negativeElevationM=' + this.negativeElevationM_1 + ', parts=' + toString(this.parts_1) + ')';
587
614
  };
588
615
  protoOf(Climb).hashCode = function () {
589
- var result = this.z20_1;
590
- result = imul(result, 31) + this.a21_1 | 0;
591
- result = imul(result, 31) + getNumberHashCode(this.b21_1) | 0;
592
- result = imul(result, 31) + getNumberHashCode(this.c21_1) | 0;
593
- result = imul(result, 31) + getNumberHashCode(this.d21_1) | 0;
594
- result = imul(result, 31) + getNumberHashCode(this.e21_1) | 0;
595
- result = imul(result, 31) + getNumberHashCode(this.f21_1) | 0;
596
- result = imul(result, 31) + getNumberHashCode(this.g21_1) | 0;
597
- result = imul(result, 31) + hashCode(this.h21_1) | 0;
616
+ var result = this.startIndex_1;
617
+ result = imul(result, 31) + this.endIndex_1 | 0;
618
+ result = imul(result, 31) + getNumberHashCode(this.startDistanceM_1) | 0;
619
+ result = imul(result, 31) + getNumberHashCode(this.endDistanceM_1) | 0;
620
+ result = imul(result, 31) + getNumberHashCode(this.startElevationM_1) | 0;
621
+ result = imul(result, 31) + getNumberHashCode(this.endElevationM_1) | 0;
622
+ result = imul(result, 31) + getNumberHashCode(this.positiveElevationM_1) | 0;
623
+ result = imul(result, 31) + getNumberHashCode(this.negativeElevationM_1) | 0;
624
+ result = imul(result, 31) + hashCode(this.parts_1) | 0;
598
625
  return result;
599
626
  };
600
627
  protoOf(Climb).equals = function (other) {
@@ -602,49 +629,49 @@
602
629
  return true;
603
630
  if (!(other instanceof Climb))
604
631
  return false;
605
- if (!(this.z20_1 === other.z20_1))
632
+ if (!(this.startIndex_1 === other.startIndex_1))
606
633
  return false;
607
- if (!(this.a21_1 === other.a21_1))
634
+ if (!(this.endIndex_1 === other.endIndex_1))
608
635
  return false;
609
- if (!equals(this.b21_1, other.b21_1))
636
+ if (!equals(this.startDistanceM_1, other.startDistanceM_1))
610
637
  return false;
611
- if (!equals(this.c21_1, other.c21_1))
638
+ if (!equals(this.endDistanceM_1, other.endDistanceM_1))
612
639
  return false;
613
- if (!equals(this.d21_1, other.d21_1))
640
+ if (!equals(this.startElevationM_1, other.startElevationM_1))
614
641
  return false;
615
- if (!equals(this.e21_1, other.e21_1))
642
+ if (!equals(this.endElevationM_1, other.endElevationM_1))
616
643
  return false;
617
- if (!equals(this.f21_1, other.f21_1))
644
+ if (!equals(this.positiveElevationM_1, other.positiveElevationM_1))
618
645
  return false;
619
- if (!equals(this.g21_1, other.g21_1))
646
+ if (!equals(this.negativeElevationM_1, other.negativeElevationM_1))
620
647
  return false;
621
- if (!equals(this.h21_1, other.h21_1))
648
+ if (!equals(this.parts_1, other.parts_1))
622
649
  return false;
623
650
  return true;
624
651
  };
625
652
  function ClimbPart(startDistanceM, endDistanceM, startElevationM, endElevationM) {
626
- this.m21_1 = startDistanceM;
627
- this.n21_1 = endDistanceM;
628
- this.o21_1 = startElevationM;
629
- this.p21_1 = endElevationM;
653
+ this.startDistanceM_1 = startDistanceM;
654
+ this.endDistanceM_1 = endDistanceM;
655
+ this.startElevationM_1 = startElevationM;
656
+ this.endElevationM_1 = endElevationM;
630
657
  }
631
- protoOf(ClimbPart).i21 = function () {
632
- return this.n21_1 - this.m21_1;
658
+ protoOf(ClimbPart).get_lengthM_2aqrzy_k$ = function () {
659
+ return this.endDistanceM_1 - this.startDistanceM_1;
633
660
  };
634
- protoOf(ClimbPart).j21 = function () {
635
- return this.p21_1 - this.o21_1;
661
+ protoOf(ClimbPart).get_elevationGainM_6kg9eu_k$ = function () {
662
+ return this.endElevationM_1 - this.startElevationM_1;
636
663
  };
637
- protoOf(ClimbPart).q21 = function () {
638
- return this.i21() === 0.0 ? 0.0 : this.j21() / this.i21();
664
+ protoOf(ClimbPart).get_grade_is33qm_k$ = function () {
665
+ return this.get_lengthM_2aqrzy_k$() === 0.0 ? 0.0 : this.get_elevationGainM_6kg9eu_k$() / this.get_lengthM_2aqrzy_k$();
639
666
  };
640
667
  protoOf(ClimbPart).toString = function () {
641
- return 'ClimbPart(startDistanceM=' + this.m21_1 + ', endDistanceM=' + this.n21_1 + ', startElevationM=' + this.o21_1 + ', endElevationM=' + this.p21_1 + ')';
668
+ return 'ClimbPart(startDistanceM=' + this.startDistanceM_1 + ', endDistanceM=' + this.endDistanceM_1 + ', startElevationM=' + this.startElevationM_1 + ', endElevationM=' + this.endElevationM_1 + ')';
642
669
  };
643
670
  protoOf(ClimbPart).hashCode = function () {
644
- var result = getNumberHashCode(this.m21_1);
645
- result = imul(result, 31) + getNumberHashCode(this.n21_1) | 0;
646
- result = imul(result, 31) + getNumberHashCode(this.o21_1) | 0;
647
- result = imul(result, 31) + getNumberHashCode(this.p21_1) | 0;
671
+ var result = getNumberHashCode(this.startDistanceM_1);
672
+ result = imul(result, 31) + getNumberHashCode(this.endDistanceM_1) | 0;
673
+ result = imul(result, 31) + getNumberHashCode(this.startElevationM_1) | 0;
674
+ result = imul(result, 31) + getNumberHashCode(this.endElevationM_1) | 0;
648
675
  return result;
649
676
  };
650
677
  protoOf(ClimbPart).equals = function (other) {
@@ -652,28 +679,28 @@
652
679
  return true;
653
680
  if (!(other instanceof ClimbPart))
654
681
  return false;
655
- if (!equals(this.m21_1, other.m21_1))
682
+ if (!equals(this.startDistanceM_1, other.startDistanceM_1))
656
683
  return false;
657
- if (!equals(this.n21_1, other.n21_1))
684
+ if (!equals(this.endDistanceM_1, other.endDistanceM_1))
658
685
  return false;
659
- if (!equals(this.o21_1, other.o21_1))
686
+ if (!equals(this.startElevationM_1, other.startElevationM_1))
660
687
  return false;
661
- if (!equals(this.p21_1, other.p21_1))
688
+ if (!equals(this.endElevationM_1, other.endElevationM_1))
662
689
  return false;
663
690
  return true;
664
691
  };
665
692
  function Companion_3() {
666
693
  Companion_instance_3 = this;
667
- this.r21_1 = new ClimbOptions();
694
+ this.DEFAULT_1 = new ClimbOptions();
668
695
  }
669
696
  var Companion_instance_3;
670
- function Companion_getInstance_5() {
697
+ function Companion_getInstance_6() {
671
698
  if (Companion_instance_3 == null)
672
699
  new Companion_3();
673
700
  return Companion_instance_3;
674
701
  }
675
702
  function ClimbOptions(minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGradeRatio, booster, maxAnalysisPoints) {
676
- Companion_getInstance_5();
703
+ Companion_getInstance_6();
677
704
  minMinClimbElevationM = minMinClimbElevationM === VOID ? 10.0 : minMinClimbElevationM;
678
705
  maxMinClimbElevationM = maxMinClimbElevationM === VOID ? 35.0 : maxMinClimbElevationM;
679
706
  minClimbElevationRatio = minClimbElevationRatio === VOID ? 100.0 : minClimbElevationRatio;
@@ -681,30 +708,30 @@
681
708
  maxDiffRealGradeRatio = maxDiffRealGradeRatio === VOID ? 1.3 : maxDiffRealGradeRatio;
682
709
  booster = booster === VOID ? 1.3 : booster;
683
710
  maxAnalysisPoints = maxAnalysisPoints === VOID ? 3000 : maxAnalysisPoints;
684
- this.s21_1 = minMinClimbElevationM;
685
- this.t21_1 = maxMinClimbElevationM;
686
- this.u21_1 = minClimbElevationRatio;
687
- this.v21_1 = minGradePercent;
688
- this.w21_1 = maxDiffRealGradeRatio;
689
- this.x21_1 = booster;
690
- this.y21_1 = maxAnalysisPoints;
711
+ this.minMinClimbElevationM_1 = minMinClimbElevationM;
712
+ this.maxMinClimbElevationM_1 = maxMinClimbElevationM;
713
+ this.minClimbElevationRatio_1 = minClimbElevationRatio;
714
+ this.minGradePercent_1 = minGradePercent;
715
+ this.maxDiffRealGradeRatio_1 = maxDiffRealGradeRatio;
716
+ this.booster_1 = booster;
717
+ this.maxAnalysisPoints_1 = maxAnalysisPoints;
691
718
  // Inline function 'kotlin.require' call
692
- if (!(this.y21_1 >= 2)) {
719
+ if (!(this.maxAnalysisPoints_1 >= 2)) {
693
720
  var message = 'maxAnalysisPoints must be at least 2';
694
721
  throw IllegalArgumentException_init_$Create$(toString(message));
695
722
  }
696
723
  }
697
724
  protoOf(ClimbOptions).toString = function () {
698
- return 'ClimbOptions(minMinClimbElevationM=' + this.s21_1 + ', maxMinClimbElevationM=' + this.t21_1 + ', minClimbElevationRatio=' + this.u21_1 + ', minGradePercent=' + this.v21_1 + ', maxDiffRealGradeRatio=' + this.w21_1 + ', booster=' + this.x21_1 + ', maxAnalysisPoints=' + this.y21_1 + ')';
725
+ return 'ClimbOptions(minMinClimbElevationM=' + this.minMinClimbElevationM_1 + ', maxMinClimbElevationM=' + this.maxMinClimbElevationM_1 + ', minClimbElevationRatio=' + this.minClimbElevationRatio_1 + ', minGradePercent=' + this.minGradePercent_1 + ', maxDiffRealGradeRatio=' + this.maxDiffRealGradeRatio_1 + ', booster=' + this.booster_1 + ', maxAnalysisPoints=' + this.maxAnalysisPoints_1 + ')';
699
726
  };
700
727
  protoOf(ClimbOptions).hashCode = function () {
701
- var result = getNumberHashCode(this.s21_1);
702
- result = imul(result, 31) + getNumberHashCode(this.t21_1) | 0;
703
- result = imul(result, 31) + getNumberHashCode(this.u21_1) | 0;
704
- result = imul(result, 31) + getNumberHashCode(this.v21_1) | 0;
705
- result = imul(result, 31) + getNumberHashCode(this.w21_1) | 0;
706
- result = imul(result, 31) + getNumberHashCode(this.x21_1) | 0;
707
- result = imul(result, 31) + this.y21_1 | 0;
728
+ var result = getNumberHashCode(this.minMinClimbElevationM_1);
729
+ result = imul(result, 31) + getNumberHashCode(this.maxMinClimbElevationM_1) | 0;
730
+ result = imul(result, 31) + getNumberHashCode(this.minClimbElevationRatio_1) | 0;
731
+ result = imul(result, 31) + getNumberHashCode(this.minGradePercent_1) | 0;
732
+ result = imul(result, 31) + getNumberHashCode(this.maxDiffRealGradeRatio_1) | 0;
733
+ result = imul(result, 31) + getNumberHashCode(this.booster_1) | 0;
734
+ result = imul(result, 31) + this.maxAnalysisPoints_1 | 0;
708
735
  return result;
709
736
  };
710
737
  protoOf(ClimbOptions).equals = function (other) {
@@ -712,29 +739,29 @@
712
739
  return true;
713
740
  if (!(other instanceof ClimbOptions))
714
741
  return false;
715
- if (!equals(this.s21_1, other.s21_1))
742
+ if (!equals(this.minMinClimbElevationM_1, other.minMinClimbElevationM_1))
716
743
  return false;
717
- if (!equals(this.t21_1, other.t21_1))
744
+ if (!equals(this.maxMinClimbElevationM_1, other.maxMinClimbElevationM_1))
718
745
  return false;
719
- if (!equals(this.u21_1, other.u21_1))
746
+ if (!equals(this.minClimbElevationRatio_1, other.minClimbElevationRatio_1))
720
747
  return false;
721
- if (!equals(this.v21_1, other.v21_1))
748
+ if (!equals(this.minGradePercent_1, other.minGradePercent_1))
722
749
  return false;
723
- if (!equals(this.w21_1, other.w21_1))
750
+ if (!equals(this.maxDiffRealGradeRatio_1, other.maxDiffRealGradeRatio_1))
724
751
  return false;
725
- if (!equals(this.x21_1, other.x21_1))
752
+ if (!equals(this.booster_1, other.booster_1))
726
753
  return false;
727
- if (!(this.y21_1 === other.y21_1))
754
+ if (!(this.maxAnalysisPoints_1 === other.maxAnalysisPoints_1))
728
755
  return false;
729
756
  return true;
730
757
  };
731
758
  function Companion_4() {
732
759
  }
733
- protoOf(Companion_4).z21 = function (path, maxPoints) {
760
+ protoOf(Companion_4).of_tmvbpf_k$ = function (path, maxPoints) {
734
761
  var tmp;
735
- if (path.u1q_1 <= maxPoints) {
762
+ if (path.size_1 <= maxPoints) {
736
763
  var tmp_0 = 0;
737
- var tmp_1 = path.u1q_1;
764
+ var tmp_1 = path.size_1;
738
765
  var tmp_2 = new Int32Array(tmp_1);
739
766
  while (tmp_0 < tmp_1) {
740
767
  var tmp_3 = tmp_0;
@@ -743,15 +770,15 @@
743
770
  }
744
771
  tmp = tmp_2;
745
772
  } else {
746
- var stride = ((path.u1q_1 + maxPoints | 0) - 1 | 0) / maxPoints | 0;
773
+ var stride = ((path.size_1 + maxPoints | 0) - 1 | 0) / maxPoints | 0;
747
774
  var kept = ArrayList_init_$Create$_0(maxPoints + 1 | 0);
748
775
  var i = 0;
749
- while (i < path.u1q_1) {
750
- kept.h(i);
776
+ while (i < path.size_1) {
777
+ kept.add_utx5q5_k$(i);
751
778
  i = i + stride | 0;
752
779
  }
753
- if (!(last(kept) === (path.u1q_1 - 1 | 0))) {
754
- kept.h(path.u1q_1 - 1 | 0);
780
+ if (!(last(kept) === (path.size_1 - 1 | 0))) {
781
+ kept.add_utx5q5_k$(path.size_1 - 1 | 0);
755
782
  }
756
783
  tmp = toIntArray(kept);
757
784
  }
@@ -761,7 +788,7 @@
761
788
  var tmp_6 = new Float64Array(tmp_5);
762
789
  while (tmp_4 < tmp_5) {
763
790
  var tmp_7 = tmp_4;
764
- tmp_6[tmp_7] = path.k1u(indices[tmp_7]);
791
+ tmp_6[tmp_7] = path.distance_5s4s77_k$(indices[tmp_7]);
765
792
  tmp_4 = tmp_4 + 1 | 0;
766
793
  }
767
794
  var tmp_8 = 0;
@@ -769,43 +796,43 @@
769
796
  var tmp_10 = new Float64Array(tmp_9);
770
797
  while (tmp_8 < tmp_9) {
771
798
  var tmp_11 = tmp_8;
772
- tmp_10[tmp_11] = path.y1q(indices[tmp_11]);
799
+ tmp_10[tmp_11] = path.elevation_iziwkb_k$(indices[tmp_11]);
773
800
  tmp_8 = tmp_8 + 1 | 0;
774
801
  }
775
802
  return new Profile(tmp_6, tmp_10, indices);
776
803
  };
777
804
  var Companion_instance_4;
778
- function Companion_getInstance_6() {
805
+ function Companion_getInstance_7() {
779
806
  return Companion_instance_4;
780
807
  }
781
808
  function Profile(distance, elevation, sourceIndex) {
782
- this.a22_1 = distance;
783
- this.b22_1 = elevation;
784
- this.c22_1 = sourceIndex;
809
+ this.distance_1 = distance;
810
+ this.elevation_1 = elevation;
811
+ this.sourceIndex_1 = sourceIndex;
785
812
  }
786
- protoOf(Profile).l = function () {
787
- return this.a22_1.length;
813
+ protoOf(Profile).get_size_woubt6_k$ = function () {
814
+ return this.distance_1.length;
788
815
  };
789
816
  function bestCandidateFrom($this, profile, i, minClimbElevation, options) {
790
- var startDist = profile.a22_1[i];
791
- var startEle = profile.b22_1[i];
817
+ var startDist = profile.distance_1[i];
818
+ var startEle = profile.elevation_1[i];
792
819
  var positiveElevation = 0.0;
793
820
  var negativeElevation = 0.0;
794
821
  var distClimbing = 0.0;
795
822
  var bestScore = 0.0;
796
823
  var best = null;
797
824
  var inductionVariable = i + 1 | 0;
798
- var last = profile.l();
825
+ var last = profile.get_size_woubt6_k$();
799
826
  if (inductionVariable < last)
800
827
  $l$loop: do {
801
828
  var j = inductionVariable;
802
829
  inductionVariable = inductionVariable + 1 | 0;
803
- var endDist = profile.a22_1[j];
804
- var endEle = profile.b22_1[j];
805
- var dEle = endEle - profile.b22_1[j - 1 | 0];
830
+ var endDist = profile.distance_1[j];
831
+ var endEle = profile.elevation_1[j];
832
+ var dEle = endEle - profile.elevation_1[j - 1 | 0];
806
833
  if (dEle > 0) {
807
834
  positiveElevation = positiveElevation + dEle;
808
- distClimbing = distClimbing + (endDist - profile.a22_1[j - 1 | 0]);
835
+ distClimbing = distClimbing + (endDist - profile.distance_1[j - 1 | 0]);
809
836
  } else {
810
837
  negativeElevation = negativeElevation + dEle;
811
838
  }
@@ -816,9 +843,9 @@
816
843
  var gradePercent = 100.0 * netElevation / length;
817
844
  var climbingGradePercent = distClimbing > 0 ? 100.0 * positiveElevation / distClimbing : 0.0;
818
845
  // Inline function 'kotlin.math.pow' call
819
- var x = options.x21_1;
846
+ var x = options.booster_1;
820
847
  var score = length * Math.pow(gradePercent, x);
821
- var qualifies = gradePercent >= options.v21_1 && netElevation >= minClimbElevation && score >= bestScore && climbingGradePercent / gradePercent <= options.w21_1;
848
+ var qualifies = gradePercent >= options.minGradePercent_1 && netElevation >= minClimbElevation && score >= bestScore && climbingGradePercent / gradePercent <= options.maxDiffRealGradeRatio_1;
822
849
  if (qualifies) {
823
850
  bestScore = score;
824
851
  best = new Candidate(i, j, score, positiveElevation, negativeElevation);
@@ -838,60 +865,60 @@
838
865
  var kept = ArrayList_init_$Create$();
839
866
  $l$loop: while (true) {
840
867
  // Inline function 'kotlin.collections.isNotEmpty' call
841
- if (!!remaining.n()) {
868
+ if (!!remaining.isEmpty_y1axqb_k$()) {
842
869
  break $l$loop;
843
870
  }
844
871
  var best = first(remaining);
845
- kept.h(best);
872
+ kept.add_utx5q5_k$(best);
846
873
  removeAll(remaining, ClimbDetector$dedupeByScore$lambda_0(best));
847
874
  }
848
875
  return kept;
849
876
  }
850
877
  function toClimb($this, $receiver, path, profile) {
851
- return new Climb(profile.c22_1[$receiver.d22_1], profile.c22_1[$receiver.e22_1], profile.a22_1[$receiver.d22_1], profile.a22_1[$receiver.e22_1], profile.b22_1[$receiver.d22_1], profile.b22_1[$receiver.e22_1], $receiver.g22_1, $receiver.h22_1, splitIntoParts($this, profile, $receiver.d22_1, $receiver.e22_1));
878
+ return new Climb(profile.sourceIndex_1[$receiver.startIndex_1], profile.sourceIndex_1[$receiver.endIndex_1], profile.distance_1[$receiver.startIndex_1], profile.distance_1[$receiver.endIndex_1], profile.elevation_1[$receiver.startIndex_1], profile.elevation_1[$receiver.endIndex_1], $receiver.positiveElevationM_1, $receiver.negativeElevationM_1, splitIntoParts($this, profile, $receiver.startIndex_1, $receiver.endIndex_1));
852
879
  }
853
880
  function splitIntoParts($this, profile, startIndex, endIndex) {
854
881
  // Inline function 'kotlin.collections.map' call
855
882
  var this_0 = numberRangeToNumber(startIndex, endIndex);
856
883
  // Inline function 'kotlin.collections.mapTo' call
857
884
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
858
- var inductionVariable = this_0.lc_1;
859
- var last = this_0.mc_1;
885
+ var inductionVariable = this_0.first_1;
886
+ var last = this_0.last_1;
860
887
  if (inductionVariable <= last)
861
888
  do {
862
889
  var item = inductionVariable;
863
890
  inductionVariable = inductionVariable + 1 | 0;
864
891
  var i = item;
865
- var tmp$ret$2 = new Vector3D(profile.a22_1[i], profile.b22_1[i], 0.0);
866
- destination.h(tmp$ret$2);
892
+ var tmp$ret$2 = new Vector3D(profile.distance_1[i], profile.elevation_1[i], 0.0);
893
+ destination.add_utx5q5_k$(tmp$ret$2);
867
894
  }
868
895
  while (!(item === last));
869
896
  var points = destination;
870
- if (points.l() < 2)
897
+ if (points.get_size_woubt6_k$() < 2)
871
898
  return emptyList();
872
- var elevationGain = profile.b22_1[endIndex] - profile.b22_1[startIndex];
899
+ var elevationGain = profile.elevation_1[endIndex] - profile.elevation_1[startIndex];
873
900
  var tolerance = coerceIn(elevationGain / 50.0, 10.0, 50.0);
874
- var keptIndices = DouglasPeucker_instance.ix(points, tolerance);
901
+ var keptIndices = DouglasPeucker_instance.simplifyIndices_1yk9dd_k$(points, tolerance);
875
902
  var tmp$ret$3;
876
903
  $l$block: {
877
904
  // Inline function 'kotlin.collections.zipWithNext' call
878
- var iterator = keptIndices.i();
879
- if (!iterator.j()) {
905
+ var iterator = keptIndices.iterator_jk1svi_k$();
906
+ if (!iterator.hasNext_bitz1p_k$()) {
880
907
  tmp$ret$3 = emptyList();
881
908
  break $l$block;
882
909
  }
883
910
  // Inline function 'kotlin.collections.mutableListOf' call
884
911
  var result = ArrayList_init_$Create$();
885
- var current = iterator.k();
886
- while (iterator.j()) {
887
- var next = iterator.k();
912
+ var current = iterator.next_20eer_k$();
913
+ while (iterator.hasNext_bitz1p_k$()) {
914
+ var next = iterator.next_20eer_k$();
888
915
  var a = current;
889
- var tmp0_startDistanceM = points.m(a).dx_1;
890
- var tmp1_startElevationM = points.m(a).ex_1;
891
- var tmp2_endDistanceM = points.m(next).dx_1;
892
- var tmp3_endElevationM = points.m(next).ex_1;
916
+ var tmp0_startDistanceM = points.get_c1px32_k$(a).x_1;
917
+ var tmp1_startElevationM = points.get_c1px32_k$(a).y_1;
918
+ var tmp2_endDistanceM = points.get_c1px32_k$(next).x_1;
919
+ var tmp3_endElevationM = points.get_c1px32_k$(next).y_1;
893
920
  var tmp$ret$5 = new ClimbPart(tmp0_startDistanceM, tmp2_endDistanceM, tmp1_startElevationM, tmp3_endElevationM);
894
- result.h(tmp$ret$5);
921
+ result.add_utx5q5_k$(tmp$ret$5);
895
922
  current = next;
896
923
  }
897
924
  tmp$ret$3 = result;
@@ -899,24 +926,24 @@
899
926
  return tmp$ret$3;
900
927
  }
901
928
  function Candidate(startIndex, endIndex, score, positiveElevationM, negativeElevationM) {
902
- this.d22_1 = startIndex;
903
- this.e22_1 = endIndex;
904
- this.f22_1 = score;
905
- this.g22_1 = positiveElevationM;
906
- this.h22_1 = negativeElevationM;
929
+ this.startIndex_1 = startIndex;
930
+ this.endIndex_1 = endIndex;
931
+ this.score_1 = score;
932
+ this.positiveElevationM_1 = positiveElevationM;
933
+ this.negativeElevationM_1 = negativeElevationM;
907
934
  }
908
- protoOf(Candidate).i22 = function (other) {
909
- return other.d22_1 <= this.d22_1 && this.d22_1 <= other.e22_1 || (other.d22_1 <= this.e22_1 && this.e22_1 <= other.e22_1) || (this.d22_1 <= other.d22_1 && other.e22_1 <= this.e22_1);
935
+ protoOf(Candidate).overlaps_wp0rru_k$ = function (other) {
936
+ return other.startIndex_1 <= this.startIndex_1 && this.startIndex_1 <= other.endIndex_1 || (other.startIndex_1 <= this.endIndex_1 && this.endIndex_1 <= other.endIndex_1) || (this.startIndex_1 <= other.startIndex_1 && other.endIndex_1 <= this.endIndex_1);
910
937
  };
911
938
  protoOf(Candidate).toString = function () {
912
- return 'Candidate(startIndex=' + this.d22_1 + ', endIndex=' + this.e22_1 + ', score=' + this.f22_1 + ', positiveElevationM=' + this.g22_1 + ', negativeElevationM=' + this.h22_1 + ')';
939
+ return 'Candidate(startIndex=' + this.startIndex_1 + ', endIndex=' + this.endIndex_1 + ', score=' + this.score_1 + ', positiveElevationM=' + this.positiveElevationM_1 + ', negativeElevationM=' + this.negativeElevationM_1 + ')';
913
940
  };
914
941
  protoOf(Candidate).hashCode = function () {
915
- var result = this.d22_1;
916
- result = imul(result, 31) + this.e22_1 | 0;
917
- result = imul(result, 31) + getNumberHashCode(this.f22_1) | 0;
918
- result = imul(result, 31) + getNumberHashCode(this.g22_1) | 0;
919
- result = imul(result, 31) + getNumberHashCode(this.h22_1) | 0;
942
+ var result = this.startIndex_1;
943
+ result = imul(result, 31) + this.endIndex_1 | 0;
944
+ result = imul(result, 31) + getNumberHashCode(this.score_1) | 0;
945
+ result = imul(result, 31) + getNumberHashCode(this.positiveElevationM_1) | 0;
946
+ result = imul(result, 31) + getNumberHashCode(this.negativeElevationM_1) | 0;
920
947
  return result;
921
948
  };
922
949
  protoOf(Candidate).equals = function (other) {
@@ -924,36 +951,36 @@
924
951
  return true;
925
952
  if (!(other instanceof Candidate))
926
953
  return false;
927
- if (!(this.d22_1 === other.d22_1))
954
+ if (!(this.startIndex_1 === other.startIndex_1))
928
955
  return false;
929
- if (!(this.e22_1 === other.e22_1))
956
+ if (!(this.endIndex_1 === other.endIndex_1))
930
957
  return false;
931
- if (!equals(this.f22_1, other.f22_1))
958
+ if (!equals(this.score_1, other.score_1))
932
959
  return false;
933
- if (!equals(this.g22_1, other.g22_1))
960
+ if (!equals(this.positiveElevationM_1, other.positiveElevationM_1))
934
961
  return false;
935
- if (!equals(this.h22_1, other.h22_1))
962
+ if (!equals(this.negativeElevationM_1, other.negativeElevationM_1))
936
963
  return false;
937
964
  return true;
938
965
  };
939
966
  function sam$kotlin_Comparator$0(function_0) {
940
- this.j22_1 = function_0;
967
+ this.function_1 = function_0;
941
968
  }
942
- protoOf(sam$kotlin_Comparator$0).l9 = function (a, b) {
943
- return this.j22_1(a, b);
969
+ protoOf(sam$kotlin_Comparator$0).compare_bczr_k$ = function (a, b) {
970
+ return this.function_1(a, b);
944
971
  };
945
972
  protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
946
- return this.l9(a, b);
973
+ return this.compare_bczr_k$(a, b);
947
974
  };
948
- protoOf(sam$kotlin_Comparator$0).x1 = function () {
949
- return this.j22_1;
975
+ protoOf(sam$kotlin_Comparator$0).getFunctionDelegate_jtodtf_k$ = function () {
976
+ return this.function_1;
950
977
  };
951
978
  protoOf(sam$kotlin_Comparator$0).equals = function (other) {
952
979
  var tmp;
953
980
  if (!(other == null) ? isInterface(other, Comparator) : false) {
954
981
  var tmp_0;
955
982
  if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
956
- tmp_0 = equals(this.x1(), other.x1());
983
+ tmp_0 = equals(this.getFunctionDelegate_jtodtf_k$(), other.getFunctionDelegate_jtodtf_k$());
957
984
  } else {
958
985
  tmp_0 = false;
959
986
  }
@@ -964,26 +991,26 @@
964
991
  return tmp;
965
992
  };
966
993
  protoOf(sam$kotlin_Comparator$0).hashCode = function () {
967
- return hashCode(this.x1());
994
+ return hashCode(this.getFunctionDelegate_jtodtf_k$());
968
995
  };
969
996
  function sam$kotlin_Comparator$0_0(function_0) {
970
- this.k22_1 = function_0;
997
+ this.function_1 = function_0;
971
998
  }
972
- protoOf(sam$kotlin_Comparator$0_0).l9 = function (a, b) {
973
- return this.k22_1(a, b);
999
+ protoOf(sam$kotlin_Comparator$0_0).compare_bczr_k$ = function (a, b) {
1000
+ return this.function_1(a, b);
974
1001
  };
975
1002
  protoOf(sam$kotlin_Comparator$0_0).compare = function (a, b) {
976
- return this.l9(a, b);
1003
+ return this.compare_bczr_k$(a, b);
977
1004
  };
978
- protoOf(sam$kotlin_Comparator$0_0).x1 = function () {
979
- return this.k22_1;
1005
+ protoOf(sam$kotlin_Comparator$0_0).getFunctionDelegate_jtodtf_k$ = function () {
1006
+ return this.function_1;
980
1007
  };
981
1008
  protoOf(sam$kotlin_Comparator$0_0).equals = function (other) {
982
1009
  var tmp;
983
1010
  if (!(other == null) ? isInterface(other, Comparator) : false) {
984
1011
  var tmp_0;
985
1012
  if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
986
- tmp_0 = equals(this.x1(), other.x1());
1013
+ tmp_0 = equals(this.getFunctionDelegate_jtodtf_k$(), other.getFunctionDelegate_jtodtf_k$());
987
1014
  } else {
988
1015
  tmp_0 = false;
989
1016
  }
@@ -994,49 +1021,49 @@
994
1021
  return tmp;
995
1022
  };
996
1023
  protoOf(sam$kotlin_Comparator$0_0).hashCode = function () {
997
- return hashCode(this.x1());
1024
+ return hashCode(this.getFunctionDelegate_jtodtf_k$());
998
1025
  };
999
1026
  function ClimbDetector$detect$lambda(a, b) {
1000
1027
  // Inline function 'kotlin.comparisons.compareValuesBy' call
1001
- var tmp = a.d22_1;
1002
- var tmp$ret$2 = b.d22_1;
1028
+ var tmp = a.startIndex_1;
1029
+ var tmp$ret$2 = b.startIndex_1;
1003
1030
  return compareValues(tmp, tmp$ret$2);
1004
1031
  }
1005
1032
  function ClimbDetector$dedupeByScore$lambda(a, b) {
1006
1033
  // Inline function 'kotlin.comparisons.compareValuesBy' call
1007
- var tmp = b.f22_1;
1008
- var tmp$ret$2 = a.f22_1;
1034
+ var tmp = b.score_1;
1035
+ var tmp$ret$2 = a.score_1;
1009
1036
  return compareValues(tmp, tmp$ret$2);
1010
1037
  }
1011
1038
  function ClimbDetector$dedupeByScore$lambda_0($best) {
1012
1039
  return function (it) {
1013
- return it.i22($best);
1040
+ return it.overlaps_wp0rru_k$($best);
1014
1041
  };
1015
1042
  }
1016
1043
  function ClimbDetector() {
1017
- this.l22_1 = 10.0;
1018
- this.m22_1 = 10.0;
1019
- this.n22_1 = 50.0;
1020
- this.o22_1 = 50.0;
1044
+ this.MIN_CANDIDATE_LENGTH_M_1 = 10.0;
1045
+ this.MIN_PART_TOLERANCE_M_1 = 10.0;
1046
+ this.MAX_PART_TOLERANCE_M_1 = 50.0;
1047
+ this.PART_TOLERANCE_DIVISOR_1 = 50.0;
1021
1048
  }
1022
- protoOf(ClimbDetector).p22 = function (path, options) {
1023
- if (path.u1q_1 < 2)
1049
+ protoOf(ClimbDetector).detect_llooq2_k$ = function (path, options) {
1050
+ if (path.size_1 < 2)
1024
1051
  return emptyList();
1025
- var tmp0 = options.s21_1;
1026
- var tmp0_0 = options.t21_1;
1052
+ var tmp0 = options.minMinClimbElevationM_1;
1053
+ var tmp0_0 = options.maxMinClimbElevationM_1;
1027
1054
  // Inline function 'kotlin.comparisons.minOf' call
1028
- var b = path.a1s_1 / options.u21_1;
1055
+ var b = path.elevationGain_1 / options.minClimbElevationRatio_1;
1029
1056
  // Inline function 'kotlin.comparisons.maxOf' call
1030
1057
  var b_0 = Math.min(tmp0_0, b);
1031
1058
  var minClimbElevation = Math.max(tmp0, b_0);
1032
- var profile = Companion_instance_4.z21(path, options.y21_1);
1059
+ var profile = Companion_instance_4.of_tmvbpf_k$(path, options.maxAnalysisPoints_1);
1033
1060
  // Inline function 'kotlin.collections.mapNotNull' call
1034
- var tmp0_1 = until(0, profile.l());
1061
+ var tmp0_1 = until(0, profile.get_size_woubt6_k$());
1035
1062
  // Inline function 'kotlin.collections.mapNotNullTo' call
1036
1063
  var destination = ArrayList_init_$Create$();
1037
1064
  // Inline function 'kotlin.collections.forEach' call
1038
- var inductionVariable = tmp0_1.lc_1;
1039
- var last = tmp0_1.mc_1;
1065
+ var inductionVariable = tmp0_1.first_1;
1066
+ var last = tmp0_1.last_1;
1040
1067
  if (inductionVariable <= last)
1041
1068
  do {
1042
1069
  var element = inductionVariable;
@@ -1047,7 +1074,7 @@
1047
1074
  null;
1048
1075
  else {
1049
1076
  // Inline function 'kotlin.let' call
1050
- destination.h(tmp0_safe_receiver);
1077
+ destination.add_utx5q5_k$(tmp0_safe_receiver);
1051
1078
  }
1052
1079
  }
1053
1080
  while (!(element === last));
@@ -1061,32 +1088,123 @@
1061
1088
  var this_1 = sortedWith(this_0, tmp$ret$10);
1062
1089
  // Inline function 'kotlin.collections.mapTo' call
1063
1090
  var destination_0 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_1, 10));
1064
- var _iterator__ex2g4s = this_1.i();
1065
- while (_iterator__ex2g4s.j()) {
1066
- var item = _iterator__ex2g4s.k();
1091
+ var _iterator__ex2g4s = this_1.iterator_jk1svi_k$();
1092
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1093
+ var item = _iterator__ex2g4s.next_20eer_k$();
1067
1094
  var tmp$ret$13 = toClimb(ClimbDetector_instance, item, path, profile);
1068
- destination_0.h(tmp$ret$13);
1095
+ destination_0.add_utx5q5_k$(tmp$ret$13);
1069
1096
  }
1070
1097
  return destination_0;
1071
1098
  };
1072
- protoOf(ClimbDetector).q22 = function (path, options, $super) {
1073
- options = options === VOID ? Companion_getInstance_5().r21_1 : options;
1074
- return $super === VOID ? this.p22(path, options) : $super.p22.call(this, path, options);
1099
+ protoOf(ClimbDetector).detect$default_6ml3ny_k$ = function (path, options, $super) {
1100
+ options = options === VOID ? Companion_getInstance_6().DEFAULT_1 : options;
1101
+ return $super === VOID ? this.detect_llooq2_k$(path, options) : $super.detect_llooq2_k$.call(this, path, options);
1075
1102
  };
1076
1103
  var ClimbDetector_instance;
1077
1104
  function ClimbDetector_getInstance() {
1078
1105
  return ClimbDetector_instance;
1079
1106
  }
1107
+ function dominantHeadwindDirection(_this__u8e3s4) {
1108
+ var sumX = 0.0;
1109
+ var sumY = 0.0;
1110
+ var contributing = 0;
1111
+ var _iterator__ex2g4s = _this__u8e3s4.iterator_jk1svi_k$();
1112
+ $l$loop: while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1113
+ var path = _iterator__ex2g4s.next_20eer_k$();
1114
+ var tmp0_elvis_lhs = meanDirectionFromStart(path);
1115
+ var tmp;
1116
+ if (tmp0_elvis_lhs == null) {
1117
+ continue $l$loop;
1118
+ } else {
1119
+ tmp = tmp0_elvis_lhs;
1120
+ }
1121
+ var mean = tmp;
1122
+ sumX = sumX + mean.first_1;
1123
+ sumY = sumY + mean.second_1;
1124
+ contributing = contributing + 1 | 0;
1125
+ }
1126
+ if (contributing === 0)
1127
+ return null;
1128
+ var tmp0 = sumX;
1129
+ // Inline function 'kotlin.math.hypot' call
1130
+ var y = sumY;
1131
+ var magnitude = hypot(tmp0, y);
1132
+ if (magnitude < 1.0E-12)
1133
+ return null;
1134
+ return new Vector3D(-sumX / magnitude, -sumY / magnitude, 0.0);
1135
+ }
1136
+ function meanDirectionFromStart(_this__u8e3s4) {
1137
+ if (_this__u8e3s4.size_1 <= 3)
1138
+ return null;
1139
+ var lat0 = _this__u8e3s4.latitude_gb4iok_k$(0);
1140
+ var lon0 = _this__u8e3s4.longitude_a9xl_k$(0);
1141
+ // Inline function 'kotlin.math.cos' call
1142
+ var cosLat0 = Math.cos(lat0);
1143
+ var sumX = 0.0;
1144
+ var sumY = 0.0;
1145
+ var inductionVariable = 1;
1146
+ var last = _this__u8e3s4.size_1;
1147
+ if (inductionVariable < last)
1148
+ $l$loop: do {
1149
+ var i = inductionVariable;
1150
+ inductionVariable = inductionVariable + 1 | 0;
1151
+ var dx = (_this__u8e3s4.longitude_a9xl_k$(i) - lon0) * cosLat0;
1152
+ var dy = _this__u8e3s4.latitude_gb4iok_k$(i) - lat0;
1153
+ // Inline function 'kotlin.math.hypot' call
1154
+ var length = hypot(dx, dy);
1155
+ if (length < 1.0E-12)
1156
+ continue $l$loop;
1157
+ sumX = sumX + dx / length;
1158
+ sumY = sumY + dy / length;
1159
+ }
1160
+ while (inductionVariable < last);
1161
+ var n = _this__u8e3s4.size_1 - 1 | 0;
1162
+ return new Pair(sumX / n, sumY / n);
1163
+ }
1164
+ function dominantHeadwindAzimuthDeg(_this__u8e3s4) {
1165
+ return dominantHeadwindAzimuthDeg_0(listOf(_this__u8e3s4));
1166
+ }
1167
+ function dominantHeadwindAzimuthDeg_0(_this__u8e3s4) {
1168
+ var tmp0_elvis_lhs = dominantHeadwindDirection(_this__u8e3s4);
1169
+ var tmp;
1170
+ if (tmp0_elvis_lhs == null) {
1171
+ return NaN;
1172
+ } else {
1173
+ tmp = tmp0_elvis_lhs;
1174
+ }
1175
+ var direction = tmp;
1176
+ var tmp0 = direction.x_1;
1177
+ // Inline function 'kotlin.math.atan2' call
1178
+ var x = direction.y_1;
1179
+ // Inline function 'kotlin.mod' call
1180
+ var r = Math.atan2(tmp0, x) * 57.29577951308232 % 360.0;
1181
+ var tmp_0;
1182
+ var tmp_1;
1183
+ if (!(r === 0.0)) {
1184
+ // Inline function 'kotlin.math.sign' call
1185
+ var tmp_2 = sign(r);
1186
+ // Inline function 'kotlin.math.sign' call
1187
+ tmp_1 = !(tmp_2 === sign(360.0));
1188
+ } else {
1189
+ tmp_1 = false;
1190
+ }
1191
+ if (tmp_1) {
1192
+ tmp_0 = r + 360.0;
1193
+ } else {
1194
+ tmp_0 = r;
1195
+ }
1196
+ return tmp_0;
1197
+ }
1080
1198
  function computeWithWind($this, path, i, aeroCoef, wind) {
1081
- var speed = path.m1v(i);
1082
- var bearing = path.r1u(i);
1083
- path.s1v(i, wind.r22_1);
1084
- path.t1v(i, wind.s22_1);
1085
- var windDirectionAsBearing = 3.141592653589793 / 2.0 - wind.s22_1;
1086
- path.x1u(i, windDirectionAsBearing);
1199
+ var speed = path.speed_npav2n_k$(i);
1200
+ var bearing = path.bearing_fz5vxm_k$(i);
1201
+ path.setWindSpeed_ggaslh_k$(i, wind.speedMS_1);
1202
+ path.setWindDirection_86vnxv_k$(i, wind.directionRad_1);
1203
+ var windDirectionAsBearing = 3.141592653589793 / 2.0 - wind.directionRad_1;
1204
+ path.setWindBearing_44dbry_k$(i, windDirectionAsBearing);
1087
1205
  var alpha = windDirectionAsBearing - bearing;
1088
- path.y1u(i, alpha);
1089
- var v = wind.r22_1;
1206
+ path.setWindAlpha_xkbtf2_k$(i, alpha);
1207
+ var v = wind.speedMS_1;
1090
1208
  // Inline function 'kotlin.math.cos' call
1091
1209
  var l1 = speed + v * Math.cos(alpha);
1092
1210
  var l2 = l1 * l1;
@@ -1101,21 +1219,21 @@
1101
1219
  return tmp_1 * Math.sqrt(l3) * l1 * speed;
1102
1220
  }
1103
1221
  function AeroPowerProvider() {
1104
- this.t22_1 = 1.2;
1222
+ this.MU_1 = 1.2;
1105
1223
  }
1106
- protoOf(AeroPowerProvider).u22 = function (course, path, pointIndex) {
1107
- var aeroCoef = course.b1z_1.v22(course, path, pointIndex);
1108
- path.w1u(pointIndex, aeroCoef);
1109
- var wind = course.c1z_1.w22(course.z1y_1, path, pointIndex);
1224
+ protoOf(AeroPowerProvider).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
1225
+ var aeroCoef = course.aeroProvider_1.aeroCoef_5n4cco_k$(course, path, pointIndex);
1226
+ path.setAeroCoef_tmjifm_k$(pointIndex, aeroCoef);
1227
+ var wind = course.windProvider_1.wind_umf2tf_k$(course.course_1, path, pointIndex);
1110
1228
  var tmp;
1111
- if (wind.r22_1 === 0.0) {
1112
- var v = path.m1v(pointIndex);
1229
+ if (wind.speedMS_1 === 0.0) {
1230
+ var v = path.speed_npav2n_k$(pointIndex);
1113
1231
  tmp = -aeroCoef * v * v * v;
1114
1232
  } else {
1115
1233
  tmp = computeWithWind(this, path, pointIndex, aeroCoef, wind);
1116
1234
  }
1117
1235
  var pAir = tmp;
1118
- path.z1u(pointIndex, pAir);
1236
+ path.setPAero_mmc4mr_k$(pointIndex, pAir);
1119
1237
  return pAir;
1120
1238
  };
1121
1239
  var AeroPowerProvider_instance;
@@ -1124,28 +1242,28 @@
1124
1242
  }
1125
1243
  function AeroProviderConstant() {
1126
1244
  }
1127
- protoOf(AeroProviderConstant).v22 = function (course, path, pointIndex) {
1128
- var rho = course.a1z_1.x22(course.z1y_1, path, pointIndex);
1129
- return course.f1z().l1z_1 * course.f1z().m1z_1 * rho / 2.0;
1245
+ protoOf(AeroProviderConstant).aeroCoef_5n4cco_k$ = function (course, path, pointIndex) {
1246
+ var rho = course.rhoProvider_1.rho_pwqvzi_k$(course.course_1, path, pointIndex);
1247
+ return course.get_cyclist_lkc0de_k$().cd_1 * course.get_cyclist_lkc0de_k$().frontalAreaM2__1 * rho / 2.0;
1130
1248
  };
1131
1249
  var AeroProviderConstant_instance;
1132
1250
  function AeroProviderConstant_getInstance() {
1133
1251
  return AeroProviderConstant_instance;
1134
1252
  }
1135
1253
  function Companion_5() {
1136
- this.y22_1 = 0.05;
1137
- this.z22_1 = 3.0;
1254
+ this.TOLERANCE_1 = 0.05;
1255
+ this.MAX_MULTIPLIER_1 = 3.0;
1138
1256
  }
1139
1257
  var Companion_instance_5;
1140
- function Companion_getInstance_7() {
1258
+ function Companion_getInstance_8() {
1141
1259
  return Companion_instance_5;
1142
1260
  }
1143
1261
  function CyclistPowerProviderBase(useHarmonics, random) {
1144
1262
  random = random === VOID ? Default_getInstance() : random;
1145
- this.a23_1 = useHarmonics;
1263
+ this.useHarmonics_1 = useHarmonics;
1146
1264
  var tmp = this;
1147
1265
  var tmp_0;
1148
- if (this.a23_1) {
1266
+ if (this.useHarmonics_1) {
1149
1267
  // Inline function 'kotlin.collections.List' call
1150
1268
  // Inline function 'kotlin.collections.MutableList' call
1151
1269
  var list = ArrayList_init_$Create$_0(20);
@@ -1155,48 +1273,48 @@
1155
1273
  do {
1156
1274
  var index = inductionVariable;
1157
1275
  inductionVariable = inductionVariable + 1 | 0;
1158
- var tmp$ret$4 = new Harmonic(1.0 + random.zb() * 9.0, random.zb() * 3.141592653589793, random.zb() * 0.01);
1159
- list.h(tmp$ret$4);
1276
+ var tmp$ret$4 = new Harmonic(1.0 + random.nextDouble_s2xvfg_k$() * 9.0, random.nextDouble_s2xvfg_k$() * 3.141592653589793, random.nextDouble_s2xvfg_k$() * 0.01);
1277
+ list.add_utx5q5_k$(tmp$ret$4);
1160
1278
  }
1161
1279
  while (inductionVariable < 20);
1162
1280
  tmp_0 = list;
1163
1281
  } else {
1164
1282
  tmp_0 = emptyList();
1165
1283
  }
1166
- tmp.b23_1 = tmp_0;
1167
- }
1168
- protoOf(CyclistPowerProviderBase).u22 = function (course, path, pointIndex) {
1169
- var power = this.c23(course, path, pointIndex);
1170
- path.d1v(pointIndex, power);
1171
- if (this.a23_1) {
1172
- var x = path.z1q(pointIndex) / 10000.0;
1173
- var _iterator__ex2g4s = this.b23_1.i();
1174
- while (_iterator__ex2g4s.j()) {
1175
- var h = _iterator__ex2g4s.k();
1284
+ tmp.harmonics_1 = tmp_0;
1285
+ }
1286
+ protoOf(CyclistPowerProviderBase).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
1287
+ var power = this.optimalPower_36kg19_k$(course, path, pointIndex);
1288
+ path.setPCyclistProvidedOptimalPower_gha9up_k$(pointIndex, power);
1289
+ if (this.useHarmonics_1) {
1290
+ var x = path.time_ryc845_k$(pointIndex) / 10000.0;
1291
+ var _iterator__ex2g4s = this.harmonics_1.iterator_jk1svi_k$();
1292
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1293
+ var h = _iterator__ex2g4s.next_20eer_k$();
1176
1294
  var tmp = power;
1177
- var tmp_0 = h.f23_1 * power;
1295
+ var tmp_0 = h.amp_1 * power;
1178
1296
  // Inline function 'kotlin.math.cos' call
1179
- var x_0 = h.d23_1 * x - h.e23_1;
1297
+ var x_0 = h.freqRadS_1 * x - h.phaseRad_1;
1180
1298
  power = tmp + tmp_0 * Math.cos(x_0);
1181
1299
  }
1182
1300
  }
1183
- path.e1v(pointIndex, power);
1184
- var powerNeeded = -PowerComputer_instance.g23(course, path, pointIndex, false);
1185
- path.f1v(pointIndex, powerNeeded);
1301
+ path.setPCyclistProvidedOptimalPowerWithHarmonics_tg3fol_k$(pointIndex, power);
1302
+ var powerNeeded = -PowerComputer_instance.getNewPower_puvq9i_k$(course, path, pointIndex, false);
1303
+ path.setPCyclistPowerNeeded_54po1x_k$(pointIndex, powerNeeded);
1186
1304
  return power;
1187
1305
  };
1188
1306
  function GravPowerProvider() {
1189
1307
  }
1190
- protoOf(GravPowerProvider).u22 = function (course, path, pointIndex) {
1191
- var m = course.f1z().j1z_1;
1192
- var grade = path.t1u(pointIndex);
1193
- var speed = path.m1v(pointIndex);
1308
+ protoOf(GravPowerProvider).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
1309
+ var m = course.get_cyclist_lkc0de_k$().massKg_1;
1310
+ var grade = path.grade_c4yjz5_k$(pointIndex);
1311
+ var speed = path.speed_npav2n_k$(pointIndex);
1194
1312
  var tmp = -m * 9.8 * speed;
1195
1313
  // Inline function 'kotlin.math.atan' call
1196
1314
  // Inline function 'kotlin.math.sin' call
1197
1315
  var x = Math.atan(grade);
1198
1316
  var p = tmp * Math.sin(x);
1199
- path.a1v(pointIndex, p);
1317
+ path.setPGravity_tegtcu_k$(pointIndex, p);
1200
1318
  return p;
1201
1319
  };
1202
1320
  var GravPowerProvider_instance;
@@ -1204,17 +1322,17 @@
1204
1322
  return GravPowerProvider_instance;
1205
1323
  }
1206
1324
  function Harmonic(freqRadS, phaseRad, amp) {
1207
- this.d23_1 = freqRadS;
1208
- this.e23_1 = phaseRad;
1209
- this.f23_1 = amp;
1325
+ this.freqRadS_1 = freqRadS;
1326
+ this.phaseRad_1 = phaseRad;
1327
+ this.amp_1 = amp;
1210
1328
  }
1211
1329
  protoOf(Harmonic).toString = function () {
1212
- return 'Harmonic(freqRadS=' + this.d23_1 + ', phaseRad=' + this.e23_1 + ', amp=' + this.f23_1 + ')';
1330
+ return 'Harmonic(freqRadS=' + this.freqRadS_1 + ', phaseRad=' + this.phaseRad_1 + ', amp=' + this.amp_1 + ')';
1213
1331
  };
1214
1332
  protoOf(Harmonic).hashCode = function () {
1215
- var result = getNumberHashCode(this.d23_1);
1216
- result = imul(result, 31) + getNumberHashCode(this.e23_1) | 0;
1217
- result = imul(result, 31) + getNumberHashCode(this.f23_1) | 0;
1333
+ var result = getNumberHashCode(this.freqRadS_1);
1334
+ result = imul(result, 31) + getNumberHashCode(this.phaseRad_1) | 0;
1335
+ result = imul(result, 31) + getNumberHashCode(this.amp_1) | 0;
1218
1336
  return result;
1219
1337
  };
1220
1338
  protoOf(Harmonic).equals = function (other) {
@@ -1222,39 +1340,39 @@
1222
1340
  return true;
1223
1341
  if (!(other instanceof Harmonic))
1224
1342
  return false;
1225
- if (!equals(this.d23_1, other.d23_1))
1343
+ if (!equals(this.freqRadS_1, other.freqRadS_1))
1226
1344
  return false;
1227
- if (!equals(this.e23_1, other.e23_1))
1345
+ if (!equals(this.phaseRad_1, other.phaseRad_1))
1228
1346
  return false;
1229
- if (!equals(this.f23_1, other.f23_1))
1347
+ if (!equals(this.amp_1, other.amp_1))
1230
1348
  return false;
1231
1349
  return true;
1232
1350
  };
1233
1351
  function computeCorneringLimit($this, course, currentIndex, window_0) {
1234
- var path = course.t1y_1;
1352
+ var path = course.path_1;
1235
1353
  var radius = computeRadiusWindowed($this, path, currentIndex, window_0);
1236
1354
  // Inline function 'kotlin.math.sqrt' call
1237
- var x = 9.8 * radius * course.u1y_1.p1z();
1355
+ var x = 9.8 * radius * course.cyclist_1.get_tanMaxLeanAngle_qqiag1_k$();
1238
1356
  var vMax = Math.sqrt(x);
1239
1357
  // Inline function 'kotlin.math.min' call
1240
- var a = course.u1y_1.r1z();
1358
+ var a = course.cyclist_1.get_maxSpeedMS_xz2r7y_k$();
1241
1359
  var result = Math.min(a, vMax);
1242
- path.q1v(currentIndex, result);
1360
+ path.setSpeedMaxIncline_8l69w1_k$(currentIndex, result);
1243
1361
  return result;
1244
1362
  }
1245
1363
  function computeRadiusWindowed($this, path, i, k) {
1246
1364
  // Inline function 'kotlin.math.max' call
1247
1365
  var b = i - k | 0;
1248
1366
  var mini = Math.max(0, b);
1249
- var tmp0 = path.u1q_1 - 1 | 0;
1367
+ var tmp0 = path.size_1 - 1 | 0;
1250
1368
  // Inline function 'kotlin.math.min' call
1251
1369
  var b_0 = i + k | 0;
1252
1370
  var maxi = Math.min(tmp0, b_0);
1253
- var totalBearingChange = $this.h23(path.r1u(maxi) - path.r1u(mini));
1254
- var totalDistance = path.k1u(maxi) - path.k1u(mini);
1371
+ var totalBearingChange = $this.normalizeAngleDiff_6gshzi_k$(path.bearing_fz5vxm_k$(maxi) - path.bearing_fz5vxm_k$(mini));
1372
+ var totalDistance = path.distance_5s4s77_k$(maxi) - path.distance_5s4s77_k$(mini);
1255
1373
  // Inline function 'kotlin.math.abs' call
1256
1374
  if (Math.abs(totalBearingChange) < 0.001) {
1257
- path.v1u(i, 200.0);
1375
+ path.setRadius_p1cueq_k$(i, 200.0);
1258
1376
  return 200.0;
1259
1377
  }
1260
1378
  // Inline function 'kotlin.math.abs' call
@@ -1263,47 +1381,47 @@
1263
1381
  // Inline function 'kotlin.math.max' call
1264
1382
  var b_1 = Math.min(200.0, raw);
1265
1383
  var clamped = Math.max(5.0, b_1);
1266
- path.v1u(i, clamped);
1384
+ path.setRadius_p1cueq_k$(i, clamped);
1267
1385
  return clamped;
1268
1386
  }
1269
1387
  function computeBrakingLimit($this, course, currentIndex, nextIndex) {
1270
- var path = course.t1y_1;
1271
- var vf = path.o1v(nextIndex);
1272
- var a = course.u1y_1.q1z();
1273
- var d = path.k1u(nextIndex) - path.k1u(currentIndex);
1388
+ var path = course.path_1;
1389
+ var vf = path.speedMax_mjo2cl_k$(nextIndex);
1390
+ var a = course.cyclist_1.get_maxBrakeMS2_nzouxw_k$();
1391
+ var d = path.distance_5s4s77_k$(nextIndex) - path.distance_5s4s77_k$(currentIndex);
1274
1392
  // Inline function 'kotlin.math.sqrt' call
1275
1393
  var x = vf * vf + 2.0 * a * d;
1276
1394
  return Math.sqrt(x);
1277
1395
  }
1278
1396
  function MaxSpeedComputer() {
1279
- this.o20_1 = 200.0;
1280
- this.p20_1 = 5.0;
1281
- this.q20_1 = 2.0;
1282
- this.r20_1 = 0.001;
1283
- this.s20_1 = 10;
1284
- }
1285
- protoOf(MaxSpeedComputer).t20 = function (course) {
1286
- var path = course.t1y_1;
1287
- var n = path.u1q_1;
1397
+ this.MAX_RADIUS_M_1 = 200.0;
1398
+ this.MIN_RADIUS_M_1 = 5.0;
1399
+ this.END_SPEED_MS_1 = 2.0;
1400
+ this.BEARING_THRESHOLD_1 = 0.001;
1401
+ this.DEFAULT_WINDOW_1 = 10;
1402
+ }
1403
+ protoOf(MaxSpeedComputer).computeMaxSpeeds_jc4v4o_k$ = function (course) {
1404
+ var path = course.path_1;
1405
+ var n = path.size_1;
1288
1406
  var inductionVariable = n - 1 | 0;
1289
1407
  if (0 <= inductionVariable)
1290
1408
  do {
1291
1409
  var i = inductionVariable;
1292
1410
  inductionVariable = inductionVariable + -1 | 0;
1293
1411
  if (i === (n - 1 | 0)) {
1294
- path.p1v(i, 2.0);
1412
+ path.setSpeedMax_7xvqir_k$(i, 2.0);
1295
1413
  } else {
1296
1414
  var cornering = computeCorneringLimit(this, course, i, 10);
1297
1415
  var braking = computeBrakingLimit(this, course, i, i + 1 | 0);
1298
1416
  // Inline function 'kotlin.math.min' call
1299
1417
  var tmp$ret$0 = Math.min(cornering, braking);
1300
- path.p1v(i, tmp$ret$0);
1418
+ path.setSpeedMax_7xvqir_k$(i, tmp$ret$0);
1301
1419
  }
1302
1420
  }
1303
1421
  while (0 <= inductionVariable);
1304
- path.e1s();
1422
+ path.computeDerivedData_uoxpeo_k$();
1305
1423
  };
1306
- protoOf(MaxSpeedComputer).h23 = function (angleIn) {
1424
+ protoOf(MaxSpeedComputer).normalizeAngleDiff_6gshzi_k$ = function (angleIn) {
1307
1425
  var a = angleIn;
1308
1426
  while (a > 3.141592653589793)
1309
1427
  a = a - 2.0 * 3.141592653589793;
@@ -1317,11 +1435,11 @@
1317
1435
  }
1318
1436
  function MuscularPowerProvider() {
1319
1437
  }
1320
- protoOf(MuscularPowerProvider).u22 = function (course, path, pointIndex) {
1321
- var muscular = course.d1z_1.u22(course, path, pointIndex);
1322
- path.g1v(pointIndex, muscular);
1323
- var wheel = muscular * course.g1z().r1y_1;
1324
- path.h1v(pointIndex, wheel);
1438
+ protoOf(MuscularPowerProvider).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
1439
+ var muscular = course.cyclistPowerProvider_1.powerAt_ejucaq_k$(course, path, pointIndex);
1440
+ path.setPCyclistProvidedMuscular_aori9q_k$(pointIndex, muscular);
1441
+ var wheel = muscular * course.get_bike_wojgoa_k$().efficiency_1;
1442
+ path.setPCyclistProvidedWheel_ofsihz_k$(pointIndex, wheel);
1325
1443
  return wheel;
1326
1444
  };
1327
1445
  var MuscularPowerProvider_instance;
@@ -1334,7 +1452,7 @@
1334
1452
  var tol = dx / 1.0E7;
1335
1453
  while (dt2 - dt1 >= tol) {
1336
1454
  var dtMid = (dt1 + dt2) / 2.0;
1337
- var dxMid = $this.i23(pSum, equivalentMass, currentSpeed, dtMid);
1455
+ var dxMid = $this.getDx_xtszre_k$(pSum, equivalentMass, currentSpeed, dtMid);
1338
1456
  if (dxMid < dx)
1339
1457
  dt1 = dtMid;
1340
1458
  else
@@ -1344,18 +1462,18 @@
1344
1462
  }
1345
1463
  function PowerComputer() {
1346
1464
  }
1347
- protoOf(PowerComputer).g23 = function (course, path, pointIndex, withCyclist) {
1465
+ protoOf(PowerComputer).getNewPower_puvq9i_k$ = function (course, path, pointIndex, withCyclist) {
1348
1466
  var pSum = 0.0;
1349
- pSum = pSum + WheelBearingsPowerProvider_instance.u22(course, path, pointIndex);
1350
- pSum = pSum + RollingResistancePowerProvider_instance.u22(course, path, pointIndex);
1351
- pSum = pSum + AeroPowerProvider_instance.u22(course, path, pointIndex);
1352
- pSum = pSum + GravPowerProvider_instance.u22(course, path, pointIndex);
1467
+ pSum = pSum + WheelBearingsPowerProvider_instance.powerAt_ejucaq_k$(course, path, pointIndex);
1468
+ pSum = pSum + RollingResistancePowerProvider_instance.powerAt_ejucaq_k$(course, path, pointIndex);
1469
+ pSum = pSum + AeroPowerProvider_instance.powerAt_ejucaq_k$(course, path, pointIndex);
1470
+ pSum = pSum + GravPowerProvider_instance.powerAt_ejucaq_k$(course, path, pointIndex);
1353
1471
  if (withCyclist) {
1354
- pSum = pSum + MuscularPowerProvider_instance.u22(course, path, pointIndex);
1472
+ pSum = pSum + MuscularPowerProvider_instance.powerAt_ejucaq_k$(course, path, pointIndex);
1355
1473
  }
1356
1474
  return pSum;
1357
1475
  };
1358
- protoOf(PowerComputer).i23 = function (pSum, equivalentMass, currentSpeed, dt) {
1476
+ protoOf(PowerComputer).getDx_xtszre_k$ = function (pSum, equivalentMass, currentSpeed, dt) {
1359
1477
  // Inline function 'kotlin.math.sqrt' call
1360
1478
  var x = dt * pSum / (0.5 * equivalentMass) + currentSpeed * currentSpeed;
1361
1479
  var tmp0 = Math.sqrt(x);
@@ -1364,40 +1482,40 @@
1364
1482
  var newSpeed = Math.max(tmp0, b);
1365
1483
  return (currentSpeed + newSpeed) * dt / 2.0;
1366
1484
  };
1367
- protoOf(PowerComputer).j23 = function (equivalentMass, s1, s2, dt) {
1485
+ protoOf(PowerComputer).getTotPower_kfbciq_k$ = function (equivalentMass, s1, s2, dt) {
1368
1486
  return 0.5 * equivalentMass * (s2 * s2 - s1 * s1) / dt;
1369
1487
  };
1370
- protoOf(PowerComputer).k23 = function (pSum, equivalentMass, currentSpeed, dx) {
1488
+ protoOf(PowerComputer).getDt_t0pcee_k$ = function (pSum, equivalentMass, currentSpeed, dx) {
1371
1489
  var dt = 0.1;
1372
- while (this.i23(pSum, equivalentMass, currentSpeed, dt) <= dx) {
1490
+ while (this.getDx_xtszre_k$(pSum, equivalentMass, currentSpeed, dt) <= dx) {
1373
1491
  dt = dt + 0.1;
1374
1492
  }
1375
1493
  return getDtInner(this, pSum, equivalentMass, currentSpeed, dx, dt - 0.1, dt);
1376
1494
  };
1377
- protoOf(PowerComputer).l23 = function (course, path, equivalentMass, i) {
1495
+ protoOf(PowerComputer).computeCyclistPower_kgcsa3_k$ = function (course, path, equivalentMass, i) {
1378
1496
  if (i === 0) {
1379
- path.l1v(i, 0.0);
1497
+ path.setPComputedPower_c3m6yw_k$(i, 0.0);
1380
1498
  return Unit_instance;
1381
1499
  }
1382
- var resistive = this.g23(course, path, i - 1 | 0, false);
1383
- var s1 = path.m1v(i - 1 | 0);
1384
- var s2 = path.m1v(i);
1385
- var dtSeconds = path.p1u(i) / 1000.0;
1386
- var totPower = this.j23(equivalentMass, s1, s2, dtSeconds);
1387
- path.i1v(i, totPower);
1500
+ var resistive = this.getNewPower_puvq9i_k$(course, path, i - 1 | 0, false);
1501
+ var s1 = path.speed_npav2n_k$(i - 1 | 0);
1502
+ var s2 = path.speed_npav2n_k$(i);
1503
+ var dtSeconds = path.dt_17uzp4_k$(i) / 1000.0;
1504
+ var totPower = this.getTotPower_kfbciq_k$(equivalentMass, s1, s2, dtSeconds);
1505
+ path.setPComputedTotalPower_wm6di_k$(i, totPower);
1388
1506
  var powerWheel = totPower - resistive;
1389
- path.j1v(i, powerWheel);
1507
+ path.setPComputedWheelPower_qplog3_k$(i, powerWheel);
1390
1508
  // Inline function 'kotlin.math.max' call
1391
- var computed = Math.max(0.0, powerWheel) / course.g1z().r1y_1;
1392
- path.l1v(i, computed);
1509
+ var computed = Math.max(0.0, powerWheel) / course.get_bike_wojgoa_k$().efficiency_1;
1510
+ path.setPComputedPower_c3m6yw_k$(i, computed);
1393
1511
  };
1394
- protoOf(PowerComputer).m23 = function (course) {
1395
- var m = course.u1y_1.j1z_1;
1396
- var totalInertia = course.v1y_1.o1y_1 + course.v1y_1.p1y_1;
1397
- return m + totalInertia / (course.v1y_1.q1y_1 * course.v1y_1.q1y_1);
1512
+ protoOf(PowerComputer).equivalentMass_3uxz65_k$ = function (course) {
1513
+ var m = course.cyclist_1.massKg_1;
1514
+ var totalInertia = course.bike_1.inertiaFront_1 + course.bike_1.inertiaRear_1;
1515
+ return m + totalInertia / (course.bike_1.wheelRadiusM_1 * course.bike_1.wheelRadiusM_1);
1398
1516
  };
1399
- protoOf(PowerComputer).n23 = function (course) {
1400
- return this.m23(course.z1y_1);
1517
+ protoOf(PowerComputer).equivalentMass_e3djhu_k$ = function (course) {
1518
+ return this.equivalentMass_3uxz65_k$(course.course_1);
1401
1519
  };
1402
1520
  var PowerComputer_instance;
1403
1521
  function PowerComputer_getInstance() {
@@ -1407,34 +1525,34 @@
1407
1525
  useHarmonics = useHarmonics === VOID ? false : useHarmonics;
1408
1526
  random = random === VOID ? Default_getInstance() : random;
1409
1527
  CyclistPowerProviderBase.call(this, useHarmonics, random);
1410
- this.q23_1 = power;
1528
+ this.power_1 = power;
1411
1529
  }
1412
- protoOf(PowerProviderConstant).c23 = function (course, path, pointIndex) {
1413
- return this.q23_1;
1530
+ protoOf(PowerProviderConstant).optimalPower_36kg19_k$ = function (course, path, pointIndex) {
1531
+ return this.power_1;
1414
1532
  };
1415
1533
  function PowerProviderConstantWithTiring(power, useHarmonics, durationSeconds, random) {
1416
1534
  useHarmonics = useHarmonics === VOID ? false : useHarmonics;
1417
1535
  random = random === VOID ? Default_getInstance() : random;
1418
1536
  CyclistPowerProviderBase.call(this, useHarmonics, random);
1419
- this.t23_1 = power;
1420
- this.u23_1 = durationSeconds;
1537
+ this.power_1 = power;
1538
+ this.durationSeconds_1 = durationSeconds;
1421
1539
  // Inline function 'kotlin.require' call
1422
- if (!(this.u23_1 > 0.0)) {
1423
- var message = 'durationSeconds must be > 0, got ' + this.u23_1;
1540
+ if (!(this.durationSeconds_1 > 0.0)) {
1541
+ var message = 'durationSeconds must be > 0, got ' + this.durationSeconds_1;
1424
1542
  throw IllegalArgumentException_init_$Create$(toString(message));
1425
1543
  }
1426
1544
  }
1427
- protoOf(PowerProviderConstantWithTiring).c23 = function (course, path, pointIndex) {
1428
- var elapsedS = path.n1u(pointIndex) / 1000.0;
1545
+ protoOf(PowerProviderConstantWithTiring).optimalPower_36kg19_k$ = function (course, path, pointIndex) {
1546
+ var elapsedS = path.elapsed_7307rw_k$(pointIndex) / 1000.0;
1429
1547
  // Inline function 'kotlin.math.max' call
1430
- var b = 1.0 - 0.6 * elapsedS / this.u23_1;
1548
+ var b = 1.0 - 0.6 * elapsedS / this.durationSeconds_1;
1431
1549
  var c = Math.max(0.5, b);
1432
- return this.t23_1 * c;
1550
+ return this.power_1 * c;
1433
1551
  };
1434
1552
  function PowerProviderFromData() {
1435
1553
  }
1436
- protoOf(PowerProviderFromData).u22 = function (course, path, pointIndex) {
1437
- return path.d1r(pointIndex);
1554
+ protoOf(PowerProviderFromData).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
1555
+ return path.pInputPower_ybhudp_k$(pointIndex);
1438
1556
  };
1439
1557
  var PowerProviderFromData_instance;
1440
1558
  function PowerProviderFromData_getInstance() {
@@ -1442,7 +1560,7 @@
1442
1560
  }
1443
1561
  function RhoProviderDefault() {
1444
1562
  }
1445
- protoOf(RhoProviderDefault).x22 = function (course, path, pointIndex) {
1563
+ protoOf(RhoProviderDefault).rho_pwqvzi_k$ = function (course, path, pointIndex) {
1446
1564
  return 1.225;
1447
1565
  };
1448
1566
  var RhoProviderDefault_instance;
@@ -1450,16 +1568,16 @@
1450
1568
  return RhoProviderDefault_instance;
1451
1569
  }
1452
1570
  function RhoProviderEstimate() {
1453
- this.v23_1 = 101325.0;
1454
- this.w23_1 = 288.15;
1455
- this.x23_1 = 9.80665;
1456
- this.y23_1 = 0.0065;
1457
- this.z23_1 = 287.05;
1458
- }
1459
- protoOf(RhoProviderEstimate).x22 = function (course, path, pointIndex) {
1460
- var providedTemp = path.m1t(pointIndex, PointField_TEMPERATURE_getInstance());
1571
+ this.P0__1 = 101325.0;
1572
+ this.T0__1 = 288.15;
1573
+ this.G_ISA_1 = 9.80665;
1574
+ this.L_1 = 0.0065;
1575
+ this.R_1 = 287.05;
1576
+ }
1577
+ protoOf(RhoProviderEstimate).rho_pwqvzi_k$ = function (course, path, pointIndex) {
1578
+ var providedTemp = path.get_z3le6l_k$(pointIndex, PointField_TEMPERATURE_getInstance());
1461
1579
  var temperatureC = isNaN_0(providedTemp) ? 15.0 : providedTemp;
1462
- var providedElevation = path.y1q(pointIndex);
1580
+ var providedElevation = path.elevation_iziwkb_k$(pointIndex);
1463
1581
  var altitude = isNaN_0(providedElevation) ? 0.0 : providedElevation;
1464
1582
  var tKelvin = temperatureC + 273.15;
1465
1583
  var tmp0 = 1.0 - 0.0065 * altitude / 288.15;
@@ -1474,17 +1592,17 @@
1474
1592
  }
1475
1593
  function RollingResistancePowerProvider() {
1476
1594
  }
1477
- protoOf(RollingResistancePowerProvider).u22 = function (course, path, pointIndex) {
1478
- var m = course.f1z().j1z_1;
1479
- var crr = course.g1z().n1y_1;
1480
- var grade = path.t1u(pointIndex);
1481
- var speed = path.m1v(pointIndex);
1595
+ protoOf(RollingResistancePowerProvider).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
1596
+ var m = course.get_cyclist_lkc0de_k$().massKg_1;
1597
+ var crr = course.get_bike_wojgoa_k$().crr_1;
1598
+ var grade = path.grade_c4yjz5_k$(pointIndex);
1599
+ var speed = path.speed_npav2n_k$(pointIndex);
1482
1600
  // Inline function 'kotlin.math.atan' call
1483
1601
  // Inline function 'kotlin.math.cos' call
1484
1602
  var x = Math.atan(grade);
1485
1603
  var coef = Math.cos(x);
1486
1604
  var p = -coef * m * 9.8 * speed * crr;
1487
- path.b1v(pointIndex, p);
1605
+ path.setPRollingResistance_h04uz6_k$(pointIndex, p);
1488
1606
  return p;
1489
1607
  };
1490
1608
  var RollingResistancePowerProvider_instance;
@@ -1492,18 +1610,18 @@
1492
1610
  return RollingResistancePowerProvider_instance;
1493
1611
  }
1494
1612
  function copyAllFields($this, src, i, dst, j) {
1495
- var _iterator__ex2g4s = get_entries().i();
1496
- while (_iterator__ex2g4s.j()) {
1497
- var field = _iterator__ex2g4s.k();
1498
- dst.t1t(j, field, src.m1t(i, field));
1613
+ var _iterator__ex2g4s = get_entries().iterator_jk1svi_k$();
1614
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1615
+ var field = _iterator__ex2g4s.next_20eer_k$();
1616
+ dst.set_b3ze83_k$(j, field, src.get_z3le6l_k$(i, field));
1499
1617
  }
1500
1618
  }
1501
1619
  function VirtualizeService() {
1502
- this.u20_1 = 100000;
1620
+ this.MAX_ITERATIONS_1 = 100000;
1503
1621
  }
1504
- protoOf(VirtualizeService).v20 = function (course) {
1505
- var input = course.e1z();
1506
- var n = input.u1q_1;
1622
+ protoOf(VirtualizeService).virtualizeTrack_tp3afi_k$ = function (course) {
1623
+ var input = course.get_path_wos8ry_k$();
1624
+ var n = input.size_1;
1507
1625
  if (n === 0)
1508
1626
  return new Path(0);
1509
1627
  if (n === 1) {
@@ -1511,54 +1629,54 @@
1511
1629
  copyAllFields(this, input, 0, singleton, 0);
1512
1630
  return singleton;
1513
1631
  }
1514
- var mEq = PowerComputer_instance.n23(course);
1632
+ var mEq = PowerComputer_instance.equivalentMass_e3djhu_k$(course);
1515
1633
  var out = new Path(n);
1516
1634
  copyAllFields(this, input, 0, out, 0);
1517
1635
  var speed = 0.5555555555555556;
1518
1636
  var startTimeMs = 0.0;
1519
1637
  var timeMs = startTimeMs;
1520
- out.q1r(0, timeMs);
1521
- out.o1u(0, 0.0);
1522
- out.n1v(0, speed);
1523
- out.r1v(0, speed);
1638
+ out.setTime_rfmvcd_k$(0, timeMs);
1639
+ out.setElapsed_916ug_k$(0, 0.0);
1640
+ out.setSpeed_1slan1_k$(0, speed);
1641
+ out.setVirtSpeedCurrent_kvg8yv_k$(0, speed);
1524
1642
  var i = 1;
1525
1643
  var iter = 0;
1526
1644
  $l$loop: while (i < n) {
1527
- var dx = input.k1u(i) - input.k1u(i - 1 | 0);
1528
- var pSum = PowerComputer_instance.g23(course, out, i - 1 | 0, true);
1529
- var dt = PowerComputer_instance.k23(pSum, mEq, speed, dx);
1645
+ var dx = input.distance_5s4s77_k$(i) - input.distance_5s4s77_k$(i - 1 | 0);
1646
+ var pSum = PowerComputer_instance.getNewPower_puvq9i_k$(course, out, i - 1 | 0, true);
1647
+ var dt = PowerComputer_instance.getDt_t0pcee_k$(pSum, mEq, speed, dx);
1530
1648
  var speedNew = 2.0 * dx / dt - speed;
1531
1649
  copyAllFields(this, input, i, out, i);
1532
- var speedMax = input.o1v(i);
1650
+ var speedMax = input.speedMax_mjo2cl_k$(i);
1533
1651
  if (speedNew > speedMax) {
1534
1652
  speedNew = speedMax;
1535
1653
  dt = 2.0 * dx / (speedNew + speed);
1536
1654
  }
1537
1655
  speed = speedNew;
1538
1656
  timeMs = timeMs + dt * 1000.0;
1539
- out.q1r(i, timeMs);
1540
- out.o1u(i, timeMs - startTimeMs);
1541
- out.m1u(i, dx);
1542
- out.q1u(i, dt * 1000.0);
1543
- out.n1v(i, speed);
1544
- out.r1v(i, speed);
1657
+ out.setTime_rfmvcd_k$(i, timeMs);
1658
+ out.setElapsed_916ug_k$(i, timeMs - startTimeMs);
1659
+ out.setDx_uk0ky4_k$(i, dx);
1660
+ out.setDt_sgarxs_k$(i, dt * 1000.0);
1661
+ out.setSpeed_1slan1_k$(i, speed);
1662
+ out.setVirtSpeedCurrent_kvg8yv_k$(i, speed);
1545
1663
  i = i + 1 | 0;
1546
1664
  var _unary__edvuaz = iter;
1547
1665
  iter = _unary__edvuaz + 1 | 0;
1548
1666
  if (_unary__edvuaz > 100000)
1549
1667
  break $l$loop;
1550
1668
  }
1551
- var progression = out.z1v();
1552
- var inductionVariable = progression.lc_1;
1553
- var last = progression.mc_1;
1669
+ var progression = out.get_indices_xelk8u_k$();
1670
+ var inductionVariable = progression.first_1;
1671
+ var last = progression.last_1;
1554
1672
  if (inductionVariable <= last)
1555
1673
  do {
1556
1674
  var j = inductionVariable;
1557
1675
  inductionVariable = inductionVariable + 1 | 0;
1558
- PowerComputer_instance.l23(course, out, mEq, j);
1676
+ PowerComputer_instance.computeCyclistPower_kgcsa3_k$(course, out, mEq, j);
1559
1677
  }
1560
1678
  while (!(j === last));
1561
- out.e1s();
1679
+ out.computeDerivedData_uoxpeo_k$();
1562
1680
  return out;
1563
1681
  };
1564
1682
  var VirtualizeService_instance;
@@ -1567,10 +1685,10 @@
1567
1685
  }
1568
1686
  function WheelBearingsPowerProvider() {
1569
1687
  }
1570
- protoOf(WheelBearingsPowerProvider).u22 = function (course, path, pointIndex) {
1571
- var speed = path.m1v(pointIndex);
1688
+ protoOf(WheelBearingsPowerProvider).powerAt_ejucaq_k$ = function (course, path, pointIndex) {
1689
+ var speed = path.speed_npav2n_k$(pointIndex);
1572
1690
  var p = -speed * (91.0 + 8.7 * speed) / 1000.0;
1573
- path.c1v(pointIndex, p);
1691
+ path.setPWheelBearings_djmhww_k$(pointIndex, p);
1574
1692
  return p;
1575
1693
  };
1576
1694
  var WheelBearingsPowerProvider_instance;
@@ -1579,25 +1697,25 @@
1579
1697
  }
1580
1698
  function Companion_6() {
1581
1699
  Companion_instance_6 = this;
1582
- this.a24_1 = new Wind(0.0, 0.0);
1700
+ this.NONE_1 = new Wind(0.0, 0.0);
1583
1701
  }
1584
1702
  var Companion_instance_6;
1585
- function Companion_getInstance_8() {
1703
+ function Companion_getInstance_9() {
1586
1704
  if (Companion_instance_6 == null)
1587
1705
  new Companion_6();
1588
1706
  return Companion_instance_6;
1589
1707
  }
1590
1708
  function Wind(speedMS, directionRad) {
1591
- Companion_getInstance_8();
1592
- this.r22_1 = speedMS;
1593
- this.s22_1 = directionRad;
1709
+ Companion_getInstance_9();
1710
+ this.speedMS_1 = speedMS;
1711
+ this.directionRad_1 = directionRad;
1594
1712
  }
1595
1713
  protoOf(Wind).toString = function () {
1596
- return 'Wind(speedMS=' + this.r22_1 + ', directionRad=' + this.s22_1 + ')';
1714
+ return 'Wind(speedMS=' + this.speedMS_1 + ', directionRad=' + this.directionRad_1 + ')';
1597
1715
  };
1598
1716
  protoOf(Wind).hashCode = function () {
1599
- var result = getNumberHashCode(this.r22_1);
1600
- result = imul(result, 31) + getNumberHashCode(this.s22_1) | 0;
1717
+ var result = getNumberHashCode(this.speedMS_1);
1718
+ result = imul(result, 31) + getNumberHashCode(this.directionRad_1) | 0;
1601
1719
  return result;
1602
1720
  };
1603
1721
  protoOf(Wind).equals = function (other) {
@@ -1605,55 +1723,65 @@
1605
1723
  return true;
1606
1724
  if (!(other instanceof Wind))
1607
1725
  return false;
1608
- if (!equals(this.r22_1, other.r22_1))
1726
+ if (!equals(this.speedMS_1, other.speedMS_1))
1609
1727
  return false;
1610
- if (!equals(this.s22_1, other.s22_1))
1728
+ if (!equals(this.directionRad_1, other.directionRad_1))
1611
1729
  return false;
1612
1730
  return true;
1613
1731
  };
1614
1732
  function WindProviderNone() {
1615
1733
  }
1616
- protoOf(WindProviderNone).w22 = function (course, path, pointIndex) {
1617
- return Companion_getInstance_8().a24_1;
1734
+ protoOf(WindProviderNone).wind_umf2tf_k$ = function (course, path, pointIndex) {
1735
+ return Companion_getInstance_9().NONE_1;
1618
1736
  };
1619
1737
  var WindProviderNone_instance;
1620
1738
  function WindProviderNone_getInstance() {
1621
1739
  return WindProviderNone_instance;
1622
1740
  }
1623
1741
  function WindProviderConstant(wind) {
1624
- this.b24_1 = wind;
1742
+ this.wind_1 = wind;
1625
1743
  }
1626
- protoOf(WindProviderConstant).w22 = function (course, path, pointIndex) {
1627
- return this.b24_1;
1744
+ protoOf(WindProviderConstant).wind_umf2tf_k$ = function (course, path, pointIndex) {
1745
+ return this.wind_1;
1628
1746
  };
1629
1747
  function parseGpxWaypoints(xml) {
1630
1748
  // Inline function 'kotlin.collections.map' call
1631
- var this_0 = GpxParser_instance.m1r(xml).e1q_1;
1749
+ var this_0 = GpxParser_instance.parse$default_ez0f31_k$(xml).waypoints_1;
1632
1750
  // Inline function 'kotlin.collections.mapTo' call
1633
1751
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1634
- var _iterator__ex2g4s = this_0.i();
1635
- while (_iterator__ex2g4s.j()) {
1636
- var item = _iterator__ex2g4s.k();
1752
+ var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
1753
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1754
+ var item = _iterator__ex2g4s.next_20eer_k$();
1637
1755
  var tmp$ret$2 = waypointObj(item);
1638
- destination.h(tmp$ret$2);
1756
+ destination.add_utx5q5_k$(tmp$ret$2);
1639
1757
  }
1640
1758
  // Inline function 'kotlin.collections.toTypedArray' call
1641
1759
  return copyToArray(destination);
1642
1760
  }
1643
1761
  function parseGpx(xml) {
1644
- return firstTrackAsPath(GpxParser_instance.m1r(xml));
1762
+ return firstTrackAsPath(GpxParser_instance.parse$default_ez0f31_k$(xml));
1645
1763
  }
1646
1764
  function parseGpxTracks(xml) {
1647
1765
  // Inline function 'kotlin.collections.toTypedArray' call
1648
- var this_0 = tracksAsPaths(GpxParser_instance.m1r(xml));
1766
+ var this_0 = tracksAsPaths(GpxParser_instance.parse$default_ez0f31_k$(xml));
1649
1767
  return copyToArray(this_0);
1650
1768
  }
1651
1769
  function parseGpxSegments(xml) {
1652
1770
  // Inline function 'kotlin.collections.toTypedArray' call
1653
- var this_0 = segmentsAsPaths(GpxParser_instance.m1r(xml));
1771
+ var this_0 = segmentsAsPaths(GpxParser_instance.parse$default_ez0f31_k$(xml));
1772
+ return copyToArray(this_0);
1773
+ }
1774
+ function parseGpxTracksOnly(xml) {
1775
+ // Inline function 'kotlin.collections.toTypedArray' call
1776
+ var this_0 = tracksAsPaths(GpxParser_instance.parse$default_ez0f31_k$(xml), setOf(GpxPathKind_TRACK_getInstance()));
1654
1777
  return copyToArray(this_0);
1655
1778
  }
1656
- function writeGpxTracks(paths, waypoints) {
1779
+ function parseGpxRoutesOnly(xml) {
1780
+ // Inline function 'kotlin.collections.toTypedArray' call
1781
+ var this_0 = tracksAsPaths(GpxParser_instance.parse$default_ez0f31_k$(xml), setOf(GpxPathKind_ROUTE_getInstance()));
1782
+ return copyToArray(this_0);
1783
+ }
1784
+ function writeGpxTracks(paths, waypoints, writeExtensions) {
1657
1785
  var tmp;
1658
1786
  if (waypoints === VOID) {
1659
1787
  // Inline function 'kotlin.emptyArray' call
@@ -1662,6 +1790,7 @@
1662
1790
  tmp = waypoints;
1663
1791
  }
1664
1792
  waypoints = tmp;
1793
+ writeExtensions = writeExtensions === VOID ? true : writeExtensions;
1665
1794
  var tmp_0 = GpxWriter_instance;
1666
1795
  var tmp_1 = toList(paths);
1667
1796
  // Inline function 'kotlin.collections.map' call
@@ -1673,33 +1802,35 @@
1673
1802
  var item = waypoints[inductionVariable];
1674
1803
  inductionVariable = inductionVariable + 1 | 0;
1675
1804
  var tmp$ret$3 = toGpxWaypoint(item);
1676
- destination.h(tmp$ret$3);
1805
+ destination.add_utx5q5_k$(tmp$ret$3);
1677
1806
  }
1678
- return tmp_0.o1s(tmp_1, VOID, VOID, destination);
1807
+ return tmp_0.write$default_koqy5u_k$(tmp_1, VOID, VOID, destination, VOID, writeExtensions);
1679
1808
  }
1680
1809
  function pathSize(path) {
1681
- return path.u1q_1;
1810
+ return path.size_1;
1682
1811
  }
1683
1812
  function pathTotalDistance(path) {
1684
- return path.x1r_1;
1813
+ return path.totalDistance_1;
1685
1814
  }
1686
1815
  function pathDurationMs(path) {
1687
- return path.c1s_1;
1816
+ return path.durationMs_1;
1688
1817
  }
1689
1818
  function pathElevationGain(path) {
1690
- return path.a1s_1;
1819
+ return path.elevationGain_1;
1691
1820
  }
1692
1821
  function pathElevationLoss(path) {
1693
- return path.b1s_1;
1822
+ return path.elevationLoss_1;
1694
1823
  }
1695
1824
  function pointAt(path, i) {
1696
- return pointObj(path.a1w(i), path.b1w(i), path.y1q(i), path.z1q(i), path.m1v(i), path.k1v(i), path.k1u(i), path.t1u(i));
1825
+ return pointObj(path.latitudeDeg_i25sm6_k$(i), path.longitudeDeg_ikk1un_k$(i), path.elevation_iziwkb_k$(i), path.time_ryc845_k$(i), path.speed_npav2n_k$(i), path.pComputedPower_g6dnn4_k$(i), path.distance_5s4s77_k$(i), path.grade_c4yjz5_k$(i));
1697
1826
  }
1698
- function writeGpx(path) {
1699
- return GpxWriter_instance.m1s(toGpxDocument(path, VOID, 'virtualized'));
1827
+ function writeGpx(path, writeExtensions) {
1828
+ writeExtensions = writeExtensions === VOID ? true : writeExtensions;
1829
+ return GpxWriter_instance.write_7y52k2_k$(toGpxDocument(path, VOID, 'virtualized'), writeExtensions);
1700
1830
  }
1701
- function writeGpxAt(path, startTimeEpochMs) {
1702
- return GpxWriter_instance.m1s(toGpxDocument(path, VOID, 'virtualized', Companion_getInstance().nd(numberToLong(startTimeEpochMs))));
1831
+ function writeGpxAt(path, startTimeEpochMs, writeExtensions) {
1832
+ writeExtensions = writeExtensions === VOID ? true : writeExtensions;
1833
+ return GpxWriter_instance.write_7y52k2_k$(toGpxDocument(path, VOID, 'virtualized', Companion_getInstance().fromEpochMilliseconds_uaz65_k$(numberToLong(startTimeEpochMs))), writeExtensions);
1703
1834
  }
1704
1835
  function enhance(path, options) {
1705
1836
  var tmp = GlobalScope_instance;
@@ -1710,7 +1841,7 @@
1710
1841
  return promise(tmp, VOID, VOID, enhanceWithCourse$slambda_0(options, path, cyclist, bike, wind, power, null));
1711
1842
  }
1712
1843
  function getField(path, i, fieldProp) {
1713
- var tmp0_elvis_lhs = Companion_getInstance_0().g1w(fieldProp);
1844
+ var tmp0_elvis_lhs = Companion_getInstance_0().byProp_kdf1eo_k$(fieldProp);
1714
1845
  var tmp;
1715
1846
  if (tmp0_elvis_lhs == null) {
1716
1847
  // Inline function 'kotlin.error' call
@@ -1720,35 +1851,35 @@
1720
1851
  tmp = tmp0_elvis_lhs;
1721
1852
  }
1722
1853
  var field = tmp;
1723
- return path.m1t(i, field);
1854
+ return path.get_z3le6l_k$(i, field);
1724
1855
  }
1725
1856
  function fieldDefinitions() {
1726
1857
  // Inline function 'kotlin.collections.map' call
1727
1858
  var this_0 = get_entries();
1728
1859
  // Inline function 'kotlin.collections.mapTo' call
1729
1860
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1730
- var _iterator__ex2g4s = this_0.i();
1731
- while (_iterator__ex2g4s.j()) {
1732
- var item = _iterator__ex2g4s.k();
1861
+ var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
1862
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1863
+ var item = _iterator__ex2g4s.next_20eer_k$();
1733
1864
  var o = {};
1734
- o.prop = item.a1t_1;
1735
- o.unit = item.b1t_1;
1736
- o.shortDescription = item.c1t_1;
1737
- o.categoryId = item.d1t_1.j1w_1;
1738
- o.categoryName = item.d1t_1.k1w_1;
1739
- o.notSelectable = item.e1t_1;
1740
- o.anglesInRadians = item.f1t_1;
1865
+ o.prop = item.prop_1;
1866
+ o.unit = item.unit_1;
1867
+ o.shortDescription = item.shortDescription_1;
1868
+ o.categoryId = item.category_1.id_1;
1869
+ o.categoryName = item.category_1.displayName_1;
1870
+ o.notSelectable = item.notSelectable_1;
1871
+ o.anglesInRadians = item.anglesInRadians_1;
1741
1872
  // Inline function 'kotlin.js.unsafeCast' call
1742
- destination.h(o);
1873
+ destination.add_utx5q5_k$(o);
1743
1874
  }
1744
1875
  // Inline function 'kotlin.collections.toTypedArray' call
1745
1876
  return copyToArray(destination);
1746
1877
  }
1747
1878
  function pathLatitudeDeg(path, i) {
1748
- return path.a1w(i);
1879
+ return path.latitudeDeg_i25sm6_k$(i);
1749
1880
  }
1750
1881
  function pathLongitudeDeg(path, i) {
1751
- return path.b1w(i);
1882
+ return path.longitudeDeg_ikk1un_k$(i);
1752
1883
  }
1753
1884
  function pathToCsv(path, separator, unitsInHeader) {
1754
1885
  var tmp = CsvWriter_instance;
@@ -1760,52 +1891,68 @@
1760
1891
  } else {
1761
1892
  tmp_0 = tmp0_elvis_lhs;
1762
1893
  }
1763
- return tmp.l1t(path, new CsvOptions(VOID, tmp_0, unitsInHeader));
1894
+ return tmp.write_p5vnh4_k$(path, new CsvOptions(VOID, tmp_0, unitsInHeader));
1764
1895
  }
1765
1896
  function pathToJson(path, pretty) {
1766
- return JsonWriter_instance.s1t(path, new JsonOptions(VOID, pretty));
1897
+ return JsonWriter_instance.write_lwqeog_k$(path, new JsonOptions(VOID, pretty));
1767
1898
  }
1768
1899
  function pathToFit(path, name, startTimeEpochMs) {
1769
- return toFitBytes(path, name, Companion_getInstance().nd(numberToLong(startTimeEpochMs)));
1900
+ return toFitBytes(path, name, Companion_getInstance().fromEpochMilliseconds_uaz65_k$(numberToLong(startTimeEpochMs)));
1901
+ }
1902
+ function pathsToFit(paths, name, startTimeEpochMs, interPathGapMs) {
1903
+ interPathGapMs = interPathGapMs === VOID ? 0.0 : interPathGapMs;
1904
+ var tmp = toList(paths);
1905
+ var tmp_0 = Companion_getInstance().fromEpochMilliseconds_uaz65_k$(numberToLong(startTimeEpochMs));
1906
+ Companion_getInstance_1();
1907
+ // Inline function 'kotlin.time.Companion.milliseconds' call
1908
+ var this_0 = numberToLong(interPathGapMs);
1909
+ var tmp$ret$0 = toDuration(this_0, DurationUnit_MILLISECONDS_getInstance());
1910
+ return toFitBytes_0(tmp, name, tmp_0, VOID, tmp$ret$0);
1911
+ }
1912
+ function dominantHeadwindAzimuth(path) {
1913
+ return dominantHeadwindAzimuthDeg(path);
1914
+ }
1915
+ function dominantHeadwindAzimuthOfTracks(paths) {
1916
+ return dominantHeadwindAzimuthDeg_0(toList(paths));
1770
1917
  }
1771
1918
  function detectClimbs(path) {
1772
1919
  // Inline function 'kotlin.collections.map' call
1773
- var this_0 = ClimbDetector_instance.q22(path);
1920
+ var this_0 = ClimbDetector_instance.detect$default_6ml3ny_k$(path);
1774
1921
  // Inline function 'kotlin.collections.mapTo' call
1775
1922
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1776
- var _iterator__ex2g4s = this_0.i();
1777
- while (_iterator__ex2g4s.j()) {
1778
- var item = _iterator__ex2g4s.k();
1923
+ var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
1924
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1925
+ var item = _iterator__ex2g4s.next_20eer_k$();
1779
1926
  var tmp$ret$2 = toDto_0(item);
1780
- destination.h(tmp$ret$2);
1927
+ destination.add_utx5q5_k$(tmp$ret$2);
1781
1928
  }
1782
1929
  // Inline function 'kotlin.collections.toTypedArray' call
1783
1930
  return copyToArray(destination);
1784
1931
  }
1785
1932
  function detectClimbsWithOptions(path, minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGrade, booster) {
1786
1933
  // Inline function 'kotlin.collections.map' call
1787
- var this_0 = ClimbDetector_instance.p22(path, new ClimbOptions(minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGrade, booster));
1934
+ var this_0 = ClimbDetector_instance.detect_llooq2_k$(path, new ClimbOptions(minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGrade, booster));
1788
1935
  // Inline function 'kotlin.collections.mapTo' call
1789
1936
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1790
- var _iterator__ex2g4s = this_0.i();
1791
- while (_iterator__ex2g4s.j()) {
1792
- var item = _iterator__ex2g4s.k();
1937
+ var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
1938
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1939
+ var item = _iterator__ex2g4s.next_20eer_k$();
1793
1940
  var tmp$ret$2 = toDto_0(item);
1794
- destination.h(tmp$ret$2);
1941
+ destination.add_utx5q5_k$(tmp$ret$2);
1795
1942
  }
1796
1943
  // Inline function 'kotlin.collections.toTypedArray' call
1797
1944
  return copyToArray(destination);
1798
1945
  }
1799
1946
  function waypointObj(w) {
1800
1947
  var o = {};
1801
- o.latitudeDeg = w.u1p_1;
1802
- o.longitudeDeg = w.v1p_1;
1803
- o.elevationM = w.w1p_1;
1804
- o.name = w.x1p_1;
1805
- o.description = w.y1p_1;
1806
- o.symbol = w.z1p_1;
1807
- o.type = w.a1q_1;
1808
- var tmp0_safe_receiver = w.b1q_1;
1948
+ o.latitudeDeg = w.latitudeDeg_1;
1949
+ o.longitudeDeg = w.longitudeDeg_1;
1950
+ o.elevationM = w.elevationM_1;
1951
+ o.name = w.name_1;
1952
+ o.description = w.description_1;
1953
+ o.symbol = w.symbol_1;
1954
+ o.type = w.type_1;
1955
+ var tmp0_safe_receiver = w.timeEpochMs_1;
1809
1956
  o.timeEpochMs = tmp0_safe_receiver == null ? null : toNumber(tmp0_safe_receiver);
1810
1957
  // Inline function 'kotlin.js.unsafeCast' call
1811
1958
  return o;
@@ -1902,39 +2049,39 @@
1902
2049
  }
1903
2050
  function toDto(_this__u8e3s4) {
1904
2051
  var o = {};
1905
- o.startDistanceM = _this__u8e3s4.m21_1;
1906
- o.endDistanceM = _this__u8e3s4.n21_1;
1907
- o.startElevationM = _this__u8e3s4.o21_1;
1908
- o.endElevationM = _this__u8e3s4.p21_1;
1909
- o.lengthM = _this__u8e3s4.i21();
1910
- o.elevationGainM = _this__u8e3s4.j21();
1911
- o.grade = _this__u8e3s4.q21();
2052
+ o.startDistanceM = _this__u8e3s4.startDistanceM_1;
2053
+ o.endDistanceM = _this__u8e3s4.endDistanceM_1;
2054
+ o.startElevationM = _this__u8e3s4.startElevationM_1;
2055
+ o.endElevationM = _this__u8e3s4.endElevationM_1;
2056
+ o.lengthM = _this__u8e3s4.get_lengthM_2aqrzy_k$();
2057
+ o.elevationGainM = _this__u8e3s4.get_elevationGainM_6kg9eu_k$();
2058
+ o.grade = _this__u8e3s4.get_grade_is33qm_k$();
1912
2059
  // Inline function 'kotlin.js.unsafeCast' call
1913
2060
  return o;
1914
2061
  }
1915
2062
  function toDto_0(_this__u8e3s4) {
1916
2063
  var o = {};
1917
- o.startIndex = _this__u8e3s4.z20_1;
1918
- o.endIndex = _this__u8e3s4.a21_1;
1919
- o.startDistanceM = _this__u8e3s4.b21_1;
1920
- o.endDistanceM = _this__u8e3s4.c21_1;
1921
- o.startElevationM = _this__u8e3s4.d21_1;
1922
- o.endElevationM = _this__u8e3s4.e21_1;
1923
- o.lengthM = _this__u8e3s4.i21();
1924
- o.elevationGainM = _this__u8e3s4.j21();
1925
- o.averageGrade = _this__u8e3s4.k21();
1926
- o.climbingGrade = _this__u8e3s4.l21();
1927
- o.positiveElevationM = _this__u8e3s4.f21_1;
1928
- o.negativeElevationM = _this__u8e3s4.g21_1;
2064
+ o.startIndex = _this__u8e3s4.startIndex_1;
2065
+ o.endIndex = _this__u8e3s4.endIndex_1;
2066
+ o.startDistanceM = _this__u8e3s4.startDistanceM_1;
2067
+ o.endDistanceM = _this__u8e3s4.endDistanceM_1;
2068
+ o.startElevationM = _this__u8e3s4.startElevationM_1;
2069
+ o.endElevationM = _this__u8e3s4.endElevationM_1;
2070
+ o.lengthM = _this__u8e3s4.get_lengthM_2aqrzy_k$();
2071
+ o.elevationGainM = _this__u8e3s4.get_elevationGainM_6kg9eu_k$();
2072
+ o.averageGrade = _this__u8e3s4.get_averageGrade_oooweb_k$();
2073
+ o.climbingGrade = _this__u8e3s4.get_climbingGrade_olocdd_k$();
2074
+ o.positiveElevationM = _this__u8e3s4.positiveElevationM_1;
2075
+ o.negativeElevationM = _this__u8e3s4.negativeElevationM_1;
1929
2076
  // Inline function 'kotlin.collections.map' call
1930
- var this_0 = _this__u8e3s4.h21_1;
2077
+ var this_0 = _this__u8e3s4.parts_1;
1931
2078
  // Inline function 'kotlin.collections.mapTo' call
1932
2079
  var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10));
1933
- var _iterator__ex2g4s = this_0.i();
1934
- while (_iterator__ex2g4s.j()) {
1935
- var item = _iterator__ex2g4s.k();
2080
+ var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
2081
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
2082
+ var item = _iterator__ex2g4s.next_20eer_k$();
1936
2083
  var tmp$ret$2 = toDto(item);
1937
- destination.h(tmp$ret$2);
2084
+ destination.add_utx5q5_k$(tmp$ret$2);
1938
2085
  }
1939
2086
  // Inline function 'kotlin.collections.toTypedArray' call
1940
2087
  o.parts = copyToArray(destination);
@@ -1942,31 +2089,31 @@
1942
2089
  return o;
1943
2090
  }
1944
2091
  function enhance$slambda($options, $path, resultContinuation) {
1945
- this.k24_1 = $options;
1946
- this.l24_1 = $path;
2092
+ this.$options_1 = $options;
2093
+ this.$path_1 = $path;
1947
2094
  CoroutineImpl.call(this, resultContinuation);
1948
2095
  }
1949
- protoOf(enhance$slambda).n24 = function ($this$promise, $completion) {
1950
- var tmp = this.n11($this$promise, $completion);
1951
- tmp.j6_1 = Unit_instance;
1952
- tmp.k6_1 = null;
1953
- return tmp.p6();
2096
+ protoOf(enhance$slambda).invoke_jiwoso_k$ = function ($this$promise, $completion) {
2097
+ var tmp = this.create_rcuf4x_k$($this$promise, $completion);
2098
+ tmp.result_1 = Unit_instance;
2099
+ tmp.exception_1 = null;
2100
+ return tmp.doResume_5yljmg_k$();
1954
2101
  };
1955
- protoOf(enhance$slambda).x6 = function (p1, $completion) {
1956
- return this.n24((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
2102
+ protoOf(enhance$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
2103
+ return this.invoke_jiwoso_k$((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
1957
2104
  };
1958
- protoOf(enhance$slambda).p6 = function () {
1959
- var suspendResult = this.j6_1;
2105
+ protoOf(enhance$slambda).doResume_5yljmg_k$ = function () {
2106
+ var suspendResult = this.result_1;
1960
2107
  $sm: do
1961
2108
  try {
1962
- var tmp = this.h6_1;
2109
+ var tmp = this.state_1;
1963
2110
  switch (tmp) {
1964
2111
  case 0:
1965
- this.i6_1 = 2;
1966
- var opts = toEnhanceOptions(this.k24_1);
1967
- var provider = opts.w1z_1 ? new ElevationProvider() : null;
1968
- this.h6_1 = 1;
1969
- suspendResult = Enhancer_instance.x20(this.l24_1, provider, opts, this);
2112
+ this.exceptionState_1 = 2;
2113
+ var opts = toEnhanceOptions(this.$options_1);
2114
+ var provider = opts.fixElevation_1 ? new ElevationProvider() : null;
2115
+ this.state_1 = 1;
2116
+ suspendResult = Enhancer_instance.enhanceCourseDefault_jm937y_k$(this.$path_1, provider, opts, this);
1970
2117
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
1971
2118
  return suspendResult;
1972
2119
  }
@@ -1975,61 +2122,61 @@
1975
2122
  case 1:
1976
2123
  return suspendResult;
1977
2124
  case 2:
1978
- throw this.k6_1;
2125
+ throw this.exception_1;
1979
2126
  }
1980
2127
  } catch ($p) {
1981
2128
  var e = $p;
1982
- if (this.i6_1 === 2) {
2129
+ if (this.exceptionState_1 === 2) {
1983
2130
  throw e;
1984
2131
  } else {
1985
- this.h6_1 = this.i6_1;
1986
- this.k6_1 = e;
2132
+ this.state_1 = this.exceptionState_1;
2133
+ this.exception_1 = e;
1987
2134
  }
1988
2135
  }
1989
2136
  while (true);
1990
2137
  };
1991
- protoOf(enhance$slambda).n11 = function ($this$promise, completion) {
1992
- var i = new enhance$slambda(this.k24_1, this.l24_1, completion);
1993
- i.m24_1 = $this$promise;
2138
+ protoOf(enhance$slambda).create_rcuf4x_k$ = function ($this$promise, completion) {
2139
+ var i = new enhance$slambda(this.$options_1, this.$path_1, completion);
2140
+ i.$this$promise_1 = $this$promise;
1994
2141
  return i;
1995
2142
  };
1996
2143
  function enhance$slambda_0($options, $path, resultContinuation) {
1997
2144
  var i = new enhance$slambda($options, $path, resultContinuation);
1998
2145
  return constructCallableReference(function ($this$promise, $completion) {
1999
- return i.n24($this$promise, $completion);
2146
+ return i.invoke_jiwoso_k$($this$promise, $completion);
2000
2147
  }, 1);
2001
2148
  }
2002
2149
  function enhanceWithCourse$slambda($options, $path, $cyclist, $bike, $wind, $power, resultContinuation) {
2003
- this.w24_1 = $options;
2004
- this.x24_1 = $path;
2005
- this.y24_1 = $cyclist;
2006
- this.z24_1 = $bike;
2007
- this.a25_1 = $wind;
2008
- this.b25_1 = $power;
2150
+ this.$options_1 = $options;
2151
+ this.$path_1 = $path;
2152
+ this.$cyclist_1 = $cyclist;
2153
+ this.$bike_1 = $bike;
2154
+ this.$wind_1 = $wind;
2155
+ this.$power_1 = $power;
2009
2156
  CoroutineImpl.call(this, resultContinuation);
2010
2157
  }
2011
- protoOf(enhanceWithCourse$slambda).n24 = function ($this$promise, $completion) {
2012
- var tmp = this.n11($this$promise, $completion);
2013
- tmp.j6_1 = Unit_instance;
2014
- tmp.k6_1 = null;
2015
- return tmp.p6();
2158
+ protoOf(enhanceWithCourse$slambda).invoke_jiwoso_k$ = function ($this$promise, $completion) {
2159
+ var tmp = this.create_rcuf4x_k$($this$promise, $completion);
2160
+ tmp.result_1 = Unit_instance;
2161
+ tmp.exception_1 = null;
2162
+ return tmp.doResume_5yljmg_k$();
2016
2163
  };
2017
- protoOf(enhanceWithCourse$slambda).x6 = function (p1, $completion) {
2018
- return this.n24((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
2164
+ protoOf(enhanceWithCourse$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
2165
+ return this.invoke_jiwoso_k$((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
2019
2166
  };
2020
- protoOf(enhanceWithCourse$slambda).p6 = function () {
2021
- var suspendResult = this.j6_1;
2167
+ protoOf(enhanceWithCourse$slambda).doResume_5yljmg_k$ = function () {
2168
+ var suspendResult = this.result_1;
2022
2169
  $sm: do
2023
2170
  try {
2024
- var tmp = this.h6_1;
2171
+ var tmp = this.state_1;
2025
2172
  switch (tmp) {
2026
2173
  case 0:
2027
- this.i6_1 = 2;
2028
- var opts = toEnhanceOptions(this.w24_1);
2029
- var provider = opts.w1z_1 ? new ElevationProvider() : null;
2030
- var course = new CoursePhysics(new Course(this.x24_1, toCyclist(this.y24_1), toBike(this.z24_1)), RhoProviderEstimate_instance, AeroProviderConstant_instance, toWindProvider(this.a25_1), toCyclistPowerProvider(this.b25_1));
2031
- this.h6_1 = 1;
2032
- suspendResult = Enhancer_instance.y20(course, opts, provider, this);
2174
+ this.exceptionState_1 = 2;
2175
+ var opts = toEnhanceOptions(this.$options_1);
2176
+ var provider = opts.fixElevation_1 ? new ElevationProvider() : null;
2177
+ var course = new CoursePhysics(new Course(this.$path_1, toCyclist(this.$cyclist_1), toBike(this.$bike_1)), RhoProviderEstimate_instance, AeroProviderConstant_instance, toWindProvider(this.$wind_1), toCyclistPowerProvider(this.$power_1));
2178
+ this.state_1 = 1;
2179
+ suspendResult = Enhancer_instance.enhanceCourse_mout3j_k$(course, opts, provider, this);
2033
2180
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
2034
2181
  return suspendResult;
2035
2182
  }
@@ -2038,28 +2185,28 @@
2038
2185
  case 1:
2039
2186
  return suspendResult;
2040
2187
  case 2:
2041
- throw this.k6_1;
2188
+ throw this.exception_1;
2042
2189
  }
2043
2190
  } catch ($p) {
2044
2191
  var e = $p;
2045
- if (this.i6_1 === 2) {
2192
+ if (this.exceptionState_1 === 2) {
2046
2193
  throw e;
2047
2194
  } else {
2048
- this.h6_1 = this.i6_1;
2049
- this.k6_1 = e;
2195
+ this.state_1 = this.exceptionState_1;
2196
+ this.exception_1 = e;
2050
2197
  }
2051
2198
  }
2052
2199
  while (true);
2053
2200
  };
2054
- protoOf(enhanceWithCourse$slambda).n11 = function ($this$promise, completion) {
2055
- var i = new enhanceWithCourse$slambda(this.w24_1, this.x24_1, this.y24_1, this.z24_1, this.a25_1, this.b25_1, completion);
2056
- i.c25_1 = $this$promise;
2201
+ protoOf(enhanceWithCourse$slambda).create_rcuf4x_k$ = function ($this$promise, completion) {
2202
+ var i = new enhanceWithCourse$slambda(this.$options_1, this.$path_1, this.$cyclist_1, this.$bike_1, this.$wind_1, this.$power_1, completion);
2203
+ i.$this$promise_1 = $this$promise;
2057
2204
  return i;
2058
2205
  };
2059
2206
  function enhanceWithCourse$slambda_0($options, $path, $cyclist, $bike, $wind, $power, resultContinuation) {
2060
2207
  var i = new enhanceWithCourse$slambda($options, $path, $cyclist, $bike, $wind, $power, resultContinuation);
2061
2208
  return constructCallableReference(function ($this$promise, $completion) {
2062
- return i.n24($this$promise, $completion);
2209
+ return i.invoke_jiwoso_k$($this$promise, $completion);
2063
2210
  }, 1);
2064
2211
  }
2065
2212
  //region block: init
@@ -2091,6 +2238,8 @@
2091
2238
  engine.parseGpx = parseGpx;
2092
2239
  engine.parseGpxTracks = parseGpxTracks;
2093
2240
  engine.parseGpxSegments = parseGpxSegments;
2241
+ engine.parseGpxTracksOnly = parseGpxTracksOnly;
2242
+ engine.parseGpxRoutesOnly = parseGpxRoutesOnly;
2094
2243
  engine.writeGpxTracks = writeGpxTracks;
2095
2244
  engine.pathSize = pathSize;
2096
2245
  engine.pathTotalDistance = pathTotalDistance;
@@ -2109,6 +2258,9 @@
2109
2258
  engine.pathToCsv = pathToCsv;
2110
2259
  engine.pathToJson = pathToJson;
2111
2260
  engine.pathToFit = pathToFit;
2261
+ engine.pathsToFit = pathsToFit;
2262
+ engine.dominantHeadwindAzimuth = dominantHeadwindAzimuth;
2263
+ engine.dominantHeadwindAzimuthOfTracks = dominantHeadwindAzimuthOfTracks;
2112
2264
  engine.detectClimbs = detectClimbs;
2113
2265
  engine.detectClimbsWithOptions = detectClimbsWithOptions;
2114
2266
  }