@glandais/vcyclist-engine 0.0.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.
@@ -0,0 +1,3284 @@
1
+ (function (factory) {
2
+ if (typeof define === 'function' && define.amd)
3
+ define(['exports', './kotlin-kotlin-stdlib.js', './vcyclist-elevation.js', './xmlutil-core.js', './kotlinx-coroutines-core.js'], factory);
4
+ else if (typeof exports === 'object')
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./vcyclist-elevation.js'), require('./xmlutil-core.js'), require('./kotlinx-coroutines-core.js'));
6
+ else {
7
+ if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
8
+ throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'io.github.glandais:engine'.");
9
+ }
10
+ if (typeof globalThis['vcyclist-elevation'] === 'undefined') {
11
+ throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'vcyclist-elevation' was not found. Please, check whether 'vcyclist-elevation' is loaded prior to 'io.github.glandais:engine'.");
12
+ }
13
+ if (typeof globalThis['xmlutil-core'] === 'undefined') {
14
+ throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'xmlutil-core' was not found. Please, check whether 'xmlutil-core' is loaded prior to 'io.github.glandais:engine'.");
15
+ }
16
+ if (typeof globalThis['kotlinx-coroutines-core'] === 'undefined') {
17
+ throw new Error("Error loading module 'io.github.glandais:engine'. Its dependency 'kotlinx-coroutines-core' was not found. Please, check whether 'kotlinx-coroutines-core' is loaded prior to 'io.github.glandais:engine'.");
18
+ }
19
+ globalThis['io.github.glandais:engine'] = factory(typeof globalThis['io.github.glandais:engine'] === 'undefined' ? {} : globalThis['io.github.glandais:engine'], globalThis['kotlin-kotlin-stdlib'], globalThis['vcyclist-elevation'], globalThis['xmlutil-core'], globalThis['kotlinx-coroutines-core']);
20
+ }
21
+ }(function (_, kotlin_kotlin, kotlin_io_github_glandais_elevation, kotlin_io_github_pdvrieze_xmlutil_core, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core) {
22
+ 'use strict';
23
+ //region block: imports
24
+ var imul = Math.imul;
25
+ var protoOf = kotlin_kotlin.$_$.e5;
26
+ var initMetadataForCompanion = kotlin_kotlin.$_$.t4;
27
+ var VOID = kotlin_kotlin.$_$.a;
28
+ var getNumberHashCode = kotlin_kotlin.$_$.o4;
29
+ var equals = kotlin_kotlin.$_$.m4;
30
+ var initMetadataForClass = kotlin_kotlin.$_$.s4;
31
+ var toString = kotlin_kotlin.$_$.g5;
32
+ var hashCode = kotlin_kotlin.$_$.r4;
33
+ var getBooleanHashCode = kotlin_kotlin.$_$.n4;
34
+ var CoroutineImpl = kotlin_kotlin.$_$.m3;
35
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.x2;
36
+ var Unit_instance = kotlin_kotlin.$_$.g;
37
+ var initMetadataForCoroutine = kotlin_kotlin.$_$.u4;
38
+ var initMetadataForObject = kotlin_kotlin.$_$.y4;
39
+ var getStringHashCode = kotlin_kotlin.$_$.q4;
40
+ var toString_0 = kotlin_kotlin.$_$.z6;
41
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.i;
42
+ var MathConstants_getInstance = kotlin_io_github_glandais_elevation.$_$.d;
43
+ var isNaN_0 = kotlin_kotlin.$_$.u6;
44
+ var numberToLong = kotlin_kotlin.$_$.a4;
45
+ var Long = kotlin_kotlin.$_$.k6;
46
+ var compare = kotlin_kotlin.$_$.t3;
47
+ var roundToInt = kotlin_kotlin.$_$.h5;
48
+ var listOf = kotlin_kotlin.$_$.p2;
49
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.y;
50
+ var EventType_START_ELEMENT_getInstance = kotlin_io_github_pdvrieze_xmlutil_core.$_$.a;
51
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.j;
52
+ var THROW_CCE = kotlin_kotlin.$_$.o6;
53
+ var isCharSequence = kotlin_kotlin.$_$.z4;
54
+ var trim = kotlin_kotlin.$_$.e6;
55
+ var charSequenceLength = kotlin_kotlin.$_$.j4;
56
+ var isBlank = kotlin_kotlin.$_$.u5;
57
+ var toDoubleOrNull = kotlin_kotlin.$_$.y5;
58
+ var numberToInt = kotlin_kotlin.$_$.c5;
59
+ var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.s;
60
+ var Companion_getInstance = kotlin_kotlin.$_$.e;
61
+ var IllegalArgumentException = kotlin_kotlin.$_$.j6;
62
+ var get_xmlStreaming = kotlin_io_github_pdvrieze_xmlutil_core.$_$.e;
63
+ var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.z;
64
+ var XmlException = kotlin_io_github_pdvrieze_xmlutil_core.$_$.c;
65
+ var firstOrNull = kotlin_kotlin.$_$.l2;
66
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.a1;
67
+ var toNumber = kotlin_kotlin.$_$.c4;
68
+ var XmlDeclMode_None_getInstance = kotlin_io_github_pdvrieze_xmlutil_core.$_$.b;
69
+ var newGenericWriter = kotlin_io_github_pdvrieze_xmlutil_core.$_$.d;
70
+ var LatLon = kotlin_io_github_glandais_elevation.$_$.f;
71
+ var ElevationSmoother_instance = kotlin_io_github_glandais_elevation.$_$.c;
72
+ var until = kotlin_kotlin.$_$.o5;
73
+ var LatLonElevation = kotlin_io_github_glandais_elevation.$_$.e;
74
+ var arrayCopy = kotlin_kotlin.$_$.a2;
75
+ var Distance_instance = kotlin_io_github_glandais_elevation.$_$.a;
76
+ var DouglasPeucker_instance = kotlin_io_github_glandais_elevation.$_$.b;
77
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.c2;
78
+ var mapCapacity = kotlin_kotlin.$_$.r2;
79
+ var coerceAtLeast = kotlin_kotlin.$_$.k5;
80
+ var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.m;
81
+ var enumEntries = kotlin_kotlin.$_$.o3;
82
+ var Enum = kotlin_kotlin.$_$.g6;
83
+ var noWhenBranchMatchedException = kotlin_kotlin.$_$.w6;
84
+ var LinkedHashMap_init_$Create$_0 = kotlin_kotlin.$_$.n;
85
+ var multiply = kotlin_kotlin.$_$.z3;
86
+ var subtract = kotlin_kotlin.$_$.b4;
87
+ var equalsLong = kotlin_kotlin.$_$.w3;
88
+ var add = kotlin_kotlin.$_$.s3;
89
+ var get_ONE = kotlin_kotlin.$_$.r3;
90
+ var sorted = kotlin_kotlin.$_$.t2;
91
+ var Default_getInstance = kotlin_kotlin.$_$.d;
92
+ var emptyList = kotlin_kotlin.$_$.j2;
93
+ var GlobalScope_instance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a;
94
+ var promise = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
95
+ var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h;
96
+ var isInterface = kotlin_kotlin.$_$.a5;
97
+ var initMetadataForLambda = kotlin_kotlin.$_$.x4;
98
+ //endregion
99
+ //region block: pre-declaration
100
+ initMetadataForCompanion(Companion);
101
+ initMetadataForClass(Bike, 'Bike', Bike);
102
+ initMetadataForClass(Course, 'Course');
103
+ initMetadataForCompanion(Companion_0);
104
+ initMetadataForClass(CoursePhysics, 'CoursePhysics');
105
+ initMetadataForCompanion(Companion_1);
106
+ initMetadataForClass(Cyclist, 'Cyclist', Cyclist);
107
+ initMetadataForClass(SimplifyPathOptions, 'SimplifyPathOptions', SimplifyPathOptions);
108
+ initMetadataForCompanion(Companion_2);
109
+ initMetadataForClass(EnhanceOptions, 'EnhanceOptions', EnhanceOptions);
110
+ initMetadataForCoroutine($enhanceCourseCOROUTINE$, CoroutineImpl);
111
+ initMetadataForObject(Enhancer, 'Enhancer', VOID, VOID, VOID, [3]);
112
+ initMetadataForClass(GpxDocument, 'GpxDocument');
113
+ initMetadataForClass(GpxTrack, 'GpxTrack');
114
+ initMetadataForClass(GpxTrackPoint, 'GpxTrackPoint');
115
+ initMetadataForClass(ExtensionsAccumulator, 'ExtensionsAccumulator', ExtensionsAccumulator);
116
+ initMetadataForObject(GpxParser, 'GpxParser');
117
+ initMetadataForObject(GpxWriter, 'GpxWriter');
118
+ initMetadataForCoroutine($fixElevationCOROUTINE$, CoroutineImpl);
119
+ initMetadataForObject(ElevationStep, 'ElevationStep', VOID, VOID, VOID, [2]);
120
+ initMetadataForClass(GeneratedPath, 'GeneratedPath');
121
+ initMetadataForCompanion(Companion_3);
122
+ initMetadataForClass(BoundsRad, 'BoundsRad');
123
+ initMetadataForCompanion(Companion_4);
124
+ initMetadataForClass(Path, 'Path', VOID, GeneratedPath);
125
+ initMetadataForObject(PathSimplifier, 'PathSimplifier');
126
+ initMetadataForCompanion(Companion_5);
127
+ initMetadataForClass(PointField, 'PointField', VOID, Enum);
128
+ initMetadataForClass(PointFieldCategory, 'PointFieldCategory', VOID, Enum);
129
+ initMetadataForClass(Copy, 'Copy');
130
+ initMetadataForClass(Interpolate, 'Interpolate');
131
+ initMetadataForObject(PointPerDistance, 'PointPerDistance');
132
+ initMetadataForClass(Copy_0, 'Copy');
133
+ initMetadataForClass(Interpolate_0, 'Interpolate');
134
+ initMetadataForObject(PointPerSecond, 'PointPerSecond');
135
+ initMetadataForObject(AeroPowerProvider, 'AeroPowerProvider');
136
+ initMetadataForObject(AeroProviderConstant, 'AeroProviderConstant');
137
+ initMetadataForCompanion(Companion_6);
138
+ initMetadataForClass(CyclistPowerProviderBase, 'CyclistPowerProviderBase');
139
+ initMetadataForObject(GravPowerProvider, 'GravPowerProvider');
140
+ initMetadataForClass(Harmonic, 'Harmonic');
141
+ initMetadataForObject(MaxSpeedComputer, 'MaxSpeedComputer');
142
+ initMetadataForObject(MuscularPowerProvider, 'MuscularPowerProvider');
143
+ initMetadataForObject(PowerComputer, 'PowerComputer');
144
+ initMetadataForClass(PowerProviderConstant, 'PowerProviderConstant', VOID, CyclistPowerProviderBase);
145
+ initMetadataForObject(RhoProviderDefault, 'RhoProviderDefault');
146
+ initMetadataForObject(RhoProviderEstimate, 'RhoProviderEstimate');
147
+ initMetadataForObject(RollingResistancePowerProvider, 'RollingResistancePowerProvider');
148
+ initMetadataForObject(VirtualizeService, 'VirtualizeService');
149
+ initMetadataForObject(WheelBearingsPowerProvider, 'WheelBearingsPowerProvider');
150
+ initMetadataForCompanion(Companion_7);
151
+ initMetadataForClass(Wind, 'Wind');
152
+ initMetadataForObject(WindProviderNone, 'WindProviderNone');
153
+ initMetadataForLambda(enhance$slambda, CoroutineImpl, VOID, [1]);
154
+ //endregion
155
+ function Companion() {
156
+ Companion_instance = this;
157
+ this.p1d_1 = new Bike();
158
+ }
159
+ var Companion_instance;
160
+ function Companion_getInstance_0() {
161
+ if (Companion_instance == null)
162
+ new Companion();
163
+ return Companion_instance;
164
+ }
165
+ function Bike(crr, inertiaFront, inertiaRear, wheelRadiusM, efficiency) {
166
+ Companion_getInstance_0();
167
+ crr = crr === VOID ? 0.004 : crr;
168
+ inertiaFront = inertiaFront === VOID ? 0.05 : inertiaFront;
169
+ inertiaRear = inertiaRear === VOID ? 0.07 : inertiaRear;
170
+ wheelRadiusM = wheelRadiusM === VOID ? 0.7 : wheelRadiusM;
171
+ efficiency = efficiency === VOID ? 0.976 : efficiency;
172
+ this.q1d_1 = crr;
173
+ this.r1d_1 = inertiaFront;
174
+ this.s1d_1 = inertiaRear;
175
+ this.t1d_1 = wheelRadiusM;
176
+ this.u1d_1 = efficiency;
177
+ }
178
+ protoOf(Bike).toString = function () {
179
+ return 'Bike(crr=' + this.q1d_1 + ', inertiaFront=' + this.r1d_1 + ', inertiaRear=' + this.s1d_1 + ', wheelRadiusM=' + this.t1d_1 + ', efficiency=' + this.u1d_1 + ')';
180
+ };
181
+ protoOf(Bike).hashCode = function () {
182
+ var result = getNumberHashCode(this.q1d_1);
183
+ result = imul(result, 31) + getNumberHashCode(this.r1d_1) | 0;
184
+ result = imul(result, 31) + getNumberHashCode(this.s1d_1) | 0;
185
+ result = imul(result, 31) + getNumberHashCode(this.t1d_1) | 0;
186
+ result = imul(result, 31) + getNumberHashCode(this.u1d_1) | 0;
187
+ return result;
188
+ };
189
+ protoOf(Bike).equals = function (other) {
190
+ if (this === other)
191
+ return true;
192
+ if (!(other instanceof Bike))
193
+ return false;
194
+ if (!equals(this.q1d_1, other.q1d_1))
195
+ return false;
196
+ if (!equals(this.r1d_1, other.r1d_1))
197
+ return false;
198
+ if (!equals(this.s1d_1, other.s1d_1))
199
+ return false;
200
+ if (!equals(this.t1d_1, other.t1d_1))
201
+ return false;
202
+ if (!equals(this.u1d_1, other.u1d_1))
203
+ return false;
204
+ return true;
205
+ };
206
+ function Course(path, cyclist, bike) {
207
+ cyclist = cyclist === VOID ? Companion_getInstance_2().v1d_1 : cyclist;
208
+ bike = bike === VOID ? Companion_getInstance_0().p1d_1 : bike;
209
+ this.w1d_1 = path;
210
+ this.x1d_1 = cyclist;
211
+ this.y1d_1 = bike;
212
+ }
213
+ protoOf(Course).z1d = function (path, cyclist, bike) {
214
+ return new Course(path, cyclist, bike);
215
+ };
216
+ protoOf(Course).a1e = function (path, cyclist, bike, $super) {
217
+ path = path === VOID ? this.w1d_1 : path;
218
+ cyclist = cyclist === VOID ? this.x1d_1 : cyclist;
219
+ bike = bike === VOID ? this.y1d_1 : bike;
220
+ return $super === VOID ? this.z1d(path, cyclist, bike) : $super.z1d.call(this, path, cyclist, bike);
221
+ };
222
+ protoOf(Course).toString = function () {
223
+ return 'Course(path=' + toString(this.w1d_1) + ', cyclist=' + this.x1d_1.toString() + ', bike=' + this.y1d_1.toString() + ')';
224
+ };
225
+ protoOf(Course).hashCode = function () {
226
+ var result = hashCode(this.w1d_1);
227
+ result = imul(result, 31) + this.x1d_1.hashCode() | 0;
228
+ result = imul(result, 31) + this.y1d_1.hashCode() | 0;
229
+ return result;
230
+ };
231
+ protoOf(Course).equals = function (other) {
232
+ if (this === other)
233
+ return true;
234
+ if (!(other instanceof Course))
235
+ return false;
236
+ if (!equals(this.w1d_1, other.w1d_1))
237
+ return false;
238
+ if (!this.x1d_1.equals(other.x1d_1))
239
+ return false;
240
+ if (!this.y1d_1.equals(other.y1d_1))
241
+ return false;
242
+ return true;
243
+ };
244
+ function Companion_0() {
245
+ Companion_instance_0 = this;
246
+ this.b1e_1 = new PowerProviderConstant(280.0);
247
+ }
248
+ var Companion_instance_0;
249
+ function Companion_getInstance_1() {
250
+ if (Companion_instance_0 == null)
251
+ new Companion_0();
252
+ return Companion_instance_0;
253
+ }
254
+ function CoursePhysics(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
255
+ Companion_getInstance_1();
256
+ rhoProvider = rhoProvider === VOID ? RhoProviderDefault_instance : rhoProvider;
257
+ aeroProvider = aeroProvider === VOID ? AeroProviderConstant_instance : aeroProvider;
258
+ windProvider = windProvider === VOID ? WindProviderNone_instance : windProvider;
259
+ cyclistPowerProvider = cyclistPowerProvider === VOID ? Companion_getInstance_1().b1e_1 : cyclistPowerProvider;
260
+ this.c1e_1 = course;
261
+ this.d1e_1 = rhoProvider;
262
+ this.e1e_1 = aeroProvider;
263
+ this.f1e_1 = windProvider;
264
+ this.g1e_1 = cyclistPowerProvider;
265
+ }
266
+ protoOf(CoursePhysics).h1e = function () {
267
+ return this.c1e_1.w1d_1;
268
+ };
269
+ protoOf(CoursePhysics).i1e = function () {
270
+ return this.c1e_1.x1d_1;
271
+ };
272
+ protoOf(CoursePhysics).j1e = function () {
273
+ return this.c1e_1.y1d_1;
274
+ };
275
+ protoOf(CoursePhysics).k1e = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
276
+ return new CoursePhysics(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
277
+ };
278
+ protoOf(CoursePhysics).l1e = function (course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider, $super) {
279
+ course = course === VOID ? this.c1e_1 : course;
280
+ rhoProvider = rhoProvider === VOID ? this.d1e_1 : rhoProvider;
281
+ aeroProvider = aeroProvider === VOID ? this.e1e_1 : aeroProvider;
282
+ windProvider = windProvider === VOID ? this.f1e_1 : windProvider;
283
+ cyclistPowerProvider = cyclistPowerProvider === VOID ? this.g1e_1 : cyclistPowerProvider;
284
+ return $super === VOID ? this.k1e(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) : $super.k1e.call(this, course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider);
285
+ };
286
+ protoOf(CoursePhysics).toString = function () {
287
+ return 'CoursePhysics(course=' + this.c1e_1.toString() + ', rhoProvider=' + toString(this.d1e_1) + ', aeroProvider=' + toString(this.e1e_1) + ', windProvider=' + toString(this.f1e_1) + ', cyclistPowerProvider=' + toString(this.g1e_1) + ')';
288
+ };
289
+ protoOf(CoursePhysics).hashCode = function () {
290
+ var result = this.c1e_1.hashCode();
291
+ result = imul(result, 31) + hashCode(this.d1e_1) | 0;
292
+ result = imul(result, 31) + hashCode(this.e1e_1) | 0;
293
+ result = imul(result, 31) + hashCode(this.f1e_1) | 0;
294
+ result = imul(result, 31) + hashCode(this.g1e_1) | 0;
295
+ return result;
296
+ };
297
+ protoOf(CoursePhysics).equals = function (other) {
298
+ if (this === other)
299
+ return true;
300
+ if (!(other instanceof CoursePhysics))
301
+ return false;
302
+ if (!this.c1e_1.equals(other.c1e_1))
303
+ return false;
304
+ if (!equals(this.d1e_1, other.d1e_1))
305
+ return false;
306
+ if (!equals(this.e1e_1, other.e1e_1))
307
+ return false;
308
+ if (!equals(this.f1e_1, other.f1e_1))
309
+ return false;
310
+ if (!equals(this.g1e_1, other.g1e_1))
311
+ return false;
312
+ return true;
313
+ };
314
+ function Companion_1() {
315
+ Companion_instance_1 = this;
316
+ this.v1d_1 = new Cyclist();
317
+ }
318
+ var Companion_instance_1;
319
+ function Companion_getInstance_2() {
320
+ if (Companion_instance_1 == null)
321
+ new Companion_1();
322
+ return Companion_instance_1;
323
+ }
324
+ function Cyclist(massKg, maxBrakeG, cd, frontalAreaM2, maxLeanAngleDeg, maxSpeedKmH) {
325
+ Companion_getInstance_2();
326
+ massKg = massKg === VOID ? 80.0 : massKg;
327
+ maxBrakeG = maxBrakeG === VOID ? 0.6 : maxBrakeG;
328
+ cd = cd === VOID ? 0.7 : cd;
329
+ frontalAreaM2 = frontalAreaM2 === VOID ? 0.5 : frontalAreaM2;
330
+ maxLeanAngleDeg = maxLeanAngleDeg === VOID ? 35.0 : maxLeanAngleDeg;
331
+ maxSpeedKmH = maxSpeedKmH === VOID ? 100.0 : maxSpeedKmH;
332
+ this.m1e_1 = massKg;
333
+ this.n1e_1 = maxBrakeG;
334
+ this.o1e_1 = cd;
335
+ this.p1e_1 = frontalAreaM2;
336
+ this.q1e_1 = maxLeanAngleDeg;
337
+ this.r1e_1 = maxSpeedKmH;
338
+ }
339
+ protoOf(Cyclist).s1e = function () {
340
+ // Inline function 'kotlin.math.tan' call
341
+ var x = this.q1e_1 * 3.141592653589793 / 180.0;
342
+ return Math.tan(x);
343
+ };
344
+ protoOf(Cyclist).t1e = function () {
345
+ return this.n1e_1 * 9.8;
346
+ };
347
+ protoOf(Cyclist).u1e = function () {
348
+ return this.r1e_1 / 3.6;
349
+ };
350
+ protoOf(Cyclist).toString = function () {
351
+ return 'Cyclist(massKg=' + this.m1e_1 + ', maxBrakeG=' + this.n1e_1 + ', cd=' + this.o1e_1 + ', frontalAreaM2=' + this.p1e_1 + ', maxLeanAngleDeg=' + this.q1e_1 + ', maxSpeedKmH=' + this.r1e_1 + ')';
352
+ };
353
+ protoOf(Cyclist).hashCode = function () {
354
+ var result = getNumberHashCode(this.m1e_1);
355
+ result = imul(result, 31) + getNumberHashCode(this.n1e_1) | 0;
356
+ result = imul(result, 31) + getNumberHashCode(this.o1e_1) | 0;
357
+ result = imul(result, 31) + getNumberHashCode(this.p1e_1) | 0;
358
+ result = imul(result, 31) + getNumberHashCode(this.q1e_1) | 0;
359
+ result = imul(result, 31) + getNumberHashCode(this.r1e_1) | 0;
360
+ return result;
361
+ };
362
+ protoOf(Cyclist).equals = function (other) {
363
+ if (this === other)
364
+ return true;
365
+ if (!(other instanceof Cyclist))
366
+ return false;
367
+ if (!equals(this.m1e_1, other.m1e_1))
368
+ return false;
369
+ if (!equals(this.n1e_1, other.n1e_1))
370
+ return false;
371
+ if (!equals(this.o1e_1, other.o1e_1))
372
+ return false;
373
+ if (!equals(this.p1e_1, other.p1e_1))
374
+ return false;
375
+ if (!equals(this.q1e_1, other.q1e_1))
376
+ return false;
377
+ if (!equals(this.r1e_1, other.r1e_1))
378
+ return false;
379
+ return true;
380
+ };
381
+ function SimplifyPathOptions(enabled, toleranceM, zExaggeration) {
382
+ enabled = enabled === VOID ? true : enabled;
383
+ toleranceM = toleranceM === VOID ? 10.0 : toleranceM;
384
+ zExaggeration = zExaggeration === VOID ? 3.0 : zExaggeration;
385
+ this.v1e_1 = enabled;
386
+ this.w1e_1 = toleranceM;
387
+ this.x1e_1 = zExaggeration;
388
+ }
389
+ protoOf(SimplifyPathOptions).toString = function () {
390
+ return 'SimplifyPathOptions(enabled=' + this.v1e_1 + ', toleranceM=' + this.w1e_1 + ', zExaggeration=' + this.x1e_1 + ')';
391
+ };
392
+ protoOf(SimplifyPathOptions).hashCode = function () {
393
+ var result = getBooleanHashCode(this.v1e_1);
394
+ result = imul(result, 31) + getNumberHashCode(this.w1e_1) | 0;
395
+ result = imul(result, 31) + getNumberHashCode(this.x1e_1) | 0;
396
+ return result;
397
+ };
398
+ protoOf(SimplifyPathOptions).equals = function (other) {
399
+ if (this === other)
400
+ return true;
401
+ if (!(other instanceof SimplifyPathOptions))
402
+ return false;
403
+ if (!(this.v1e_1 === other.v1e_1))
404
+ return false;
405
+ if (!equals(this.w1e_1, other.w1e_1))
406
+ return false;
407
+ if (!equals(this.x1e_1, other.x1e_1))
408
+ return false;
409
+ return true;
410
+ };
411
+ function Companion_2() {
412
+ Companion_instance_2 = this;
413
+ this.y1e_1 = new EnhanceOptions();
414
+ }
415
+ var Companion_instance_2;
416
+ function Companion_getInstance_3() {
417
+ if (Companion_instance_2 == null)
418
+ new Companion_2();
419
+ return Companion_instance_2;
420
+ }
421
+ function EnhanceOptions(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath) {
422
+ Companion_getInstance_3();
423
+ fixElevation = fixElevation === VOID ? true : fixElevation;
424
+ computeMaxSpeeds = computeMaxSpeeds === VOID ? true : computeMaxSpeeds;
425
+ virtualizeTrack = virtualizeTrack === VOID ? true : virtualizeTrack;
426
+ computeOnePointPerSecond = computeOnePointPerSecond === VOID ? true : computeOnePointPerSecond;
427
+ simplifyPath = simplifyPath === VOID ? new SimplifyPathOptions() : simplifyPath;
428
+ this.z1e_1 = fixElevation;
429
+ this.a1f_1 = computeMaxSpeeds;
430
+ this.b1f_1 = virtualizeTrack;
431
+ this.c1f_1 = computeOnePointPerSecond;
432
+ this.d1f_1 = simplifyPath;
433
+ }
434
+ protoOf(EnhanceOptions).toString = function () {
435
+ return 'EnhanceOptions(fixElevation=' + this.z1e_1 + ', computeMaxSpeeds=' + this.a1f_1 + ', virtualizeTrack=' + this.b1f_1 + ', computeOnePointPerSecond=' + this.c1f_1 + ', simplifyPath=' + this.d1f_1.toString() + ')';
436
+ };
437
+ protoOf(EnhanceOptions).hashCode = function () {
438
+ var result = getBooleanHashCode(this.z1e_1);
439
+ result = imul(result, 31) + getBooleanHashCode(this.a1f_1) | 0;
440
+ result = imul(result, 31) + getBooleanHashCode(this.b1f_1) | 0;
441
+ result = imul(result, 31) + getBooleanHashCode(this.c1f_1) | 0;
442
+ result = imul(result, 31) + this.d1f_1.hashCode() | 0;
443
+ return result;
444
+ };
445
+ protoOf(EnhanceOptions).equals = function (other) {
446
+ if (this === other)
447
+ return true;
448
+ if (!(other instanceof EnhanceOptions))
449
+ return false;
450
+ if (!(this.z1e_1 === other.z1e_1))
451
+ return false;
452
+ if (!(this.a1f_1 === other.a1f_1))
453
+ return false;
454
+ if (!(this.b1f_1 === other.b1f_1))
455
+ return false;
456
+ if (!(this.c1f_1 === other.c1f_1))
457
+ return false;
458
+ if (!this.d1f_1.equals(other.d1f_1))
459
+ return false;
460
+ return true;
461
+ };
462
+ function $enhanceCourseCOROUTINE$(_this__u8e3s4, course, options, elevationProvider, resultContinuation) {
463
+ CoroutineImpl.call(this, resultContinuation);
464
+ this.m1f_1 = _this__u8e3s4;
465
+ this.n1f_1 = course;
466
+ this.o1f_1 = options;
467
+ this.p1f_1 = elevationProvider;
468
+ }
469
+ protoOf($enhanceCourseCOROUTINE$).c6 = function () {
470
+ var suspendResult = this.w5_1;
471
+ $sm: do
472
+ try {
473
+ var tmp = this.u5_1;
474
+ switch (tmp) {
475
+ case 0:
476
+ this.v5_1 = 3;
477
+ this.q1f_1 = this.n1f_1.h1e();
478
+ this.q1f_1 = PointPerDistance_instance.r1f(this.q1f_1, -1.0, 30.0);
479
+ if (this.o1f_1.z1e_1 && !(this.p1f_1 == null)) {
480
+ this.u5_1 = 1;
481
+ suspendResult = ElevationStep_instance.t1f(this.q1f_1, this.p1f_1, this);
482
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
483
+ return suspendResult;
484
+ }
485
+ continue $sm;
486
+ } else {
487
+ this.u5_1 = 2;
488
+ continue $sm;
489
+ }
490
+
491
+ case 1:
492
+ this.q1f_1 = suspendResult;
493
+ this.u5_1 = 2;
494
+ continue $sm;
495
+ case 2:
496
+ this.q1f_1 = PointPerDistance_instance.r1f(this.q1f_1, 1.0, 2.0);
497
+ this.q1f_1 = ElevationStep_instance.u1f(this.q1f_1);
498
+ var working = this.n1f_1.l1e(this.n1f_1.c1e_1.a1e(this.q1f_1));
499
+ if (this.o1f_1.a1f_1 || this.o1f_1.b1f_1) {
500
+ MaxSpeedComputer_instance.a1g(working.c1e_1);
501
+ }
502
+
503
+ if (this.o1f_1.b1f_1) {
504
+ this.q1f_1 = VirtualizeService_instance.c1g(working);
505
+ working = working.l1e(working.c1e_1.a1e(this.q1f_1));
506
+ }
507
+
508
+ if (this.o1f_1.c1f_1) {
509
+ this.q1f_1 = PointPerSecond_instance.d1g(this.q1f_1);
510
+ }
511
+
512
+ if (this.o1f_1.d1f_1.v1e_1) {
513
+ this.q1f_1 = PathSimplifier_instance.e1g(this.q1f_1, this.o1f_1.d1f_1.w1e_1, this.o1f_1.d1f_1.x1e_1);
514
+ }
515
+
516
+ return this.q1f_1;
517
+ case 3:
518
+ throw this.x5_1;
519
+ }
520
+ } catch ($p) {
521
+ var e = $p;
522
+ if (this.v5_1 === 3) {
523
+ throw e;
524
+ } else {
525
+ this.u5_1 = this.v5_1;
526
+ this.x5_1 = e;
527
+ }
528
+ }
529
+ while (true);
530
+ };
531
+ function Enhancer() {
532
+ }
533
+ protoOf(Enhancer).f1g = function (path) {
534
+ return new CoursePhysics(new Course(path), RhoProviderEstimate_instance, AeroProviderConstant_instance, WindProviderNone_instance, new PowerProviderConstant(280.0));
535
+ };
536
+ protoOf(Enhancer).g1g = function (path, elevationProvider, options, $completion) {
537
+ return this.h1g(this.f1g(path), options, elevationProvider, $completion);
538
+ };
539
+ protoOf(Enhancer).h1g = function (course, options, elevationProvider, $completion) {
540
+ var tmp = new $enhanceCourseCOROUTINE$(this, course, options, elevationProvider, $completion);
541
+ tmp.w5_1 = Unit_instance;
542
+ tmp.x5_1 = null;
543
+ return tmp.c6();
544
+ };
545
+ var Enhancer_instance;
546
+ function Enhancer_getInstance() {
547
+ return Enhancer_instance;
548
+ }
549
+ function GpxDocument(name, tracks) {
550
+ name = name === VOID ? 'noname' : name;
551
+ this.i1g_1 = name;
552
+ this.j1g_1 = tracks;
553
+ }
554
+ protoOf(GpxDocument).toString = function () {
555
+ return 'GpxDocument(name=' + this.i1g_1 + ', tracks=' + toString(this.j1g_1) + ')';
556
+ };
557
+ protoOf(GpxDocument).hashCode = function () {
558
+ var result = getStringHashCode(this.i1g_1);
559
+ result = imul(result, 31) + hashCode(this.j1g_1) | 0;
560
+ return result;
561
+ };
562
+ protoOf(GpxDocument).equals = function (other) {
563
+ if (this === other)
564
+ return true;
565
+ if (!(other instanceof GpxDocument))
566
+ return false;
567
+ if (!(this.i1g_1 === other.i1g_1))
568
+ return false;
569
+ if (!equals(this.j1g_1, other.j1g_1))
570
+ return false;
571
+ return true;
572
+ };
573
+ function GpxTrack(name, type, points) {
574
+ name = name === VOID ? null : name;
575
+ type = type === VOID ? null : type;
576
+ this.k1g_1 = name;
577
+ this.l1g_1 = type;
578
+ this.m1g_1 = points;
579
+ }
580
+ protoOf(GpxTrack).toString = function () {
581
+ return 'GpxTrack(name=' + this.k1g_1 + ', type=' + this.l1g_1 + ', points=' + toString(this.m1g_1) + ')';
582
+ };
583
+ protoOf(GpxTrack).hashCode = function () {
584
+ var result = this.k1g_1 == null ? 0 : getStringHashCode(this.k1g_1);
585
+ result = imul(result, 31) + (this.l1g_1 == null ? 0 : getStringHashCode(this.l1g_1)) | 0;
586
+ result = imul(result, 31) + hashCode(this.m1g_1) | 0;
587
+ return result;
588
+ };
589
+ protoOf(GpxTrack).equals = function (other) {
590
+ if (this === other)
591
+ return true;
592
+ if (!(other instanceof GpxTrack))
593
+ return false;
594
+ if (!(this.k1g_1 == other.k1g_1))
595
+ return false;
596
+ if (!(this.l1g_1 == other.l1g_1))
597
+ return false;
598
+ if (!equals(this.m1g_1, other.m1g_1))
599
+ return false;
600
+ return true;
601
+ };
602
+ function GpxTrackPoint(latitudeDeg, longitudeDeg, elevationM, timeEpochMs, heartRate, cadence, temperatureC, powerW) {
603
+ elevationM = elevationM === VOID ? null : elevationM;
604
+ timeEpochMs = timeEpochMs === VOID ? null : timeEpochMs;
605
+ heartRate = heartRate === VOID ? null : heartRate;
606
+ cadence = cadence === VOID ? null : cadence;
607
+ temperatureC = temperatureC === VOID ? null : temperatureC;
608
+ powerW = powerW === VOID ? null : powerW;
609
+ this.n1g_1 = latitudeDeg;
610
+ this.o1g_1 = longitudeDeg;
611
+ this.p1g_1 = elevationM;
612
+ this.q1g_1 = timeEpochMs;
613
+ this.r1g_1 = heartRate;
614
+ this.s1g_1 = cadence;
615
+ this.t1g_1 = temperatureC;
616
+ this.u1g_1 = powerW;
617
+ }
618
+ protoOf(GpxTrackPoint).toString = function () {
619
+ return 'GpxTrackPoint(latitudeDeg=' + this.n1g_1 + ', longitudeDeg=' + this.o1g_1 + ', elevationM=' + this.p1g_1 + ', timeEpochMs=' + toString_0(this.q1g_1) + ', heartRate=' + this.r1g_1 + ', cadence=' + this.s1g_1 + ', temperatureC=' + this.t1g_1 + ', powerW=' + this.u1g_1 + ')';
620
+ };
621
+ protoOf(GpxTrackPoint).hashCode = function () {
622
+ var result = getNumberHashCode(this.n1g_1);
623
+ result = imul(result, 31) + getNumberHashCode(this.o1g_1) | 0;
624
+ result = imul(result, 31) + (this.p1g_1 == null ? 0 : getNumberHashCode(this.p1g_1)) | 0;
625
+ result = imul(result, 31) + (this.q1g_1 == null ? 0 : this.q1g_1.hashCode()) | 0;
626
+ result = imul(result, 31) + (this.r1g_1 == null ? 0 : this.r1g_1) | 0;
627
+ result = imul(result, 31) + (this.s1g_1 == null ? 0 : this.s1g_1) | 0;
628
+ result = imul(result, 31) + (this.t1g_1 == null ? 0 : getNumberHashCode(this.t1g_1)) | 0;
629
+ result = imul(result, 31) + (this.u1g_1 == null ? 0 : getNumberHashCode(this.u1g_1)) | 0;
630
+ return result;
631
+ };
632
+ protoOf(GpxTrackPoint).equals = function (other) {
633
+ if (this === other)
634
+ return true;
635
+ if (!(other instanceof GpxTrackPoint))
636
+ return false;
637
+ if (!equals(this.n1g_1, other.n1g_1))
638
+ return false;
639
+ if (!equals(this.o1g_1, other.o1g_1))
640
+ return false;
641
+ if (!equals(this.p1g_1, other.p1g_1))
642
+ return false;
643
+ if (!equals(this.q1g_1, other.q1g_1))
644
+ return false;
645
+ if (!(this.r1g_1 == other.r1g_1))
646
+ return false;
647
+ if (!(this.s1g_1 == other.s1g_1))
648
+ return false;
649
+ if (!equals(this.t1g_1, other.t1g_1))
650
+ return false;
651
+ if (!equals(this.u1g_1, other.u1g_1))
652
+ return false;
653
+ return true;
654
+ };
655
+ function toGpxTrack(_this__u8e3s4, name, type) {
656
+ name = name === VOID ? null : name;
657
+ type = type === VOID ? 'cycling' : type;
658
+ // Inline function 'kotlin.collections.List' call
659
+ // Inline function 'kotlin.collections.MutableList' call
660
+ var size = _this__u8e3s4.v1g_1;
661
+ var list = ArrayList_init_$Create$(size);
662
+ // Inline function 'kotlin.repeat' call
663
+ var inductionVariable = 0;
664
+ if (inductionVariable < size)
665
+ do {
666
+ var index = inductionVariable;
667
+ inductionVariable = inductionVariable + 1 | 0;
668
+ var tmp = _this__u8e3s4.x1g(index) * MathConstants_getInstance().bv_1;
669
+ var tmp_0 = _this__u8e3s4.y1g(index) * MathConstants_getInstance().bv_1;
670
+ // Inline function 'kotlin.takeUnless' call
671
+ var this_0 = _this__u8e3s4.z1g(index);
672
+ var tmp_1;
673
+ if (!isNaN_0(this_0)) {
674
+ tmp_1 = this_0;
675
+ } else {
676
+ tmp_1 = null;
677
+ }
678
+ var tmp_2 = tmp_1;
679
+ // Inline function 'kotlin.takeIf' call
680
+ var this_1 = numberToLong(_this__u8e3s4.a1h(index));
681
+ var tmp_3;
682
+ if (compare(this_1, new Long(0, 0)) > 0) {
683
+ tmp_3 = this_1;
684
+ } else {
685
+ tmp_3 = null;
686
+ }
687
+ var tmp_4 = tmp_3;
688
+ // Inline function 'kotlin.takeUnless' call
689
+ var this_2 = _this__u8e3s4.b1h(index);
690
+ var tmp_5;
691
+ if (!(isNaN_0(this_2) || this_2 === 0.0)) {
692
+ tmp_5 = this_2;
693
+ } else {
694
+ tmp_5 = null;
695
+ }
696
+ var tmp0_safe_receiver = tmp_5;
697
+ var tmp_6 = tmp0_safe_receiver == null ? null : roundToInt(tmp0_safe_receiver);
698
+ // Inline function 'kotlin.takeUnless' call
699
+ var this_3 = _this__u8e3s4.c1h(index);
700
+ var tmp_7;
701
+ if (!(isNaN_0(this_3) || this_3 === 0.0)) {
702
+ tmp_7 = this_3;
703
+ } else {
704
+ tmp_7 = null;
705
+ }
706
+ var tmp1_safe_receiver = tmp_7;
707
+ var tmp_8 = tmp1_safe_receiver == null ? null : roundToInt(tmp1_safe_receiver);
708
+ // Inline function 'kotlin.takeUnless' call
709
+ var this_4 = _this__u8e3s4.d1h(index);
710
+ var tmp_9;
711
+ if (!(isNaN_0(this_4) || this_4 === 0.0)) {
712
+ tmp_9 = this_4;
713
+ } else {
714
+ tmp_9 = null;
715
+ }
716
+ var tmp_10 = tmp_9;
717
+ // Inline function 'kotlin.takeUnless' call
718
+ var this_5 = _this__u8e3s4.e1h(index);
719
+ var tmp_11;
720
+ if (!(isNaN_0(this_5) || this_5 === 0.0)) {
721
+ tmp_11 = this_5;
722
+ } else {
723
+ tmp_11 = null;
724
+ }
725
+ var tmp$ret$15 = tmp_11;
726
+ var tmp$ret$4 = new GpxTrackPoint(tmp, tmp_0, tmp_2, tmp_4, tmp_6, tmp_8, tmp_10, tmp$ret$15);
727
+ list.h(tmp$ret$4);
728
+ }
729
+ while (inductionVariable < size);
730
+ var points = list;
731
+ return new GpxTrack(name, type, points);
732
+ }
733
+ function toGpxDocument(_this__u8e3s4, name, trackName) {
734
+ name = name === VOID ? 'noname' : name;
735
+ trackName = trackName === VOID ? null : trackName;
736
+ return new GpxDocument(name, listOf(toGpxTrack(_this__u8e3s4, trackName)));
737
+ }
738
+ function parseDocument($this, reader) {
739
+ while (reader.j()) {
740
+ var ev = reader.k();
741
+ if (ev.equals(EventType_START_ELEMENT_getInstance())) {
742
+ if (!(reader.m14() === 'gpx')) {
743
+ throw IllegalArgumentException_init_$Create$('Invalid GPX file: missing gpx root element (found ' + reader.m14() + ')');
744
+ }
745
+ return parseGpxRoot($this, reader);
746
+ }
747
+ }
748
+ throw IllegalArgumentException_init_$Create$('Invalid GPX file: missing gpx root element');
749
+ }
750
+ function parseGpxRoot($this, reader) {
751
+ var name = 'noname';
752
+ // Inline function 'kotlin.collections.mutableListOf' call
753
+ var tracks = ArrayList_init_$Create$_0();
754
+ while (reader.j()) {
755
+ var ev = reader.k();
756
+ switch (ev.l1_1) {
757
+ case 1:
758
+ switch (reader.m14()) {
759
+ case 'metadata':
760
+ var metaName = parseMetadataName($this, reader);
761
+ if (!(metaName == null))
762
+ name = metaName;
763
+ break;
764
+ case 'trk':
765
+ tracks.h(parseTrack($this, reader));
766
+ break;
767
+ default:
768
+ skipElement($this, reader);
769
+ break;
770
+ }
771
+
772
+ break;
773
+ case 2:
774
+ return new GpxDocument(name, tracks);
775
+ default:
776
+ break;
777
+ }
778
+ }
779
+ return new GpxDocument(name, tracks);
780
+ }
781
+ function parseMetadataName($this, reader) {
782
+ var name = null;
783
+ while (reader.j()) {
784
+ var ev = reader.k();
785
+ switch (ev.l1_1) {
786
+ case 1:
787
+ if (reader.m14() === 'name' && name == null) {
788
+ // Inline function 'kotlin.text.trim' call
789
+ var this_0 = readElementText($this, reader);
790
+ // Inline function 'kotlin.text.ifEmpty' call
791
+ var this_1 = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
792
+ var tmp;
793
+ // Inline function 'kotlin.text.isEmpty' call
794
+ if (charSequenceLength(this_1) === 0) {
795
+ tmp = null;
796
+ } else {
797
+ tmp = this_1;
798
+ }
799
+ name = tmp;
800
+ } else {
801
+ skipElement($this, reader);
802
+ }
803
+
804
+ break;
805
+ case 2:
806
+ return name;
807
+ default:
808
+ break;
809
+ }
810
+ }
811
+ return name;
812
+ }
813
+ function parseTrack($this, reader) {
814
+ var name = null;
815
+ var type = null;
816
+ // Inline function 'kotlin.collections.mutableListOf' call
817
+ var points = ArrayList_init_$Create$_0();
818
+ while (reader.j()) {
819
+ var ev = reader.k();
820
+ switch (ev.l1_1) {
821
+ case 1:
822
+ switch (reader.m14()) {
823
+ case 'name':
824
+ // Inline function 'kotlin.text.trim' call
825
+
826
+ var this_0 = readElementText($this, reader);
827
+ // Inline function 'kotlin.text.ifEmpty' call
828
+
829
+ var this_1 = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
830
+ var tmp;
831
+ // Inline function 'kotlin.text.isEmpty' call
832
+
833
+ if (charSequenceLength(this_1) === 0) {
834
+ tmp = null;
835
+ } else {
836
+ tmp = this_1;
837
+ }
838
+
839
+ name = tmp;
840
+ break;
841
+ case 'type':
842
+ // Inline function 'kotlin.text.trim' call
843
+
844
+ var this_2 = readElementText($this, reader);
845
+ // Inline function 'kotlin.text.ifEmpty' call
846
+
847
+ var this_3 = toString(trim(isCharSequence(this_2) ? this_2 : THROW_CCE()));
848
+ var tmp_0;
849
+ // Inline function 'kotlin.text.isEmpty' call
850
+
851
+ if (charSequenceLength(this_3) === 0) {
852
+ tmp_0 = null;
853
+ } else {
854
+ tmp_0 = this_3;
855
+ }
856
+
857
+ type = tmp_0;
858
+ break;
859
+ case 'trkseg':
860
+ parseTrackSegment($this, reader, points);
861
+ break;
862
+ default:
863
+ skipElement($this, reader);
864
+ break;
865
+ }
866
+
867
+ break;
868
+ case 2:
869
+ return new GpxTrack(name, type, points);
870
+ default:
871
+ break;
872
+ }
873
+ }
874
+ return new GpxTrack(name, type, points);
875
+ }
876
+ function parseTrackSegment($this, reader, accum) {
877
+ while (reader.j()) {
878
+ var ev = reader.k();
879
+ switch (ev.l1_1) {
880
+ case 1:
881
+ if (reader.m14() === 'trkpt') {
882
+ accum.h(parseTrackPoint($this, reader));
883
+ } else {
884
+ skipElement($this, reader);
885
+ }
886
+
887
+ break;
888
+ case 2:
889
+ return Unit_instance;
890
+ default:
891
+ break;
892
+ }
893
+ }
894
+ }
895
+ function parseTrackPoint($this, reader) {
896
+ var latStr = reader.x14(null, 'lat');
897
+ var lonStr = reader.x14(null, 'lon');
898
+ var tmp;
899
+ // Inline function 'kotlin.text.isNullOrBlank' call
900
+ if (latStr == null || isBlank(latStr)) {
901
+ tmp = true;
902
+ } else {
903
+ // Inline function 'kotlin.text.isNullOrBlank' call
904
+ tmp = lonStr == null || isBlank(lonStr);
905
+ }
906
+ if (tmp) {
907
+ throw IllegalArgumentException_init_$Create$('Invalid track point: missing latitude or longitude attribute');
908
+ }
909
+ var tmp0_elvis_lhs = toDoubleOrNull(latStr);
910
+ var tmp_0;
911
+ if (tmp0_elvis_lhs == null) {
912
+ throw IllegalArgumentException_init_$Create$("Invalid track point: latitude '" + latStr + "' is not a valid number");
913
+ } else {
914
+ tmp_0 = tmp0_elvis_lhs;
915
+ }
916
+ var lat = tmp_0;
917
+ var tmp1_elvis_lhs = toDoubleOrNull(lonStr);
918
+ var tmp_1;
919
+ if (tmp1_elvis_lhs == null) {
920
+ throw IllegalArgumentException_init_$Create$("Invalid track point: longitude '" + lonStr + "' is not a valid number");
921
+ } else {
922
+ tmp_1 = tmp1_elvis_lhs;
923
+ }
924
+ var lon = tmp_1;
925
+ var elevation = null;
926
+ var timeMs = null;
927
+ var ext = new ExtensionsAccumulator();
928
+ while (reader.j()) {
929
+ var ev = reader.k();
930
+ switch (ev.l1_1) {
931
+ case 1:
932
+ switch (reader.m14()) {
933
+ case 'ele':
934
+ // Inline function 'kotlin.text.trim' call
935
+
936
+ var this_0 = readElementText($this, reader);
937
+ var txt = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
938
+ // Inline function 'kotlin.text.isNotEmpty' call
939
+
940
+ if (charSequenceLength(txt) > 0) {
941
+ var tmp4_elvis_lhs = toDoubleOrNull(txt);
942
+ elevation = tmp4_elvis_lhs == null ? elevation : tmp4_elvis_lhs;
943
+ }
944
+
945
+ break;
946
+ case 'time':
947
+ // Inline function 'kotlin.text.trim' call
948
+
949
+ var this_1 = readElementText($this, reader);
950
+ var txt_0 = toString(trim(isCharSequence(this_1) ? this_1 : THROW_CCE()));
951
+ // Inline function 'kotlin.text.isNotEmpty' call
952
+
953
+ if (charSequenceLength(txt_0) > 0)
954
+ timeMs = parseTimeIsoToMs($this, txt_0);
955
+ break;
956
+ case 'extensions':
957
+ parseExtensions($this, reader, ext);
958
+ break;
959
+ default:
960
+ skipElement($this, reader);
961
+ break;
962
+ }
963
+
964
+ break;
965
+ case 2:
966
+ return new GpxTrackPoint(lat, lon, elevation, timeMs, ext.f1h_1, ext.g1h_1, ext.h1h_1, ext.i1h_1);
967
+ default:
968
+ break;
969
+ }
970
+ }
971
+ return new GpxTrackPoint(lat, lon, elevation, timeMs, ext.f1h_1, ext.g1h_1, ext.h1h_1, ext.i1h_1);
972
+ }
973
+ function parseExtensions($this, reader, ext) {
974
+ while (reader.j()) {
975
+ var ev = reader.k();
976
+ switch (ev.l1_1) {
977
+ case 1:
978
+ var ln = reader.m14();
979
+ // Inline function 'kotlin.text.lowercase' call
980
+
981
+ // Inline function 'kotlin.js.asDynamic' call
982
+
983
+ switch (ln.toLowerCase()) {
984
+ case 'power':
985
+ var tmp2_safe_receiver = readNumeric($this, reader);
986
+ if (tmp2_safe_receiver == null)
987
+ null;
988
+ else {
989
+ // Inline function 'kotlin.let' call
990
+ var tmp = ext;
991
+ var tmp0_elvis_lhs = ext.i1h_1;
992
+ tmp.i1h_1 = tmp0_elvis_lhs == null ? tmp2_safe_receiver : tmp0_elvis_lhs;
993
+ }
994
+
995
+ break;
996
+ case 'hr':
997
+ case 'heartrate':
998
+ var tmp3_safe_receiver = readNumeric($this, reader);
999
+ if (tmp3_safe_receiver == null)
1000
+ null;
1001
+ else {
1002
+ // Inline function 'kotlin.let' call
1003
+ if (ext.f1h_1 == null)
1004
+ ext.f1h_1 = numberToInt(tmp3_safe_receiver);
1005
+ }
1006
+
1007
+ break;
1008
+ case 'cad':
1009
+ case 'cadence':
1010
+ var tmp4_safe_receiver = readNumeric($this, reader);
1011
+ if (tmp4_safe_receiver == null)
1012
+ null;
1013
+ else {
1014
+ // Inline function 'kotlin.let' call
1015
+ if (ext.g1h_1 == null)
1016
+ ext.g1h_1 = numberToInt(tmp4_safe_receiver);
1017
+ }
1018
+
1019
+ break;
1020
+ case 'atemp':
1021
+ case 'temperature':
1022
+ case 'temp':
1023
+ var tmp5_safe_receiver = readNumeric($this, reader);
1024
+ if (tmp5_safe_receiver == null)
1025
+ null;
1026
+ else {
1027
+ // Inline function 'kotlin.let' call
1028
+ var tmp_0 = ext;
1029
+ var tmp0_elvis_lhs_0 = ext.h1h_1;
1030
+ tmp_0.h1h_1 = tmp0_elvis_lhs_0 == null ? tmp5_safe_receiver : tmp0_elvis_lhs_0;
1031
+ }
1032
+
1033
+ break;
1034
+ default:
1035
+ parseExtensions($this, reader, ext);
1036
+ break;
1037
+ }
1038
+
1039
+ break;
1040
+ case 2:
1041
+ return Unit_instance;
1042
+ default:
1043
+ break;
1044
+ }
1045
+ }
1046
+ }
1047
+ function readElementText($this, reader) {
1048
+ var sb = StringBuilder_init_$Create$();
1049
+ while (reader.j()) {
1050
+ var ev = reader.k();
1051
+ switch (ev.l1_1) {
1052
+ case 4:
1053
+ case 5:
1054
+ case 9:
1055
+ sb.j5(reader.q14());
1056
+ break;
1057
+ case 1:
1058
+ skipElement($this, reader);
1059
+ break;
1060
+ case 2:
1061
+ return sb.toString();
1062
+ default:
1063
+ break;
1064
+ }
1065
+ }
1066
+ return sb.toString();
1067
+ }
1068
+ function readNumeric($this, reader) {
1069
+ // Inline function 'kotlin.text.trim' call
1070
+ var this_0 = readElementText($this, reader);
1071
+ var txt = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
1072
+ return toDoubleOrNull(txt);
1073
+ }
1074
+ function skipElement($this, reader) {
1075
+ var depth = 1;
1076
+ while (reader.j() && depth > 0) {
1077
+ switch (reader.k().l1_1) {
1078
+ case 1:
1079
+ depth = depth + 1 | 0;
1080
+ break;
1081
+ case 2:
1082
+ depth = depth - 1 | 0;
1083
+ break;
1084
+ default:
1085
+ break;
1086
+ }
1087
+ }
1088
+ }
1089
+ function parseTimeIsoToMs($this, text) {
1090
+ var tmp;
1091
+ try {
1092
+ tmp = Companion_getInstance().lb(text).pb();
1093
+ } catch ($p) {
1094
+ var tmp_0;
1095
+ if ($p instanceof IllegalArgumentException) {
1096
+ var e = $p;
1097
+ tmp_0 = null;
1098
+ } else {
1099
+ if ($p instanceof Error) {
1100
+ var e_0 = $p;
1101
+ tmp_0 = null;
1102
+ } else {
1103
+ throw $p;
1104
+ }
1105
+ }
1106
+ tmp = tmp_0;
1107
+ }
1108
+ return tmp;
1109
+ }
1110
+ function ExtensionsAccumulator(heartRate, cadence, temperatureC, powerW) {
1111
+ heartRate = heartRate === VOID ? null : heartRate;
1112
+ cadence = cadence === VOID ? null : cadence;
1113
+ temperatureC = temperatureC === VOID ? null : temperatureC;
1114
+ powerW = powerW === VOID ? null : powerW;
1115
+ this.f1h_1 = heartRate;
1116
+ this.g1h_1 = cadence;
1117
+ this.h1h_1 = temperatureC;
1118
+ this.i1h_1 = powerW;
1119
+ }
1120
+ function GpxParser() {
1121
+ }
1122
+ protoOf(GpxParser).j1h = function (xml) {
1123
+ var tmp;
1124
+ try {
1125
+ tmp = get_xmlStreaming().r15(xml);
1126
+ } catch ($p) {
1127
+ var tmp_0;
1128
+ if ($p instanceof XmlException) {
1129
+ var e = $p;
1130
+ throw IllegalArgumentException_init_$Create$_0('Invalid GPX XML: ' + e.message, e);
1131
+ } else {
1132
+ throw $p;
1133
+ }
1134
+ }
1135
+ var reader = tmp;
1136
+ var tmp_1;
1137
+ try {
1138
+ tmp_1 = parseDocument(this, reader);
1139
+ } catch ($p) {
1140
+ var tmp_2;
1141
+ if ($p instanceof XmlException) {
1142
+ var e_0 = $p;
1143
+ throw IllegalArgumentException_init_$Create$_0('Invalid GPX XML: ' + e_0.message, e_0);
1144
+ } else {
1145
+ throw $p;
1146
+ }
1147
+ }
1148
+ finally {
1149
+ reader.z14();
1150
+ }
1151
+ return tmp_1;
1152
+ };
1153
+ var GpxParser_instance;
1154
+ function GpxParser_getInstance() {
1155
+ return GpxParser_instance;
1156
+ }
1157
+ function firstTrackAsPath(_this__u8e3s4) {
1158
+ var tmp0_elvis_lhs = firstOrNull(_this__u8e3s4.j1g_1);
1159
+ var tmp;
1160
+ if (tmp0_elvis_lhs == null) {
1161
+ // Inline function 'kotlin.error' call
1162
+ var message = 'GpxDocument has no track';
1163
+ throw IllegalStateException_init_$Create$(toString(message));
1164
+ } else {
1165
+ tmp = tmp0_elvis_lhs;
1166
+ }
1167
+ var track = tmp;
1168
+ return toPath(track);
1169
+ }
1170
+ function toPath(_this__u8e3s4) {
1171
+ var n = _this__u8e3s4.m1g_1.l();
1172
+ var path = new Path(n);
1173
+ var iterator = _this__u8e3s4.m1g_1.i();
1174
+ var index = 0;
1175
+ while (iterator.j()) {
1176
+ var i = index;
1177
+ index = index + 1 | 0;
1178
+ var p = iterator.k();
1179
+ path.k1h(i, p.n1g_1 * MathConstants_getInstance().av_1);
1180
+ path.l1h(i, p.o1g_1 * MathConstants_getInstance().av_1);
1181
+ var tmp0_elvis_lhs = p.p1g_1;
1182
+ path.m1h(i, tmp0_elvis_lhs == null ? 0.0 : tmp0_elvis_lhs);
1183
+ var tmp1_elvis_lhs = p.q1g_1;
1184
+ path.n1h(i, toNumber(tmp1_elvis_lhs == null ? new Long(0, 0) : tmp1_elvis_lhs));
1185
+ var tmp2_safe_receiver = p.u1g_1;
1186
+ if (tmp2_safe_receiver == null)
1187
+ null;
1188
+ else {
1189
+ // Inline function 'kotlin.let' call
1190
+ path.o1h(i, tmp2_safe_receiver);
1191
+ }
1192
+ var tmp3_safe_receiver = p.r1g_1;
1193
+ if (tmp3_safe_receiver == null)
1194
+ null;
1195
+ else {
1196
+ // Inline function 'kotlin.let' call
1197
+ path.p1h(i, tmp3_safe_receiver);
1198
+ }
1199
+ var tmp4_safe_receiver = p.s1g_1;
1200
+ if (tmp4_safe_receiver == null)
1201
+ null;
1202
+ else {
1203
+ // Inline function 'kotlin.let' call
1204
+ path.q1h(i, tmp4_safe_receiver);
1205
+ }
1206
+ var tmp5_safe_receiver = p.t1g_1;
1207
+ if (tmp5_safe_receiver == null)
1208
+ null;
1209
+ else {
1210
+ // Inline function 'kotlin.let' call
1211
+ path.r1h(i, tmp5_safe_receiver);
1212
+ }
1213
+ }
1214
+ path.b1i();
1215
+ return path;
1216
+ }
1217
+ function writeDocument($this, w, document) {
1218
+ w.a16('', 'http://www.topografix.com/GPX/1/1');
1219
+ w.a16('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
1220
+ w.a16('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1');
1221
+ w.c16('http://www.topografix.com/GPX/1/1', 'gpx', '');
1222
+ w.e16(null, 'version', null, '1.1');
1223
+ w.e16(null, 'creator', null, '@glandais/vcyclist');
1224
+ w.b16('', 'http://www.topografix.com/GPX/1/1');
1225
+ w.b16('xsi', 'http://www.w3.org/2001/XMLSchema-instance');
1226
+ w.b16('gpxtpx', 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1');
1227
+ w.e16('http://www.w3.org/2001/XMLSchema-instance', 'schemaLocation', 'xsi', 'http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd');
1228
+ writeMetadata($this, w, document.i1g_1);
1229
+ var _iterator__ex2g4s = document.j1g_1.i();
1230
+ while (_iterator__ex2g4s.j()) {
1231
+ var track = _iterator__ex2g4s.k();
1232
+ writeTrack($this, w, track);
1233
+ }
1234
+ w.h16('http://www.topografix.com/GPX/1/1', 'gpx', '');
1235
+ }
1236
+ function writeMetadata($this, w, name) {
1237
+ w.c16('http://www.topografix.com/GPX/1/1', 'metadata', '');
1238
+ writeSimpleText($this, w, 'name', name);
1239
+ w.h16('http://www.topografix.com/GPX/1/1', 'metadata', '');
1240
+ }
1241
+ function writeTrack($this, w, track) {
1242
+ w.c16('http://www.topografix.com/GPX/1/1', 'trk', '');
1243
+ var tmp0_safe_receiver = track.k1g_1;
1244
+ if (tmp0_safe_receiver == null)
1245
+ null;
1246
+ else {
1247
+ // Inline function 'kotlin.let' call
1248
+ writeSimpleText(GpxWriter_instance, w, 'name', tmp0_safe_receiver);
1249
+ }
1250
+ var tmp1_safe_receiver = track.l1g_1;
1251
+ if (tmp1_safe_receiver == null)
1252
+ null;
1253
+ else {
1254
+ // Inline function 'kotlin.let' call
1255
+ writeSimpleText(GpxWriter_instance, w, 'type', tmp1_safe_receiver);
1256
+ }
1257
+ w.c16('http://www.topografix.com/GPX/1/1', 'trkseg', '');
1258
+ var _iterator__ex2g4s = track.m1g_1.i();
1259
+ while (_iterator__ex2g4s.j()) {
1260
+ var p = _iterator__ex2g4s.k();
1261
+ writeTrackPoint($this, w, p);
1262
+ }
1263
+ w.h16('http://www.topografix.com/GPX/1/1', 'trkseg', '');
1264
+ w.h16('http://www.topografix.com/GPX/1/1', 'trk', '');
1265
+ }
1266
+ function writeTrackPoint($this, w, p) {
1267
+ w.c16('http://www.topografix.com/GPX/1/1', 'trkpt', '');
1268
+ w.e16(null, 'lat', null, p.n1g_1.toString());
1269
+ w.e16(null, 'lon', null, p.o1g_1.toString());
1270
+ var tmp0_safe_receiver = p.q1g_1;
1271
+ if (tmp0_safe_receiver == null)
1272
+ null;
1273
+ else {
1274
+ // Inline function 'kotlin.let' call
1275
+ writeSimpleText(GpxWriter_instance, w, 'time', Companion_getInstance().ib(tmp0_safe_receiver).toString());
1276
+ }
1277
+ var tmp1_safe_receiver = p.p1g_1;
1278
+ if (tmp1_safe_receiver == null)
1279
+ null;
1280
+ else {
1281
+ // Inline function 'kotlin.let' call
1282
+ writeSimpleText(GpxWriter_instance, w, 'ele', tmp1_safe_receiver.toString());
1283
+ }
1284
+ var hasGarminExt = !(p.r1g_1 == null) || !(p.s1g_1 == null) || !(p.t1g_1 == null);
1285
+ var hasPower = !(p.u1g_1 == null);
1286
+ if (hasGarminExt || hasPower) {
1287
+ w.c16('http://www.topografix.com/GPX/1/1', 'extensions', '');
1288
+ if (hasPower) {
1289
+ writeSimpleText($this, w, 'power', p.u1g_1.toString());
1290
+ }
1291
+ if (hasGarminExt) {
1292
+ w.c16('http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'TrackPointExtension', 'gpxtpx');
1293
+ var tmp2_safe_receiver = p.r1g_1;
1294
+ if (tmp2_safe_receiver == null)
1295
+ null;
1296
+ else {
1297
+ // Inline function 'kotlin.let' call
1298
+ writeNamespaced(GpxWriter_instance, w, 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'hr', 'gpxtpx', tmp2_safe_receiver.toString());
1299
+ }
1300
+ var tmp3_safe_receiver = p.s1g_1;
1301
+ if (tmp3_safe_receiver == null)
1302
+ null;
1303
+ else {
1304
+ // Inline function 'kotlin.let' call
1305
+ writeNamespaced(GpxWriter_instance, w, 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'cad', 'gpxtpx', tmp3_safe_receiver.toString());
1306
+ }
1307
+ var tmp4_safe_receiver = p.t1g_1;
1308
+ if (tmp4_safe_receiver == null)
1309
+ null;
1310
+ else {
1311
+ // Inline function 'kotlin.let' call
1312
+ writeNamespaced(GpxWriter_instance, w, 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'atemp', 'gpxtpx', tmp4_safe_receiver.toString());
1313
+ }
1314
+ w.h16('http://www.garmin.com/xmlschemas/TrackPointExtension/v1', 'TrackPointExtension', 'gpxtpx');
1315
+ }
1316
+ w.h16('http://www.topografix.com/GPX/1/1', 'extensions', '');
1317
+ }
1318
+ w.h16('http://www.topografix.com/GPX/1/1', 'trkpt', '');
1319
+ }
1320
+ function writeSimpleText($this, w, localName, text) {
1321
+ w.c16('http://www.topografix.com/GPX/1/1', localName, '');
1322
+ w.d16(text);
1323
+ w.h16('http://www.topografix.com/GPX/1/1', localName, '');
1324
+ }
1325
+ function writeNamespaced($this, w, namespace, localName, prefix, text) {
1326
+ w.c16(namespace, localName, prefix);
1327
+ w.d16(text);
1328
+ w.h16(namespace, localName, prefix);
1329
+ }
1330
+ function GpxWriter() {
1331
+ this.c1i_1 = 'http://www.topografix.com/GPX/1/1';
1332
+ this.d1i_1 = 'http://www.w3.org/2001/XMLSchema-instance';
1333
+ this.e1i_1 = 'http://www.garmin.com/xmlschemas/TrackPointExtension/v1';
1334
+ this.f1i_1 = 'xsi';
1335
+ this.g1i_1 = 'gpxtpx';
1336
+ this.h1i_1 = 'http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd';
1337
+ this.i1i_1 = '@glandais/vcyclist';
1338
+ }
1339
+ protoOf(GpxWriter).j1i = function (document) {
1340
+ var out = StringBuilder_init_$Create$();
1341
+ out.j5('<?xml version="1.0" encoding="UTF-8"?>\n');
1342
+ var writer = newGenericWriter(get_xmlStreaming(), out, false, XmlDeclMode_None_getInstance());
1343
+ try {
1344
+ writeDocument(this, writer, document);
1345
+ }finally {
1346
+ writer.z14();
1347
+ }
1348
+ return out.toString();
1349
+ };
1350
+ var GpxWriter_instance;
1351
+ function GpxWriter_getInstance() {
1352
+ return GpxWriter_instance;
1353
+ }
1354
+ function copyAllSlots($this, source) {
1355
+ var out = new Path(source.v1g_1);
1356
+ var inductionVariable = 0;
1357
+ var last = source.v1g_1;
1358
+ if (inductionVariable < last)
1359
+ do {
1360
+ var i = inductionVariable;
1361
+ inductionVariable = inductionVariable + 1 | 0;
1362
+ var _iterator__ex2g4s = get_entries().i();
1363
+ while (_iterator__ex2g4s.j()) {
1364
+ var field = _iterator__ex2g4s.k();
1365
+ out.l1i(i, field, source.k1i(i, field));
1366
+ }
1367
+ }
1368
+ while (inductionVariable < last);
1369
+ return out;
1370
+ }
1371
+ function $fixElevationCOROUTINE$(_this__u8e3s4, source, provider, resultContinuation) {
1372
+ CoroutineImpl.call(this, resultContinuation);
1373
+ this.u1i_1 = _this__u8e3s4;
1374
+ this.v1i_1 = source;
1375
+ this.w1i_1 = provider;
1376
+ }
1377
+ protoOf($fixElevationCOROUTINE$).c6 = function () {
1378
+ var suspendResult = this.w5_1;
1379
+ $sm: do
1380
+ try {
1381
+ var tmp = this.u5_1;
1382
+ switch (tmp) {
1383
+ case 0:
1384
+ this.v5_1 = 2;
1385
+ if (this.v1i_1.v1g_1 === 0)
1386
+ return new Path(0);
1387
+ var size = this.v1i_1.v1g_1;
1388
+ var list = ArrayList_init_$Create$(size);
1389
+ var inductionVariable = 0;
1390
+ if (inductionVariable < size)
1391
+ do {
1392
+ var index = inductionVariable;
1393
+ inductionVariable = inductionVariable + 1 | 0;
1394
+ list.h(new LatLon(this.v1i_1.x1g(index) * MathConstants_getInstance().bv_1, this.v1i_1.y1g(index) * MathConstants_getInstance().bv_1));
1395
+ }
1396
+ while (inductionVariable < size);
1397
+ var coords = list;
1398
+ this.u5_1 = 1;
1399
+ suspendResult = this.w1i_1.xy(coords, VOID, this);
1400
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1401
+ return suspendResult;
1402
+ }
1403
+
1404
+ continue $sm;
1405
+ case 1:
1406
+ var corrected = suspendResult;
1407
+ var out = copyAllSlots(this.u1i_1, this.v1i_1);
1408
+ var inductionVariable_0 = 0;
1409
+ var last = out.v1g_1;
1410
+ if (inductionVariable_0 < last)
1411
+ do {
1412
+ var i = inductionVariable_0;
1413
+ inductionVariable_0 = inductionVariable_0 + 1 | 0;
1414
+ out.m1h(i, corrected.m(i).fv());
1415
+ }
1416
+ while (inductionVariable_0 < last);
1417
+ out.b1i();
1418
+ return out;
1419
+ case 2:
1420
+ throw this.x5_1;
1421
+ }
1422
+ } catch ($p) {
1423
+ var e = $p;
1424
+ if (this.v5_1 === 2) {
1425
+ throw e;
1426
+ } else {
1427
+ this.u5_1 = this.v5_1;
1428
+ this.x5_1 = e;
1429
+ }
1430
+ }
1431
+ while (true);
1432
+ };
1433
+ function ElevationStep() {
1434
+ this.s1f_1 = 150.0;
1435
+ }
1436
+ protoOf(ElevationStep).t1f = function (source, provider, $completion) {
1437
+ var tmp = new $fixElevationCOROUTINE$(this, source, provider, $completion);
1438
+ tmp.w5_1 = Unit_instance;
1439
+ tmp.x5_1 = null;
1440
+ return tmp.c6();
1441
+ };
1442
+ protoOf(ElevationStep).x1i = function (source, windowM) {
1443
+ if (source.v1g_1 === 0)
1444
+ return new Path(0);
1445
+ // Inline function 'kotlin.collections.List' call
1446
+ // Inline function 'kotlin.collections.MutableList' call
1447
+ var size = source.v1g_1;
1448
+ var list = ArrayList_init_$Create$(size);
1449
+ // Inline function 'kotlin.repeat' call
1450
+ var inductionVariable = 0;
1451
+ if (inductionVariable < size)
1452
+ do {
1453
+ var index = inductionVariable;
1454
+ inductionVariable = inductionVariable + 1 | 0;
1455
+ var tmp$ret$4 = source.y1i(index);
1456
+ list.h(tmp$ret$4);
1457
+ }
1458
+ while (inductionVariable < size);
1459
+ var coords = list;
1460
+ var smoothed = ElevationSmoother_instance.uu(coords, windowM);
1461
+ var out = copyAllSlots(this, source);
1462
+ var inductionVariable_0 = 0;
1463
+ var last = out.v1g_1;
1464
+ if (inductionVariable_0 < last)
1465
+ do {
1466
+ var i = inductionVariable_0;
1467
+ inductionVariable_0 = inductionVariable_0 + 1 | 0;
1468
+ out.m1h(i, smoothed.m(i).fv());
1469
+ }
1470
+ while (inductionVariable_0 < last);
1471
+ out.b1i();
1472
+ return out;
1473
+ };
1474
+ protoOf(ElevationStep).u1f = function (source, windowM, $super) {
1475
+ windowM = windowM === VOID ? 150.0 : windowM;
1476
+ return $super === VOID ? this.x1i(source, windowM) : $super.x1i.call(this, source, windowM);
1477
+ };
1478
+ var ElevationStep_instance;
1479
+ function ElevationStep_getInstance() {
1480
+ return ElevationStep_instance;
1481
+ }
1482
+ function GeneratedPath(size) {
1483
+ this.v1g_1 = size;
1484
+ // Inline function 'kotlin.require' call
1485
+ if (!(this.v1g_1 >= 0)) {
1486
+ var message = 'Negative size: ' + this.v1g_1;
1487
+ throw IllegalArgumentException_init_$Create$(toString(message));
1488
+ }
1489
+ this.w1g_1 = new Float64Array(imul(this.v1g_1, 36));
1490
+ }
1491
+ protoOf(GeneratedPath).k1i = function (i, field) {
1492
+ return this.w1g_1[imul(i, 36) + field.l1_1 | 0];
1493
+ };
1494
+ protoOf(GeneratedPath).l1i = function (i, field, v) {
1495
+ this.w1g_1[imul(i, 36) + field.l1_1 | 0] = v;
1496
+ };
1497
+ protoOf(GeneratedPath).x1g = function (i) {
1498
+ return this.w1g_1[imul(i, 36) + 0 | 0];
1499
+ };
1500
+ protoOf(GeneratedPath).k1h = function (i, v) {
1501
+ this.w1g_1[imul(i, 36) + 0 | 0] = v;
1502
+ };
1503
+ protoOf(GeneratedPath).y1g = function (i) {
1504
+ return this.w1g_1[imul(i, 36) + 1 | 0];
1505
+ };
1506
+ protoOf(GeneratedPath).l1h = function (i, v) {
1507
+ this.w1g_1[imul(i, 36) + 1 | 0] = v;
1508
+ };
1509
+ protoOf(GeneratedPath).z1i = function (i) {
1510
+ return this.w1g_1[imul(i, 36) + 2 | 0];
1511
+ };
1512
+ protoOf(GeneratedPath).a1j = function (i, v) {
1513
+ this.w1g_1[imul(i, 36) + 2 | 0] = v;
1514
+ };
1515
+ protoOf(GeneratedPath).b1j = function (i, v) {
1516
+ this.w1g_1[imul(i, 36) + 3 | 0] = v;
1517
+ };
1518
+ protoOf(GeneratedPath).a1h = function (i) {
1519
+ return this.w1g_1[imul(i, 36) + 4 | 0];
1520
+ };
1521
+ protoOf(GeneratedPath).n1h = function (i, v) {
1522
+ this.w1g_1[imul(i, 36) + 4 | 0] = v;
1523
+ };
1524
+ protoOf(GeneratedPath).c1j = function (i, v) {
1525
+ this.w1g_1[imul(i, 36) + 5 | 0] = v;
1526
+ };
1527
+ protoOf(GeneratedPath).d1j = function (i) {
1528
+ return this.w1g_1[imul(i, 36) + 6 | 0];
1529
+ };
1530
+ protoOf(GeneratedPath).e1j = function (i, v) {
1531
+ this.w1g_1[imul(i, 36) + 6 | 0] = v;
1532
+ };
1533
+ protoOf(GeneratedPath).f1j = function (i) {
1534
+ return this.w1g_1[imul(i, 36) + 7 | 0];
1535
+ };
1536
+ protoOf(GeneratedPath).g1j = function (i, v) {
1537
+ this.w1g_1[imul(i, 36) + 7 | 0] = v;
1538
+ };
1539
+ protoOf(GeneratedPath).z1g = function (i) {
1540
+ return this.w1g_1[imul(i, 36) + 8 | 0];
1541
+ };
1542
+ protoOf(GeneratedPath).m1h = function (i, v) {
1543
+ this.w1g_1[imul(i, 36) + 8 | 0] = v;
1544
+ };
1545
+ protoOf(GeneratedPath).h1j = function (i) {
1546
+ return this.w1g_1[imul(i, 36) + 9 | 0];
1547
+ };
1548
+ protoOf(GeneratedPath).i1j = function (i, v) {
1549
+ this.w1g_1[imul(i, 36) + 9 | 0] = v;
1550
+ };
1551
+ protoOf(GeneratedPath).j1j = function (i, v) {
1552
+ this.w1g_1[imul(i, 36) + 10 | 0] = v;
1553
+ };
1554
+ protoOf(GeneratedPath).k1j = function (i, v) {
1555
+ this.w1g_1[imul(i, 36) + 11 | 0] = v;
1556
+ };
1557
+ protoOf(GeneratedPath).l1j = function (i, v) {
1558
+ this.w1g_1[imul(i, 36) + 12 | 0] = v;
1559
+ };
1560
+ protoOf(GeneratedPath).m1j = function (i, v) {
1561
+ this.w1g_1[imul(i, 36) + 13 | 0] = v;
1562
+ };
1563
+ protoOf(GeneratedPath).n1j = function (i, v) {
1564
+ this.w1g_1[imul(i, 36) + 14 | 0] = v;
1565
+ };
1566
+ protoOf(GeneratedPath).o1j = function (i, v) {
1567
+ this.w1g_1[imul(i, 36) + 15 | 0] = v;
1568
+ };
1569
+ protoOf(GeneratedPath).p1j = function (i, v) {
1570
+ this.w1g_1[imul(i, 36) + 16 | 0] = v;
1571
+ };
1572
+ protoOf(GeneratedPath).q1j = function (i, v) {
1573
+ this.w1g_1[imul(i, 36) + 17 | 0] = v;
1574
+ };
1575
+ protoOf(GeneratedPath).e1h = function (i) {
1576
+ return this.w1g_1[imul(i, 36) + 18 | 0];
1577
+ };
1578
+ protoOf(GeneratedPath).o1h = function (i, v) {
1579
+ this.w1g_1[imul(i, 36) + 18 | 0] = v;
1580
+ };
1581
+ protoOf(GeneratedPath).r1j = function (i, v) {
1582
+ this.w1g_1[imul(i, 36) + 19 | 0] = v;
1583
+ };
1584
+ protoOf(GeneratedPath).s1j = function (i, v) {
1585
+ this.w1g_1[imul(i, 36) + 20 | 0] = v;
1586
+ };
1587
+ protoOf(GeneratedPath).t1j = function (i, v) {
1588
+ this.w1g_1[imul(i, 36) + 21 | 0] = v;
1589
+ };
1590
+ protoOf(GeneratedPath).u1j = function (i, v) {
1591
+ this.w1g_1[imul(i, 36) + 22 | 0] = v;
1592
+ };
1593
+ protoOf(GeneratedPath).v1j = function (i, v) {
1594
+ this.w1g_1[imul(i, 36) + 23 | 0] = v;
1595
+ };
1596
+ protoOf(GeneratedPath).w1j = function (i, v) {
1597
+ this.w1g_1[imul(i, 36) + 24 | 0] = v;
1598
+ };
1599
+ protoOf(GeneratedPath).x1j = function (i, v) {
1600
+ this.w1g_1[imul(i, 36) + 25 | 0] = v;
1601
+ };
1602
+ protoOf(GeneratedPath).y1j = function (i) {
1603
+ return this.w1g_1[imul(i, 36) + 26 | 0];
1604
+ };
1605
+ protoOf(GeneratedPath).z1j = function (i, v) {
1606
+ this.w1g_1[imul(i, 36) + 26 | 0] = v;
1607
+ };
1608
+ protoOf(GeneratedPath).a1k = function (i) {
1609
+ return this.w1g_1[imul(i, 36) + 27 | 0];
1610
+ };
1611
+ protoOf(GeneratedPath).b1k = function (i, v) {
1612
+ this.w1g_1[imul(i, 36) + 27 | 0] = v;
1613
+ };
1614
+ protoOf(GeneratedPath).c1k = function (i) {
1615
+ return this.w1g_1[imul(i, 36) + 28 | 0];
1616
+ };
1617
+ protoOf(GeneratedPath).d1k = function (i, v) {
1618
+ this.w1g_1[imul(i, 36) + 28 | 0] = v;
1619
+ };
1620
+ protoOf(GeneratedPath).e1k = function (i, v) {
1621
+ this.w1g_1[imul(i, 36) + 29 | 0] = v;
1622
+ };
1623
+ protoOf(GeneratedPath).f1k = function (i, v) {
1624
+ this.w1g_1[imul(i, 36) + 30 | 0] = v;
1625
+ };
1626
+ protoOf(GeneratedPath).d1h = function (i) {
1627
+ return this.w1g_1[imul(i, 36) + 31 | 0];
1628
+ };
1629
+ protoOf(GeneratedPath).r1h = function (i, v) {
1630
+ this.w1g_1[imul(i, 36) + 31 | 0] = v;
1631
+ };
1632
+ protoOf(GeneratedPath).g1k = function (i, v) {
1633
+ this.w1g_1[imul(i, 36) + 32 | 0] = v;
1634
+ };
1635
+ protoOf(GeneratedPath).h1k = function (i, v) {
1636
+ this.w1g_1[imul(i, 36) + 33 | 0] = v;
1637
+ };
1638
+ protoOf(GeneratedPath).b1h = function (i) {
1639
+ return this.w1g_1[imul(i, 36) + 34 | 0];
1640
+ };
1641
+ protoOf(GeneratedPath).p1h = function (i, v) {
1642
+ this.w1g_1[imul(i, 36) + 34 | 0] = v;
1643
+ };
1644
+ protoOf(GeneratedPath).c1h = function (i) {
1645
+ return this.w1g_1[imul(i, 36) + 35 | 0];
1646
+ };
1647
+ protoOf(GeneratedPath).q1h = function (i, v) {
1648
+ this.w1g_1[imul(i, 36) + 35 | 0] = v;
1649
+ };
1650
+ function Companion_3() {
1651
+ Companion_instance_3 = this;
1652
+ this.i1k_1 = new BoundsRad(0.0, 0.0, 0.0, 0.0);
1653
+ }
1654
+ var Companion_instance_3;
1655
+ function Companion_getInstance_4() {
1656
+ if (Companion_instance_3 == null)
1657
+ new Companion_3();
1658
+ return Companion_instance_3;
1659
+ }
1660
+ function BoundsRad(minLat, maxLat, minLon, maxLon) {
1661
+ Companion_getInstance_4();
1662
+ this.j1k_1 = minLat;
1663
+ this.k1k_1 = maxLat;
1664
+ this.l1k_1 = minLon;
1665
+ this.m1k_1 = maxLon;
1666
+ }
1667
+ protoOf(BoundsRad).toString = function () {
1668
+ return 'BoundsRad(minLat=' + this.j1k_1 + ', maxLat=' + this.k1k_1 + ', minLon=' + this.l1k_1 + ', maxLon=' + this.m1k_1 + ')';
1669
+ };
1670
+ protoOf(BoundsRad).hashCode = function () {
1671
+ var result = getNumberHashCode(this.j1k_1);
1672
+ result = imul(result, 31) + getNumberHashCode(this.k1k_1) | 0;
1673
+ result = imul(result, 31) + getNumberHashCode(this.l1k_1) | 0;
1674
+ result = imul(result, 31) + getNumberHashCode(this.m1k_1) | 0;
1675
+ return result;
1676
+ };
1677
+ protoOf(BoundsRad).equals = function (other) {
1678
+ if (this === other)
1679
+ return true;
1680
+ if (!(other instanceof BoundsRad))
1681
+ return false;
1682
+ if (!equals(this.j1k_1, other.j1k_1))
1683
+ return false;
1684
+ if (!equals(this.k1k_1, other.k1k_1))
1685
+ return false;
1686
+ if (!equals(this.l1k_1, other.l1k_1))
1687
+ return false;
1688
+ if (!equals(this.m1k_1, other.m1k_1))
1689
+ return false;
1690
+ return true;
1691
+ };
1692
+ function copyStatsFrom($this, other) {
1693
+ $this.u1h_1 = other.u1h_1;
1694
+ $this.v1h_1 = other.v1h_1;
1695
+ $this.w1h_1 = other.w1h_1;
1696
+ $this.x1h_1 = other.x1h_1;
1697
+ $this.y1h_1 = other.y1h_1;
1698
+ $this.z1h_1 = other.z1h_1;
1699
+ $this.a1i_1 = other.a1i_1;
1700
+ }
1701
+ function resetStats($this) {
1702
+ $this.u1h_1 = 0.0;
1703
+ $this.v1h_1 = 0.0;
1704
+ $this.w1h_1 = 0.0;
1705
+ $this.x1h_1 = 0.0;
1706
+ $this.y1h_1 = 0.0;
1707
+ $this.z1h_1 = 0.0;
1708
+ $this.a1i_1 = Companion_getInstance_4().i1k_1;
1709
+ }
1710
+ function computeBearing($this, from, to) {
1711
+ var lat1 = $this.x1g(from);
1712
+ var lon1 = $this.y1g(from);
1713
+ var lat2 = $this.x1g(to);
1714
+ var lon2 = $this.y1g(to);
1715
+ // Inline function 'kotlin.math.cos' call
1716
+ var x1 = lon1 * Math.cos(lat1);
1717
+ var y1 = lat1;
1718
+ // Inline function 'kotlin.math.cos' call
1719
+ var x2 = lon2 * Math.cos(lat2);
1720
+ var y2 = lat2;
1721
+ var dy = y2 - y1;
1722
+ var dx = x2 - x1;
1723
+ // Inline function 'kotlin.math.atan2' call
1724
+ var y = -dy;
1725
+ return Math.atan2(y, dx);
1726
+ }
1727
+ function Companion_4() {
1728
+ }
1729
+ var Companion_instance_4;
1730
+ function Companion_getInstance_5() {
1731
+ return Companion_instance_4;
1732
+ }
1733
+ function Path(size) {
1734
+ GeneratedPath.call(this, size);
1735
+ this.u1h_1 = 0.0;
1736
+ this.v1h_1 = 0.0;
1737
+ this.w1h_1 = 0.0;
1738
+ this.x1h_1 = 0.0;
1739
+ this.y1h_1 = 0.0;
1740
+ this.z1h_1 = 0.0;
1741
+ this.a1i_1 = Companion_getInstance_4().i1k_1;
1742
+ }
1743
+ protoOf(Path).n1k = function () {
1744
+ return until(0, this.v1g_1);
1745
+ };
1746
+ protoOf(Path).o1k = function (i) {
1747
+ return this.x1g(i) * MathConstants_getInstance().bv_1;
1748
+ };
1749
+ protoOf(Path).p1k = function (i) {
1750
+ return this.y1g(i) * MathConstants_getInstance().bv_1;
1751
+ };
1752
+ protoOf(Path).y1i = function (i) {
1753
+ return new LatLonElevation(this.o1k(i), this.p1k(i), this.z1g(i));
1754
+ };
1755
+ protoOf(Path).q1k = function () {
1756
+ var out = new Path(this.v1g_1);
1757
+ var tmp0 = this.w1g_1;
1758
+ var tmp2 = out.w1g_1;
1759
+ // Inline function 'kotlin.collections.copyInto' call
1760
+ var endIndex = this.w1g_1.length;
1761
+ // Inline function 'kotlin.js.unsafeCast' call
1762
+ // Inline function 'kotlin.js.asDynamic' call
1763
+ var tmp = tmp0;
1764
+ // Inline function 'kotlin.js.unsafeCast' call
1765
+ // Inline function 'kotlin.js.asDynamic' call
1766
+ arrayCopy(tmp, tmp2, 0, 0, endIndex);
1767
+ copyStatsFrom(out, this);
1768
+ return out;
1769
+ };
1770
+ protoOf(Path).b1i = function () {
1771
+ resetStats(this);
1772
+ if (this.v1g_1 === 0)
1773
+ return Unit_instance;
1774
+ var timeStart = this.a1h(0);
1775
+ var cumDist = 0.0;
1776
+ var minLat = Infinity;
1777
+ var maxLat = -Infinity;
1778
+ var minLon = Infinity;
1779
+ var maxLon = -Infinity;
1780
+ var minEle = Infinity;
1781
+ var maxEle = -Infinity;
1782
+ var gain = 0.0;
1783
+ var loss = 0.0;
1784
+ var inductionVariable = 0;
1785
+ var last = this.v1g_1;
1786
+ if (inductionVariable < last)
1787
+ do {
1788
+ var i = inductionVariable;
1789
+ inductionVariable = inductionVariable + 1 | 0;
1790
+ var lat = this.x1g(i);
1791
+ var lon = this.y1g(i);
1792
+ var ele = this.z1g(i);
1793
+ // Inline function 'kotlin.math.min' call
1794
+ var a = minLat;
1795
+ minLat = Math.min(a, lat);
1796
+ // Inline function 'kotlin.math.max' call
1797
+ var a_0 = maxLat;
1798
+ maxLat = Math.max(a_0, lat);
1799
+ // Inline function 'kotlin.math.min' call
1800
+ var a_1 = minLon;
1801
+ minLon = Math.min(a_1, lon);
1802
+ // Inline function 'kotlin.math.max' call
1803
+ var a_2 = maxLon;
1804
+ maxLon = Math.max(a_2, lon);
1805
+ // Inline function 'kotlin.math.min' call
1806
+ var a_3 = minEle;
1807
+ minEle = Math.min(a_3, ele);
1808
+ // Inline function 'kotlin.math.max' call
1809
+ var a_4 = maxEle;
1810
+ maxEle = Math.max(a_4, ele);
1811
+ if (i > 0) {
1812
+ var prevCoord = new LatLon(this.o1k(i - 1 | 0), this.p1k(i - 1 | 0));
1813
+ var curCoord = new LatLon(this.o1k(i), this.p1k(i));
1814
+ cumDist = cumDist + Distance_instance.yu(prevCoord, curCoord);
1815
+ var dEle = ele - this.z1g(i - 1 | 0);
1816
+ if (dEle > 0)
1817
+ gain = gain + dEle;
1818
+ else
1819
+ loss = loss + dEle;
1820
+ }
1821
+ this.a1j(i, cumDist);
1822
+ }
1823
+ while (inductionVariable < last);
1824
+ this.u1h_1 = cumDist;
1825
+ this.v1h_1 = minEle === Infinity ? 0.0 : minEle;
1826
+ this.w1h_1 = maxEle === -Infinity ? 0.0 : maxEle;
1827
+ this.x1h_1 = gain;
1828
+ this.y1h_1 = loss;
1829
+ this.a1i_1 = new BoundsRad(minLat, maxLat, minLon, maxLon);
1830
+ this.z1h_1 = this.v1g_1 >= 2 ? this.a1h(this.v1g_1 - 1 | 0) - timeStart : 0.0;
1831
+ var inductionVariable_0 = 0;
1832
+ var last_0 = this.v1g_1;
1833
+ if (inductionVariable_0 < last_0)
1834
+ $l$loop: do {
1835
+ var i_0 = inductionVariable_0;
1836
+ inductionVariable_0 = inductionVariable_0 + 1 | 0;
1837
+ this.c1j(i_0, (this.a1h(i_0) - timeStart) / 1000.0);
1838
+ if (this.v1g_1 <= 1)
1839
+ continue $l$loop;
1840
+ // Inline function 'kotlin.math.max' call
1841
+ var b = i_0 - 1 | 0;
1842
+ var im1 = Math.max(0, b);
1843
+ var tmp0 = this.v1g_1 - 1 | 0;
1844
+ // Inline function 'kotlin.math.min' call
1845
+ var b_0 = i_0 + 1 | 0;
1846
+ var ip1 = Math.min(tmp0, b_0);
1847
+ this.g1j(i_0, computeBearing(this, im1, ip1));
1848
+ var dDist = (this.z1i(ip1) - this.z1i(im1)) / 2.0;
1849
+ var dEle_0 = (this.z1g(ip1) - this.z1g(im1)) / 2.0;
1850
+ var grade = dDist === 0.0 ? 0.0 : dEle_0 / dDist;
1851
+ this.i1j(i_0, grade);
1852
+ var dTime = (this.a1h(ip1) - this.a1h(im1)) / 2000.0;
1853
+ this.b1j(i_0, dDist);
1854
+ this.e1j(i_0, dTime);
1855
+ this.b1k(i_0, dTime === 0.0 ? 0.0 : dDist / dTime);
1856
+ }
1857
+ while (inductionVariable_0 < last_0);
1858
+ };
1859
+ function PathSimplifier() {
1860
+ }
1861
+ protoOf(PathSimplifier).e1g = function (path, toleranceM, zExaggeration) {
1862
+ if (path.v1g_1 <= 2)
1863
+ return path.q1k();
1864
+ var coords = ArrayList_init_$Create$(path.v1g_1);
1865
+ var inductionVariable = 0;
1866
+ var last = path.v1g_1;
1867
+ if (inductionVariable < last)
1868
+ do {
1869
+ var i = inductionVariable;
1870
+ inductionVariable = inductionVariable + 1 | 0;
1871
+ // Inline function 'kotlin.collections.plusAssign' call
1872
+ var element = new LatLonElevation(path.x1g(i) * MathConstants_getInstance().bv_1, path.y1g(i) * MathConstants_getInstance().bv_1, path.z1g(i));
1873
+ coords.h(element);
1874
+ }
1875
+ while (inductionVariable < last);
1876
+ var simplified = DouglasPeucker_instance.vu(coords, toleranceM, zExaggeration);
1877
+ var retainedIndices = ArrayList_init_$Create$(simplified.l());
1878
+ var cursor = 0;
1879
+ var _iterator__ex2g4s = simplified.i();
1880
+ while (_iterator__ex2g4s.j()) {
1881
+ var kept = _iterator__ex2g4s.k();
1882
+ while (cursor < coords.l() && !(coords.m(cursor) === kept)) {
1883
+ cursor = cursor + 1 | 0;
1884
+ }
1885
+ if (cursor === coords.l()) {
1886
+ // Inline function 'kotlin.error' call
1887
+ var message = 'PathSimplifier: retained point not found in source';
1888
+ throw IllegalStateException_init_$Create$(toString(message));
1889
+ }
1890
+ // Inline function 'kotlin.collections.plusAssign' call
1891
+ var element_0 = cursor;
1892
+ retainedIndices.h(element_0);
1893
+ cursor = cursor + 1 | 0;
1894
+ }
1895
+ var out = new Path(retainedIndices.l());
1896
+ var iterator = retainedIndices.i();
1897
+ var index = 0;
1898
+ while (iterator.j()) {
1899
+ var dstIdx = index;
1900
+ index = index + 1 | 0;
1901
+ var srcIdx = iterator.k();
1902
+ var _iterator__ex2g4s_0 = get_entries().i();
1903
+ while (_iterator__ex2g4s_0.j()) {
1904
+ var field = _iterator__ex2g4s_0.k();
1905
+ out.l1i(dstIdx, field, path.k1i(srcIdx, field));
1906
+ }
1907
+ }
1908
+ out.b1i();
1909
+ return out;
1910
+ };
1911
+ var PathSimplifier_instance;
1912
+ function PathSimplifier_getInstance() {
1913
+ return PathSimplifier_instance;
1914
+ }
1915
+ var PointField_LATITUDE_instance;
1916
+ var PointField_LONGITUDE_instance;
1917
+ var PointField_DISTANCE_instance;
1918
+ var PointField_DX_instance;
1919
+ var PointField_TIME_instance;
1920
+ var PointField_ELAPSED_instance;
1921
+ var PointField_DT_instance;
1922
+ var PointField_BEARING_instance;
1923
+ var PointField_ELEVATION_instance;
1924
+ var PointField_GRADE_instance;
1925
+ var PointField_RADIUS_instance;
1926
+ var PointField_AERO_COEF_instance;
1927
+ var PointField_WIND_BEARING_instance;
1928
+ var PointField_WIND_ALPHA_instance;
1929
+ var PointField_P_AERO_instance;
1930
+ var PointField_P_GRAVITY_instance;
1931
+ var PointField_P_ROLLING_RESISTANCE_instance;
1932
+ var PointField_P_WHEEL_BEARINGS_instance;
1933
+ var PointField_P_INPUT_POWER_instance;
1934
+ var PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_instance;
1935
+ var PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_instance;
1936
+ var PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_instance;
1937
+ var PointField_P_CYCLIST_PROVIDED_MUSCULAR_instance;
1938
+ var PointField_P_CYCLIST_PROVIDED_WHEEL_instance;
1939
+ var PointField_P_COMPUTED_TOTAL_POWER_instance;
1940
+ var PointField_P_COMPUTED_WHEEL_POWER_instance;
1941
+ var PointField_POWER_instance;
1942
+ var PointField_SPEED_instance;
1943
+ var PointField_SPEED_MAX_instance;
1944
+ var PointField_SPEED_MAX_INCLINE_instance;
1945
+ var PointField_VIRT_SPEED_CURRENT_instance;
1946
+ var PointField_TEMPERATURE_instance;
1947
+ var PointField_WIND_SPEED_instance;
1948
+ var PointField_WIND_DIRECTION_instance;
1949
+ var PointField_HEART_RATE_instance;
1950
+ var PointField_CADENCE_instance;
1951
+ function Companion_5() {
1952
+ Companion_instance_5 = this;
1953
+ this.r1k_1 = 36;
1954
+ var tmp = this;
1955
+ // Inline function 'kotlin.collections.associateBy' call
1956
+ var this_0 = get_entries();
1957
+ var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16);
1958
+ // Inline function 'kotlin.collections.associateByTo' call
1959
+ var destination = LinkedHashMap_init_$Create$(capacity);
1960
+ var _iterator__ex2g4s = this_0.i();
1961
+ while (_iterator__ex2g4s.j()) {
1962
+ var element = _iterator__ex2g4s.k();
1963
+ var tmp$ret$2 = element.v1k_1;
1964
+ destination.p2(tmp$ret$2, element);
1965
+ }
1966
+ tmp.s1k_1 = destination;
1967
+ }
1968
+ var Companion_instance_5;
1969
+ function Companion_getInstance_6() {
1970
+ PointField_initEntries();
1971
+ if (Companion_instance_5 == null)
1972
+ new Companion_5();
1973
+ return Companion_instance_5;
1974
+ }
1975
+ function values() {
1976
+ return [PointField_LATITUDE_getInstance(), PointField_LONGITUDE_getInstance(), PointField_DISTANCE_getInstance(), PointField_DX_getInstance(), PointField_TIME_getInstance(), PointField_ELAPSED_getInstance(), PointField_DT_getInstance(), PointField_BEARING_getInstance(), PointField_ELEVATION_getInstance(), PointField_GRADE_getInstance(), PointField_RADIUS_getInstance(), PointField_AERO_COEF_getInstance(), PointField_WIND_BEARING_getInstance(), PointField_WIND_ALPHA_getInstance(), PointField_P_AERO_getInstance(), PointField_P_GRAVITY_getInstance(), PointField_P_ROLLING_RESISTANCE_getInstance(), PointField_P_WHEEL_BEARINGS_getInstance(), PointField_P_INPUT_POWER_getInstance(), PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_getInstance(), PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_getInstance(), PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_getInstance(), PointField_P_CYCLIST_PROVIDED_MUSCULAR_getInstance(), PointField_P_CYCLIST_PROVIDED_WHEEL_getInstance(), PointField_P_COMPUTED_TOTAL_POWER_getInstance(), PointField_P_COMPUTED_WHEEL_POWER_getInstance(), PointField_POWER_getInstance(), PointField_SPEED_getInstance(), PointField_SPEED_MAX_getInstance(), PointField_SPEED_MAX_INCLINE_getInstance(), PointField_VIRT_SPEED_CURRENT_getInstance(), PointField_TEMPERATURE_getInstance(), PointField_WIND_SPEED_getInstance(), PointField_WIND_DIRECTION_getInstance(), PointField_HEART_RATE_getInstance(), PointField_CADENCE_getInstance()];
1977
+ }
1978
+ function get_entries() {
1979
+ if ($ENTRIES == null)
1980
+ $ENTRIES = enumEntries(values());
1981
+ return $ENTRIES;
1982
+ }
1983
+ var PointField_entriesInitialized;
1984
+ function PointField_initEntries() {
1985
+ if (PointField_entriesInitialized)
1986
+ return Unit_instance;
1987
+ PointField_entriesInitialized = true;
1988
+ PointField_LATITUDE_instance = new PointField('LATITUDE', 0, 'latitude', 'radians', 'Latitude (radians)', PointFieldCategory_COORDINATES_getInstance(), true, true);
1989
+ PointField_LONGITUDE_instance = new PointField('LONGITUDE', 1, 'longitude', 'radians', 'Longitude (radians)', PointFieldCategory_COORDINATES_getInstance(), true, true);
1990
+ PointField_DISTANCE_instance = new PointField('DISTANCE', 2, 'distance', 'meters', 'Distance (meters)', PointFieldCategory_COORDINATES_getInstance());
1991
+ PointField_DX_instance = new PointField('DX', 3, 'dx', 'meters', 'dx (meters)', PointFieldCategory_COORDINATES_getInstance());
1992
+ PointField_TIME_instance = new PointField('TIME', 4, 'time', 'ms', 'Timestamp (ms since epoch)', PointFieldCategory_TEMPORAL_getInstance(), true);
1993
+ PointField_ELAPSED_instance = new PointField('ELAPSED', 5, 'elapsed', 'ms', 'Elapsed duration (ms)', PointFieldCategory_TEMPORAL_getInstance());
1994
+ PointField_DT_instance = new PointField('DT', 6, 'dt', 'ms', 'dt (ms)', PointFieldCategory_TEMPORAL_getInstance());
1995
+ PointField_BEARING_instance = new PointField('BEARING', 7, 'bearing', 'radians', 'Direction bearing (radians)', PointFieldCategory_ANGLES_getInstance(), VOID, true);
1996
+ PointField_ELEVATION_instance = new PointField('ELEVATION', 8, 'elevation', 'meters', 'Elevation (meters)', PointFieldCategory_ELEVATION_getInstance());
1997
+ PointField_GRADE_instance = new PointField('GRADE', 9, 'grade', '%', 'Road grade/slope (%)', PointFieldCategory_GRADE_getInstance());
1998
+ PointField_RADIUS_instance = new PointField('RADIUS', 10, 'radius', 'meters', 'Turn radius (meters)', PointFieldCategory_RADIUS_getInstance());
1999
+ PointField_AERO_COEF_instance = new PointField('AERO_COEF', 11, 'aeroCoef', 'aero', 'Aerodynamic coefficient', PointFieldCategory_AERO_COEF_getInstance());
2000
+ PointField_WIND_BEARING_instance = new PointField('WIND_BEARING', 12, 'windBearing', 'radians', 'Wind bearing (radians)', PointFieldCategory_CYCLIST_WIND_getInstance(), VOID, true);
2001
+ PointField_WIND_ALPHA_instance = new PointField('WIND_ALPHA', 13, 'windAlpha', 'radians', 'Wind angle (radians)', PointFieldCategory_CYCLIST_WIND_getInstance(), VOID, true);
2002
+ PointField_P_AERO_instance = new PointField('P_AERO', 14, 'pAero', 'watts', 'Aerodynamic power', PointFieldCategory_POWER_PHYSICS_getInstance());
2003
+ PointField_P_GRAVITY_instance = new PointField('P_GRAVITY', 15, 'pGravity', 'watts', 'Gravitational power', PointFieldCategory_POWER_PHYSICS_getInstance());
2004
+ PointField_P_ROLLING_RESISTANCE_instance = new PointField('P_ROLLING_RESISTANCE', 16, 'pRollingResistance', 'watts', 'Rolling resistance power', PointFieldCategory_POWER_PHYSICS_getInstance());
2005
+ PointField_P_WHEEL_BEARINGS_instance = new PointField('P_WHEEL_BEARINGS', 17, 'pWheelBearings', 'watts', 'Wheel bearings power', PointFieldCategory_POWER_PHYSICS_getInstance());
2006
+ PointField_P_INPUT_POWER_instance = new PointField('P_INPUT_POWER', 18, 'pInputPower', 'watts', 'GPX input power', PointFieldCategory_POWER_CYCLIST_getInstance());
2007
+ PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_instance = new PointField('P_CYCLIST_PROVIDED_OPTIMAL_POWER', 19, 'pCyclistProvidedOptimalPower', 'watts', 'Optimal power', PointFieldCategory_POWER_CYCLIST_getInstance());
2008
+ PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_instance = new PointField('P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS', 20, 'pCyclistProvidedOptimalPowerWithHarmonics', 'watts', 'Optimal power with harmonics', PointFieldCategory_POWER_CYCLIST_getInstance());
2009
+ PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_instance = new PointField('P_CYCLIST_PROVIDED_POWER_NEEDED', 21, 'pCyclistPowerNeeded', 'watts', 'Power needed', PointFieldCategory_POWER_CYCLIST_getInstance());
2010
+ PointField_P_CYCLIST_PROVIDED_MUSCULAR_instance = new PointField('P_CYCLIST_PROVIDED_MUSCULAR', 22, 'pCyclistProvidedMuscular', 'watts', 'Raw cyclist power', PointFieldCategory_POWER_CYCLIST_getInstance());
2011
+ PointField_P_CYCLIST_PROVIDED_WHEEL_instance = new PointField('P_CYCLIST_PROVIDED_WHEEL', 23, 'pCyclistProvidedWheel', 'watts', 'Cyclist power transmitted to ground', PointFieldCategory_POWER_CYCLIST_getInstance());
2012
+ PointField_P_COMPUTED_TOTAL_POWER_instance = new PointField('P_COMPUTED_TOTAL_POWER', 24, 'pComputedTotalPower', 'watts', 'Power from kinetic energy change', PointFieldCategory_POWER_POST_getInstance());
2013
+ PointField_P_COMPUTED_WHEEL_POWER_instance = new PointField('P_COMPUTED_WHEEL_POWER', 25, 'pComputedWheelPower', 'watts', 'Wheel power from kinetic energy change', PointFieldCategory_POWER_POST_getInstance());
2014
+ PointField_POWER_instance = new PointField('POWER', 26, 'pComputedPower', 'watts', 'Total power (watts)', PointFieldCategory_POWER_POST_getInstance());
2015
+ PointField_SPEED_instance = new PointField('SPEED', 27, 'speed', 'm/s', 'Current speed (m/s)', PointFieldCategory_SPEED_getInstance());
2016
+ PointField_SPEED_MAX_instance = new PointField('SPEED_MAX', 28, 'speedMax', 'm/s', 'Maximum speed (m/s)', PointFieldCategory_SPEED_getInstance());
2017
+ PointField_SPEED_MAX_INCLINE_instance = new PointField('SPEED_MAX_INCLINE', 29, 'speedMaxIncline', 'm/s', 'Max speed on incline (m/s)', PointFieldCategory_SPEED_getInstance());
2018
+ PointField_VIRT_SPEED_CURRENT_instance = new PointField('VIRT_SPEED_CURRENT', 30, 'virtSpeedCurrent', 'm/s', 'Virtual current speed (m/s)', PointFieldCategory_SPEED_getInstance());
2019
+ PointField_TEMPERATURE_instance = new PointField('TEMPERATURE', 31, 'temperature', 'celsius', 'Temperature (celsius)', PointFieldCategory_ENVIRONMENTAL_getInstance());
2020
+ PointField_WIND_SPEED_instance = new PointField('WIND_SPEED', 32, 'windSpeed', 'm/s', 'Wind speed (m/s)', PointFieldCategory_ENVIRONMENTAL_getInstance());
2021
+ PointField_WIND_DIRECTION_instance = new PointField('WIND_DIRECTION', 33, 'windDirection', 'radians', 'Wind direction (radians)', PointFieldCategory_ENVIRONMENTAL_getInstance(), VOID, true);
2022
+ PointField_HEART_RATE_instance = new PointField('HEART_RATE', 34, 'heartRate', 'bpm', 'Heart rate (bpm)', PointFieldCategory_PHYSIOLOGICAL_getInstance());
2023
+ PointField_CADENCE_instance = new PointField('CADENCE', 35, 'cadence', 'rpm', 'Pedaling cadence (rpm)', PointFieldCategory_PHYSIOLOGICAL_getInstance());
2024
+ Companion_getInstance_6();
2025
+ }
2026
+ var $ENTRIES;
2027
+ function PointField(name, ordinal, prop, unit, shortDescription, category, notSelectable, anglesInRadians) {
2028
+ notSelectable = notSelectable === VOID ? false : notSelectable;
2029
+ anglesInRadians = anglesInRadians === VOID ? false : anglesInRadians;
2030
+ Enum.call(this, name, ordinal);
2031
+ this.v1k_1 = prop;
2032
+ this.w1k_1 = unit;
2033
+ this.x1k_1 = shortDescription;
2034
+ this.y1k_1 = category;
2035
+ this.z1k_1 = notSelectable;
2036
+ this.a1l_1 = anglesInRadians;
2037
+ }
2038
+ function PointField_LATITUDE_getInstance() {
2039
+ PointField_initEntries();
2040
+ return PointField_LATITUDE_instance;
2041
+ }
2042
+ function PointField_LONGITUDE_getInstance() {
2043
+ PointField_initEntries();
2044
+ return PointField_LONGITUDE_instance;
2045
+ }
2046
+ function PointField_DISTANCE_getInstance() {
2047
+ PointField_initEntries();
2048
+ return PointField_DISTANCE_instance;
2049
+ }
2050
+ function PointField_DX_getInstance() {
2051
+ PointField_initEntries();
2052
+ return PointField_DX_instance;
2053
+ }
2054
+ function PointField_TIME_getInstance() {
2055
+ PointField_initEntries();
2056
+ return PointField_TIME_instance;
2057
+ }
2058
+ function PointField_ELAPSED_getInstance() {
2059
+ PointField_initEntries();
2060
+ return PointField_ELAPSED_instance;
2061
+ }
2062
+ function PointField_DT_getInstance() {
2063
+ PointField_initEntries();
2064
+ return PointField_DT_instance;
2065
+ }
2066
+ function PointField_BEARING_getInstance() {
2067
+ PointField_initEntries();
2068
+ return PointField_BEARING_instance;
2069
+ }
2070
+ function PointField_ELEVATION_getInstance() {
2071
+ PointField_initEntries();
2072
+ return PointField_ELEVATION_instance;
2073
+ }
2074
+ function PointField_GRADE_getInstance() {
2075
+ PointField_initEntries();
2076
+ return PointField_GRADE_instance;
2077
+ }
2078
+ function PointField_RADIUS_getInstance() {
2079
+ PointField_initEntries();
2080
+ return PointField_RADIUS_instance;
2081
+ }
2082
+ function PointField_AERO_COEF_getInstance() {
2083
+ PointField_initEntries();
2084
+ return PointField_AERO_COEF_instance;
2085
+ }
2086
+ function PointField_WIND_BEARING_getInstance() {
2087
+ PointField_initEntries();
2088
+ return PointField_WIND_BEARING_instance;
2089
+ }
2090
+ function PointField_WIND_ALPHA_getInstance() {
2091
+ PointField_initEntries();
2092
+ return PointField_WIND_ALPHA_instance;
2093
+ }
2094
+ function PointField_P_AERO_getInstance() {
2095
+ PointField_initEntries();
2096
+ return PointField_P_AERO_instance;
2097
+ }
2098
+ function PointField_P_GRAVITY_getInstance() {
2099
+ PointField_initEntries();
2100
+ return PointField_P_GRAVITY_instance;
2101
+ }
2102
+ function PointField_P_ROLLING_RESISTANCE_getInstance() {
2103
+ PointField_initEntries();
2104
+ return PointField_P_ROLLING_RESISTANCE_instance;
2105
+ }
2106
+ function PointField_P_WHEEL_BEARINGS_getInstance() {
2107
+ PointField_initEntries();
2108
+ return PointField_P_WHEEL_BEARINGS_instance;
2109
+ }
2110
+ function PointField_P_INPUT_POWER_getInstance() {
2111
+ PointField_initEntries();
2112
+ return PointField_P_INPUT_POWER_instance;
2113
+ }
2114
+ function PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_getInstance() {
2115
+ PointField_initEntries();
2116
+ return PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_instance;
2117
+ }
2118
+ function PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_getInstance() {
2119
+ PointField_initEntries();
2120
+ return PointField_P_CYCLIST_PROVIDED_OPTIMAL_POWER_HARMONICS_instance;
2121
+ }
2122
+ function PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_getInstance() {
2123
+ PointField_initEntries();
2124
+ return PointField_P_CYCLIST_PROVIDED_POWER_NEEDED_instance;
2125
+ }
2126
+ function PointField_P_CYCLIST_PROVIDED_MUSCULAR_getInstance() {
2127
+ PointField_initEntries();
2128
+ return PointField_P_CYCLIST_PROVIDED_MUSCULAR_instance;
2129
+ }
2130
+ function PointField_P_CYCLIST_PROVIDED_WHEEL_getInstance() {
2131
+ PointField_initEntries();
2132
+ return PointField_P_CYCLIST_PROVIDED_WHEEL_instance;
2133
+ }
2134
+ function PointField_P_COMPUTED_TOTAL_POWER_getInstance() {
2135
+ PointField_initEntries();
2136
+ return PointField_P_COMPUTED_TOTAL_POWER_instance;
2137
+ }
2138
+ function PointField_P_COMPUTED_WHEEL_POWER_getInstance() {
2139
+ PointField_initEntries();
2140
+ return PointField_P_COMPUTED_WHEEL_POWER_instance;
2141
+ }
2142
+ function PointField_POWER_getInstance() {
2143
+ PointField_initEntries();
2144
+ return PointField_POWER_instance;
2145
+ }
2146
+ function PointField_SPEED_getInstance() {
2147
+ PointField_initEntries();
2148
+ return PointField_SPEED_instance;
2149
+ }
2150
+ function PointField_SPEED_MAX_getInstance() {
2151
+ PointField_initEntries();
2152
+ return PointField_SPEED_MAX_instance;
2153
+ }
2154
+ function PointField_SPEED_MAX_INCLINE_getInstance() {
2155
+ PointField_initEntries();
2156
+ return PointField_SPEED_MAX_INCLINE_instance;
2157
+ }
2158
+ function PointField_VIRT_SPEED_CURRENT_getInstance() {
2159
+ PointField_initEntries();
2160
+ return PointField_VIRT_SPEED_CURRENT_instance;
2161
+ }
2162
+ function PointField_TEMPERATURE_getInstance() {
2163
+ PointField_initEntries();
2164
+ return PointField_TEMPERATURE_instance;
2165
+ }
2166
+ function PointField_WIND_SPEED_getInstance() {
2167
+ PointField_initEntries();
2168
+ return PointField_WIND_SPEED_instance;
2169
+ }
2170
+ function PointField_WIND_DIRECTION_getInstance() {
2171
+ PointField_initEntries();
2172
+ return PointField_WIND_DIRECTION_instance;
2173
+ }
2174
+ function PointField_HEART_RATE_getInstance() {
2175
+ PointField_initEntries();
2176
+ return PointField_HEART_RATE_instance;
2177
+ }
2178
+ function PointField_CADENCE_getInstance() {
2179
+ PointField_initEntries();
2180
+ return PointField_CADENCE_instance;
2181
+ }
2182
+ var PointFieldCategory_COORDINATES_instance;
2183
+ var PointFieldCategory_TEMPORAL_instance;
2184
+ var PointFieldCategory_ANGLES_instance;
2185
+ var PointFieldCategory_ELEVATION_instance;
2186
+ var PointFieldCategory_GRADE_instance;
2187
+ var PointFieldCategory_RADIUS_instance;
2188
+ var PointFieldCategory_AERO_COEF_instance;
2189
+ var PointFieldCategory_CYCLIST_WIND_instance;
2190
+ var PointFieldCategory_POWER_PHYSICS_instance;
2191
+ var PointFieldCategory_POWER_CYCLIST_instance;
2192
+ var PointFieldCategory_POWER_POST_instance;
2193
+ var PointFieldCategory_SPEED_instance;
2194
+ var PointFieldCategory_ENVIRONMENTAL_instance;
2195
+ var PointFieldCategory_PHYSIOLOGICAL_instance;
2196
+ var PointFieldCategory_entriesInitialized;
2197
+ function PointFieldCategory_initEntries() {
2198
+ if (PointFieldCategory_entriesInitialized)
2199
+ return Unit_instance;
2200
+ PointFieldCategory_entriesInitialized = true;
2201
+ PointFieldCategory_COORDINATES_instance = new PointFieldCategory('COORDINATES', 0, 'coordinates', 'Coordinates');
2202
+ PointFieldCategory_TEMPORAL_instance = new PointFieldCategory('TEMPORAL', 1, 'temporal', 'Temporal');
2203
+ PointFieldCategory_ANGLES_instance = new PointFieldCategory('ANGLES', 2, 'angles', 'Angles');
2204
+ PointFieldCategory_ELEVATION_instance = new PointFieldCategory('ELEVATION', 3, 'elevation', '\uD83C\uDFD4\uFE0F Elevation');
2205
+ PointFieldCategory_GRADE_instance = new PointFieldCategory('GRADE', 4, 'grade', '\uD83D\uDCD0 Grade');
2206
+ PointFieldCategory_RADIUS_instance = new PointFieldCategory('RADIUS', 5, 'radius', 'Radius');
2207
+ PointFieldCategory_AERO_COEF_instance = new PointFieldCategory('AERO_COEF', 6, 'aero_coef', 'Aero coef');
2208
+ PointFieldCategory_CYCLIST_WIND_instance = new PointFieldCategory('CYCLIST_WIND', 7, 'cyclist_wind', 'Cyclist wind');
2209
+ PointFieldCategory_POWER_PHYSICS_instance = new PointFieldCategory('POWER_PHYSICS', 8, 'power_physics', '\u26A1 Power Physics');
2210
+ PointFieldCategory_POWER_CYCLIST_instance = new PointFieldCategory('POWER_CYCLIST', 9, 'power_cyclist', '\u26A1 Power Cyclist');
2211
+ PointFieldCategory_POWER_POST_instance = new PointFieldCategory('POWER_POST', 10, 'power_post', '\u26A1 Power Post processed');
2212
+ PointFieldCategory_SPEED_instance = new PointFieldCategory('SPEED', 11, 'speed', 'Speed & Motion');
2213
+ PointFieldCategory_ENVIRONMENTAL_instance = new PointFieldCategory('ENVIRONMENTAL', 12, 'environmental', 'Environmental');
2214
+ PointFieldCategory_PHYSIOLOGICAL_instance = new PointFieldCategory('PHYSIOLOGICAL', 13, 'physiological', 'Physiological');
2215
+ }
2216
+ function PointFieldCategory(name, ordinal, id, displayName) {
2217
+ Enum.call(this, name, ordinal);
2218
+ this.d1l_1 = id;
2219
+ this.e1l_1 = displayName;
2220
+ }
2221
+ function PointFieldCategory_COORDINATES_getInstance() {
2222
+ PointFieldCategory_initEntries();
2223
+ return PointFieldCategory_COORDINATES_instance;
2224
+ }
2225
+ function PointFieldCategory_TEMPORAL_getInstance() {
2226
+ PointFieldCategory_initEntries();
2227
+ return PointFieldCategory_TEMPORAL_instance;
2228
+ }
2229
+ function PointFieldCategory_ANGLES_getInstance() {
2230
+ PointFieldCategory_initEntries();
2231
+ return PointFieldCategory_ANGLES_instance;
2232
+ }
2233
+ function PointFieldCategory_ELEVATION_getInstance() {
2234
+ PointFieldCategory_initEntries();
2235
+ return PointFieldCategory_ELEVATION_instance;
2236
+ }
2237
+ function PointFieldCategory_GRADE_getInstance() {
2238
+ PointFieldCategory_initEntries();
2239
+ return PointFieldCategory_GRADE_instance;
2240
+ }
2241
+ function PointFieldCategory_RADIUS_getInstance() {
2242
+ PointFieldCategory_initEntries();
2243
+ return PointFieldCategory_RADIUS_instance;
2244
+ }
2245
+ function PointFieldCategory_AERO_COEF_getInstance() {
2246
+ PointFieldCategory_initEntries();
2247
+ return PointFieldCategory_AERO_COEF_instance;
2248
+ }
2249
+ function PointFieldCategory_CYCLIST_WIND_getInstance() {
2250
+ PointFieldCategory_initEntries();
2251
+ return PointFieldCategory_CYCLIST_WIND_instance;
2252
+ }
2253
+ function PointFieldCategory_POWER_PHYSICS_getInstance() {
2254
+ PointFieldCategory_initEntries();
2255
+ return PointFieldCategory_POWER_PHYSICS_instance;
2256
+ }
2257
+ function PointFieldCategory_POWER_CYCLIST_getInstance() {
2258
+ PointFieldCategory_initEntries();
2259
+ return PointFieldCategory_POWER_CYCLIST_instance;
2260
+ }
2261
+ function PointFieldCategory_POWER_POST_getInstance() {
2262
+ PointFieldCategory_initEntries();
2263
+ return PointFieldCategory_POWER_POST_instance;
2264
+ }
2265
+ function PointFieldCategory_SPEED_getInstance() {
2266
+ PointFieldCategory_initEntries();
2267
+ return PointFieldCategory_SPEED_instance;
2268
+ }
2269
+ function PointFieldCategory_ENVIRONMENTAL_getInstance() {
2270
+ PointFieldCategory_initEntries();
2271
+ return PointFieldCategory_ENVIRONMENTAL_instance;
2272
+ }
2273
+ function PointFieldCategory_PHYSIOLOGICAL_getInstance() {
2274
+ PointFieldCategory_initEntries();
2275
+ return PointFieldCategory_PHYSIOLOGICAL_instance;
2276
+ }
2277
+ function Copy(sourceIndex) {
2278
+ this.f1l_1 = sourceIndex;
2279
+ }
2280
+ protoOf(Copy).toString = function () {
2281
+ return 'Copy(sourceIndex=' + this.f1l_1 + ')';
2282
+ };
2283
+ protoOf(Copy).hashCode = function () {
2284
+ return this.f1l_1;
2285
+ };
2286
+ protoOf(Copy).equals = function (other) {
2287
+ if (this === other)
2288
+ return true;
2289
+ if (!(other instanceof Copy))
2290
+ return false;
2291
+ if (!(this.f1l_1 === other.f1l_1))
2292
+ return false;
2293
+ return true;
2294
+ };
2295
+ function Interpolate(from, to, coef) {
2296
+ this.g1l_1 = from;
2297
+ this.h1l_1 = to;
2298
+ this.i1l_1 = coef;
2299
+ }
2300
+ protoOf(Interpolate).toString = function () {
2301
+ return 'Interpolate(from=' + this.g1l_1 + ', to=' + this.h1l_1 + ', coef=' + this.i1l_1 + ')';
2302
+ };
2303
+ protoOf(Interpolate).hashCode = function () {
2304
+ var result = this.g1l_1;
2305
+ result = imul(result, 31) + this.h1l_1 | 0;
2306
+ result = imul(result, 31) + getNumberHashCode(this.i1l_1) | 0;
2307
+ return result;
2308
+ };
2309
+ protoOf(Interpolate).equals = function (other) {
2310
+ if (this === other)
2311
+ return true;
2312
+ if (!(other instanceof Interpolate))
2313
+ return false;
2314
+ if (!(this.g1l_1 === other.g1l_1))
2315
+ return false;
2316
+ if (!(this.h1l_1 === other.h1l_1))
2317
+ return false;
2318
+ if (!equals(this.i1l_1, other.i1l_1))
2319
+ return false;
2320
+ return true;
2321
+ };
2322
+ function buildPlan($this, source, minDistanceM, maxDistanceM) {
2323
+ var n = source.v1g_1;
2324
+ var plan = ArrayList_init_$Create$(n);
2325
+ // Inline function 'kotlin.collections.plusAssign' call
2326
+ var element = new Copy(0);
2327
+ plan.h(element);
2328
+ var lastAddedDistance = source.z1i(0);
2329
+ var lastAddedIndex = 0;
2330
+ var inductionVariable = 1;
2331
+ if (inductionVariable < n)
2332
+ $l$loop: do {
2333
+ var i = inductionVariable;
2334
+ inductionVariable = inductionVariable + 1 | 0;
2335
+ var curDist = source.z1i(i);
2336
+ var gap = curDist - lastAddedDistance;
2337
+ if (gap < minDistanceM)
2338
+ continue $l$loop;
2339
+ else if (gap <= maxDistanceM) {
2340
+ // Inline function 'kotlin.collections.plusAssign' call
2341
+ var element_0 = new Copy(i);
2342
+ plan.h(element_0);
2343
+ lastAddedDistance = curDist;
2344
+ lastAddedIndex = i;
2345
+ } else {
2346
+ // Inline function 'kotlin.math.ceil' call
2347
+ var x = gap / maxDistanceM;
2348
+ var tmp$ret$2 = Math.ceil(x);
2349
+ var numSegments = numberToInt(tmp$ret$2);
2350
+ var spacing = gap / numSegments;
2351
+ var index1 = lastAddedIndex;
2352
+ var inductionVariable_0 = 1;
2353
+ if (inductionVariable_0 < numSegments)
2354
+ do {
2355
+ var j = inductionVariable_0;
2356
+ inductionVariable_0 = inductionVariable_0 + 1 | 0;
2357
+ var targetDistance = lastAddedDistance + j * spacing;
2358
+ while (index1 < (i - 1 | 0) && source.z1i(index1 + 1 | 0) < targetDistance) {
2359
+ index1 = index1 + 1 | 0;
2360
+ }
2361
+ var dist1 = source.z1i(index1);
2362
+ var dist2 = source.z1i(index1 + 1 | 0);
2363
+ var coef = (targetDistance - dist1) / (dist2 - dist1);
2364
+ // Inline function 'kotlin.collections.plusAssign' call
2365
+ var element_1 = new Interpolate(index1, index1 + 1 | 0, coef);
2366
+ plan.h(element_1);
2367
+ }
2368
+ while (inductionVariable_0 < numSegments);
2369
+ // Inline function 'kotlin.collections.plusAssign' call
2370
+ var element_2 = new Copy(i);
2371
+ plan.h(element_2);
2372
+ lastAddedDistance = curDist;
2373
+ lastAddedIndex = i;
2374
+ }
2375
+ }
2376
+ while (inductionVariable < n);
2377
+ return plan;
2378
+ }
2379
+ function materialize($this, source, plan) {
2380
+ var out = new Path(plan.l());
2381
+ var iterator = plan.i();
2382
+ var index = 0;
2383
+ while (iterator.j()) {
2384
+ var dstIdx = index;
2385
+ index = index + 1 | 0;
2386
+ var op = iterator.k();
2387
+ if (op instanceof Copy) {
2388
+ copyFields($this, source, op.f1l_1, out, dstIdx);
2389
+ } else {
2390
+ if (op instanceof Interpolate) {
2391
+ interpolateFields($this, source, op.g1l_1, op.h1l_1, op.i1l_1, out, dstIdx);
2392
+ } else {
2393
+ noWhenBranchMatchedException();
2394
+ }
2395
+ }
2396
+ }
2397
+ out.b1i();
2398
+ return out;
2399
+ }
2400
+ function copyFields($this, src, srcIdx, dst, dstIdx) {
2401
+ var _iterator__ex2g4s = get_entries().i();
2402
+ while (_iterator__ex2g4s.j()) {
2403
+ var field = _iterator__ex2g4s.k();
2404
+ dst.l1i(dstIdx, field, src.k1i(srcIdx, field));
2405
+ }
2406
+ }
2407
+ function interpolateFields($this, src, i1, i2, coef, dst, dstIdx) {
2408
+ var _iterator__ex2g4s = get_entries().i();
2409
+ while (_iterator__ex2g4s.j()) {
2410
+ var field = _iterator__ex2g4s.k();
2411
+ var v1 = src.k1i(i1, field);
2412
+ var v2 = src.k1i(i2, field);
2413
+ var v = isNaN_0(v1) || isNaN_0(v2) ? NaN : v1 + (v2 - v1) * coef;
2414
+ dst.l1i(dstIdx, field, v);
2415
+ }
2416
+ }
2417
+ function PointPerDistance() {
2418
+ }
2419
+ protoOf(PointPerDistance).r1f = function (source, minDistanceM, maxDistanceM) {
2420
+ return this.j1l(source, minDistanceM, maxDistanceM);
2421
+ };
2422
+ protoOf(PointPerDistance).j1l = function (source, minDistanceM, maxDistanceM) {
2423
+ // Inline function 'kotlin.require' call
2424
+ if (!(maxDistanceM > 0.0)) {
2425
+ var message = 'maxDistanceM must be > 0, got ' + maxDistanceM;
2426
+ throw IllegalArgumentException_init_$Create$(toString(message));
2427
+ }
2428
+ if (source.v1g_1 === 0)
2429
+ return new Path(0);
2430
+ if (source.v1g_1 === 1) {
2431
+ var out = new Path(1);
2432
+ copyFields(this, source, 0, out, 0);
2433
+ out.b1i();
2434
+ return out;
2435
+ }
2436
+ var plan = buildPlan(this, source, minDistanceM, maxDistanceM);
2437
+ return materialize(this, source, plan);
2438
+ };
2439
+ var PointPerDistance_instance;
2440
+ function PointPerDistance_getInstance() {
2441
+ return PointPerDistance_instance;
2442
+ }
2443
+ function Copy_0(sourceIndex) {
2444
+ this.k1l_1 = sourceIndex;
2445
+ }
2446
+ protoOf(Copy_0).toString = function () {
2447
+ return 'Copy(sourceIndex=' + this.k1l_1 + ')';
2448
+ };
2449
+ protoOf(Copy_0).hashCode = function () {
2450
+ return this.k1l_1;
2451
+ };
2452
+ protoOf(Copy_0).equals = function (other) {
2453
+ if (this === other)
2454
+ return true;
2455
+ if (!(other instanceof Copy_0))
2456
+ return false;
2457
+ if (!(this.k1l_1 === other.k1l_1))
2458
+ return false;
2459
+ return true;
2460
+ };
2461
+ function Interpolate_0(from, to, coef) {
2462
+ this.l1l_1 = from;
2463
+ this.m1l_1 = to;
2464
+ this.n1l_1 = coef;
2465
+ }
2466
+ protoOf(Interpolate_0).toString = function () {
2467
+ return 'Interpolate(from=' + this.l1l_1 + ', to=' + this.m1l_1 + ', coef=' + this.n1l_1 + ')';
2468
+ };
2469
+ protoOf(Interpolate_0).hashCode = function () {
2470
+ var result = this.l1l_1;
2471
+ result = imul(result, 31) + this.m1l_1 | 0;
2472
+ result = imul(result, 31) + getNumberHashCode(this.n1l_1) | 0;
2473
+ return result;
2474
+ };
2475
+ protoOf(Interpolate_0).equals = function (other) {
2476
+ if (this === other)
2477
+ return true;
2478
+ if (!(other instanceof Interpolate_0))
2479
+ return false;
2480
+ if (!(this.l1l_1 === other.l1l_1))
2481
+ return false;
2482
+ if (!(this.m1l_1 === other.m1l_1))
2483
+ return false;
2484
+ if (!equals(this.n1l_1, other.n1l_1))
2485
+ return false;
2486
+ return true;
2487
+ };
2488
+ function buildPlan_0($this, source) {
2489
+ var plan = LinkedHashMap_init_$Create$_0();
2490
+ var n = source.v1g_1;
2491
+ var inductionVariable = 0;
2492
+ if (inductionVariable < n)
2493
+ $l$loop_0: do {
2494
+ var i = inductionVariable;
2495
+ inductionVariable = inductionVariable + 1 | 0;
2496
+ var time1 = source.a1h(i);
2497
+ // Inline function 'kotlin.math.floor' call
2498
+ var x = time1 / 1000.0;
2499
+ var tmp$ret$0 = Math.floor(x);
2500
+ var epoch1 = numberToLong(tmp$ret$0);
2501
+ var msInSec1 = subtract(numberToLong(time1), multiply(epoch1, new Long(1000, 0)));
2502
+ if (i === 0 && !equalsLong(msInSec1, new Long(0, 0))) {
2503
+ // Inline function 'kotlin.collections.set' call
2504
+ var value = new Copy_0(i);
2505
+ plan.p2(epoch1, value);
2506
+ }
2507
+ if (i === (n - 1 | 0)) {
2508
+ if (!equalsLong(msInSec1, new Long(0, 0))) {
2509
+ var tmp2 = add(epoch1, new Long(1, 0));
2510
+ // Inline function 'kotlin.collections.set' call
2511
+ var value_0 = new Copy_0(i);
2512
+ plan.p2(tmp2, value_0);
2513
+ }
2514
+ continue $l$loop_0;
2515
+ }
2516
+ var time2 = source.a1h(i + 1 | 0);
2517
+ // Inline function 'kotlin.math.floor' call
2518
+ var x_0 = time2 / 1000.0;
2519
+ var tmp$ret$3 = Math.floor(x_0);
2520
+ var epoch2 = numberToLong(tmp$ret$3);
2521
+ if (equalsLong(epoch1, epoch2))
2522
+ continue $l$loop_0;
2523
+ var duration12 = time2 - time1;
2524
+ var epochStart = equalsLong(msInSec1, new Long(0, 0)) ? epoch1 : add(epoch1, new Long(1, 0));
2525
+ var epochEnd = epoch2;
2526
+ var e = epochStart;
2527
+ while (compare(e, epochEnd) <= 0) {
2528
+ // Inline function 'kotlin.Long.times' call
2529
+ var this_0 = e;
2530
+ var epochTime = toNumber(this_0) * 1000.0;
2531
+ var coef = (epochTime - time1) / duration12;
2532
+ var tmp2_0 = e;
2533
+ // Inline function 'kotlin.collections.set' call
2534
+ var value_1 = new Interpolate_0(i, i + 1 | 0, coef);
2535
+ plan.p2(tmp2_0, value_1);
2536
+ var _unary__edvuaz = e;
2537
+ e = add(_unary__edvuaz, get_ONE());
2538
+ }
2539
+ }
2540
+ while (inductionVariable < n);
2541
+ return plan;
2542
+ }
2543
+ function materialize_0($this, source, plan) {
2544
+ var sortedEpochs = sorted(plan.i1());
2545
+ var out = new Path(sortedEpochs.l());
2546
+ var iterator = sortedEpochs.i();
2547
+ var index = 0;
2548
+ $l$loop: while (iterator.j()) {
2549
+ var idx = index;
2550
+ index = index + 1 | 0;
2551
+ var epoch = iterator.k();
2552
+ var tmp0_elvis_lhs = plan.h1(epoch);
2553
+ var tmp;
2554
+ if (tmp0_elvis_lhs == null) {
2555
+ continue $l$loop;
2556
+ } else {
2557
+ tmp = tmp0_elvis_lhs;
2558
+ }
2559
+ var data = tmp;
2560
+ if (data instanceof Copy_0) {
2561
+ copyFields_0($this, source, data.k1l_1, out, idx);
2562
+ } else {
2563
+ if (data instanceof Interpolate_0) {
2564
+ interpolateFields_0($this, source, data.l1l_1, data.m1l_1, data.n1l_1, out, idx);
2565
+ } else {
2566
+ noWhenBranchMatchedException();
2567
+ }
2568
+ }
2569
+ out.n1h(idx, toNumber(multiply(epoch, new Long(1000, 0))));
2570
+ }
2571
+ out.b1i();
2572
+ return out;
2573
+ }
2574
+ function copyFields_0($this, src, srcIdx, dst, dstIdx) {
2575
+ var _iterator__ex2g4s = get_entries().i();
2576
+ while (_iterator__ex2g4s.j()) {
2577
+ var field = _iterator__ex2g4s.k();
2578
+ dst.l1i(dstIdx, field, src.k1i(srcIdx, field));
2579
+ }
2580
+ }
2581
+ function interpolateFields_0($this, src, i1, i2, coef, dst, dstIdx) {
2582
+ var _iterator__ex2g4s = get_entries().i();
2583
+ while (_iterator__ex2g4s.j()) {
2584
+ var field = _iterator__ex2g4s.k();
2585
+ var v1 = src.k1i(i1, field);
2586
+ var v2 = src.k1i(i2, field);
2587
+ var v = isNaN_0(v1) || isNaN_0(v2) ? NaN : v1 + (v2 - v1) * coef;
2588
+ dst.l1i(dstIdx, field, v);
2589
+ }
2590
+ }
2591
+ function PointPerSecond() {
2592
+ }
2593
+ protoOf(PointPerSecond).d1g = function (source) {
2594
+ if (source.v1g_1 === 0)
2595
+ return new Path(0);
2596
+ var plan = buildPlan_0(this, source);
2597
+ return materialize_0(this, source, plan);
2598
+ };
2599
+ var PointPerSecond_instance;
2600
+ function PointPerSecond_getInstance() {
2601
+ return PointPerSecond_instance;
2602
+ }
2603
+ function computeWithWind($this, path, i, aeroCoef, wind) {
2604
+ var speed = path.a1k(i);
2605
+ var bearing = path.f1j(i);
2606
+ path.g1k(i, wind.o1l_1);
2607
+ path.h1k(i, wind.p1l_1);
2608
+ var windDirectionAsBearing = 3.141592653589793 / 2.0 - wind.p1l_1;
2609
+ path.l1j(i, windDirectionAsBearing);
2610
+ var alpha = windDirectionAsBearing - bearing;
2611
+ path.m1j(i, alpha);
2612
+ var v = wind.o1l_1;
2613
+ // Inline function 'kotlin.math.cos' call
2614
+ var l1 = speed + v * Math.cos(alpha);
2615
+ var l2 = l1 * l1;
2616
+ var tmp = speed * speed + v * v;
2617
+ var tmp_0 = 2.0 * speed * v;
2618
+ // Inline function 'kotlin.math.cos' call
2619
+ var l3 = tmp + tmp_0 * Math.cos(alpha);
2620
+ var l4 = l2 / l3;
2621
+ var lambda = l4 + 1.2 * (1.0 - l4);
2622
+ var tmp_1 = -aeroCoef * lambda;
2623
+ // Inline function 'kotlin.math.sqrt' call
2624
+ return tmp_1 * Math.sqrt(l3) * l1 * speed;
2625
+ }
2626
+ function AeroPowerProvider() {
2627
+ this.q1l_1 = 1.2;
2628
+ }
2629
+ protoOf(AeroPowerProvider).r1l = function (course, path, pointIndex) {
2630
+ var aeroCoef = course.e1e_1.s1l(course, path, pointIndex);
2631
+ path.k1j(pointIndex, aeroCoef);
2632
+ var wind = course.f1e_1.t1l(course.c1e_1, path, pointIndex);
2633
+ var tmp;
2634
+ if (wind.o1l_1 === 0.0) {
2635
+ var v = path.a1k(pointIndex);
2636
+ tmp = -aeroCoef * v * v * v;
2637
+ } else {
2638
+ tmp = computeWithWind(this, path, pointIndex, aeroCoef, wind);
2639
+ }
2640
+ var pAir = tmp;
2641
+ path.n1j(pointIndex, pAir);
2642
+ return pAir;
2643
+ };
2644
+ var AeroPowerProvider_instance;
2645
+ function AeroPowerProvider_getInstance() {
2646
+ return AeroPowerProvider_instance;
2647
+ }
2648
+ function AeroProviderConstant() {
2649
+ }
2650
+ protoOf(AeroProviderConstant).s1l = function (course, path, pointIndex) {
2651
+ var rho = course.d1e_1.u1l(course.c1e_1, path, pointIndex);
2652
+ return course.i1e().o1e_1 * course.i1e().p1e_1 * rho / 2.0;
2653
+ };
2654
+ var AeroProviderConstant_instance;
2655
+ function AeroProviderConstant_getInstance() {
2656
+ return AeroProviderConstant_instance;
2657
+ }
2658
+ function Companion_6() {
2659
+ this.v1l_1 = 0.05;
2660
+ this.w1l_1 = 3.0;
2661
+ }
2662
+ var Companion_instance_6;
2663
+ function Companion_getInstance_7() {
2664
+ return Companion_instance_6;
2665
+ }
2666
+ function CyclistPowerProviderBase(useHarmonics, random) {
2667
+ random = random === VOID ? Default_getInstance() : random;
2668
+ this.x1l_1 = useHarmonics;
2669
+ var tmp = this;
2670
+ var tmp_0;
2671
+ if (this.x1l_1) {
2672
+ // Inline function 'kotlin.collections.List' call
2673
+ // Inline function 'kotlin.collections.MutableList' call
2674
+ var list = ArrayList_init_$Create$(20);
2675
+ // Inline function 'kotlin.repeat' call
2676
+ var inductionVariable = 0;
2677
+ if (inductionVariable < 20)
2678
+ do {
2679
+ var index = inductionVariable;
2680
+ inductionVariable = inductionVariable + 1 | 0;
2681
+ var tmp$ret$4 = new Harmonic(1.0 + random.fa() * 9.0, random.fa() * 3.141592653589793, random.fa() * 0.01);
2682
+ list.h(tmp$ret$4);
2683
+ }
2684
+ while (inductionVariable < 20);
2685
+ tmp_0 = list;
2686
+ } else {
2687
+ tmp_0 = emptyList();
2688
+ }
2689
+ tmp.y1l_1 = tmp_0;
2690
+ }
2691
+ protoOf(CyclistPowerProviderBase).r1l = function (course, path, pointIndex) {
2692
+ var power = this.z1l(course, path, pointIndex);
2693
+ path.r1j(pointIndex, power);
2694
+ if (this.x1l_1) {
2695
+ var x = path.a1h(pointIndex) / 10000.0;
2696
+ var _iterator__ex2g4s = this.y1l_1.i();
2697
+ while (_iterator__ex2g4s.j()) {
2698
+ var h = _iterator__ex2g4s.k();
2699
+ var tmp = power;
2700
+ var tmp_0 = h.c1m_1 * power;
2701
+ // Inline function 'kotlin.math.cos' call
2702
+ var x_0 = h.a1m_1 * x - h.b1m_1;
2703
+ power = tmp + tmp_0 * Math.cos(x_0);
2704
+ }
2705
+ }
2706
+ path.s1j(pointIndex, power);
2707
+ var powerNeeded = -PowerComputer_instance.d1m(course, path, pointIndex, false);
2708
+ path.t1j(pointIndex, powerNeeded);
2709
+ return power;
2710
+ };
2711
+ function GravPowerProvider() {
2712
+ }
2713
+ protoOf(GravPowerProvider).r1l = function (course, path, pointIndex) {
2714
+ var m = course.i1e().m1e_1;
2715
+ var grade = path.h1j(pointIndex);
2716
+ var speed = path.a1k(pointIndex);
2717
+ var tmp = -m * 9.8 * speed;
2718
+ // Inline function 'kotlin.math.atan' call
2719
+ // Inline function 'kotlin.math.sin' call
2720
+ var x = Math.atan(grade);
2721
+ var p = tmp * Math.sin(x);
2722
+ path.o1j(pointIndex, p);
2723
+ return p;
2724
+ };
2725
+ var GravPowerProvider_instance;
2726
+ function GravPowerProvider_getInstance() {
2727
+ return GravPowerProvider_instance;
2728
+ }
2729
+ function Harmonic(freqRadS, phaseRad, amp) {
2730
+ this.a1m_1 = freqRadS;
2731
+ this.b1m_1 = phaseRad;
2732
+ this.c1m_1 = amp;
2733
+ }
2734
+ protoOf(Harmonic).toString = function () {
2735
+ return 'Harmonic(freqRadS=' + this.a1m_1 + ', phaseRad=' + this.b1m_1 + ', amp=' + this.c1m_1 + ')';
2736
+ };
2737
+ protoOf(Harmonic).hashCode = function () {
2738
+ var result = getNumberHashCode(this.a1m_1);
2739
+ result = imul(result, 31) + getNumberHashCode(this.b1m_1) | 0;
2740
+ result = imul(result, 31) + getNumberHashCode(this.c1m_1) | 0;
2741
+ return result;
2742
+ };
2743
+ protoOf(Harmonic).equals = function (other) {
2744
+ if (this === other)
2745
+ return true;
2746
+ if (!(other instanceof Harmonic))
2747
+ return false;
2748
+ if (!equals(this.a1m_1, other.a1m_1))
2749
+ return false;
2750
+ if (!equals(this.b1m_1, other.b1m_1))
2751
+ return false;
2752
+ if (!equals(this.c1m_1, other.c1m_1))
2753
+ return false;
2754
+ return true;
2755
+ };
2756
+ function computeCorneringLimit($this, course, currentIndex, window_0) {
2757
+ var path = course.w1d_1;
2758
+ var radius = computeRadiusWindowed($this, path, currentIndex, window_0);
2759
+ // Inline function 'kotlin.math.sqrt' call
2760
+ var x = 9.8 * radius * course.x1d_1.s1e();
2761
+ var vMax = Math.sqrt(x);
2762
+ // Inline function 'kotlin.math.min' call
2763
+ var a = course.x1d_1.u1e();
2764
+ var result = Math.min(a, vMax);
2765
+ path.e1k(currentIndex, result);
2766
+ return result;
2767
+ }
2768
+ function computeRadiusWindowed($this, path, i, k) {
2769
+ // Inline function 'kotlin.math.max' call
2770
+ var b = i - k | 0;
2771
+ var mini = Math.max(0, b);
2772
+ var tmp0 = path.v1g_1 - 1 | 0;
2773
+ // Inline function 'kotlin.math.min' call
2774
+ var b_0 = i + k | 0;
2775
+ var maxi = Math.min(tmp0, b_0);
2776
+ var totalBearingChange = $this.e1m(path.f1j(maxi) - path.f1j(mini));
2777
+ var totalDistance = path.z1i(maxi) - path.z1i(mini);
2778
+ // Inline function 'kotlin.math.abs' call
2779
+ if (Math.abs(totalBearingChange) < 0.001) {
2780
+ path.j1j(i, 200.0);
2781
+ return 200.0;
2782
+ }
2783
+ // Inline function 'kotlin.math.abs' call
2784
+ var raw = totalDistance / Math.abs(totalBearingChange);
2785
+ // Inline function 'kotlin.math.min' call
2786
+ // Inline function 'kotlin.math.max' call
2787
+ var b_1 = Math.min(200.0, raw);
2788
+ var clamped = Math.max(5.0, b_1);
2789
+ path.j1j(i, clamped);
2790
+ return clamped;
2791
+ }
2792
+ function computeBrakingLimit($this, course, currentIndex, nextIndex) {
2793
+ var path = course.w1d_1;
2794
+ var vf = path.c1k(nextIndex);
2795
+ var a = course.x1d_1.t1e();
2796
+ var d = path.z1i(nextIndex) - path.z1i(currentIndex);
2797
+ // Inline function 'kotlin.math.sqrt' call
2798
+ var x = vf * vf + 2.0 * a * d;
2799
+ return Math.sqrt(x);
2800
+ }
2801
+ function MaxSpeedComputer() {
2802
+ this.v1f_1 = 200.0;
2803
+ this.w1f_1 = 5.0;
2804
+ this.x1f_1 = 2.0;
2805
+ this.y1f_1 = 0.001;
2806
+ this.z1f_1 = 10;
2807
+ }
2808
+ protoOf(MaxSpeedComputer).a1g = function (course) {
2809
+ var path = course.w1d_1;
2810
+ var n = path.v1g_1;
2811
+ var inductionVariable = n - 1 | 0;
2812
+ if (0 <= inductionVariable)
2813
+ do {
2814
+ var i = inductionVariable;
2815
+ inductionVariable = inductionVariable + -1 | 0;
2816
+ if (i === (n - 1 | 0)) {
2817
+ path.d1k(i, 2.0);
2818
+ } else {
2819
+ var cornering = computeCorneringLimit(this, course, i, 10);
2820
+ var braking = computeBrakingLimit(this, course, i, i + 1 | 0);
2821
+ // Inline function 'kotlin.math.min' call
2822
+ var tmp$ret$0 = Math.min(cornering, braking);
2823
+ path.d1k(i, tmp$ret$0);
2824
+ }
2825
+ }
2826
+ while (0 <= inductionVariable);
2827
+ path.b1i();
2828
+ };
2829
+ protoOf(MaxSpeedComputer).e1m = function (angleIn) {
2830
+ var a = angleIn;
2831
+ while (a > 3.141592653589793)
2832
+ a = a - 2.0 * 3.141592653589793;
2833
+ while (a < -3.141592653589793)
2834
+ a = a + 2.0 * 3.141592653589793;
2835
+ return a;
2836
+ };
2837
+ var MaxSpeedComputer_instance;
2838
+ function MaxSpeedComputer_getInstance() {
2839
+ return MaxSpeedComputer_instance;
2840
+ }
2841
+ function MuscularPowerProvider() {
2842
+ }
2843
+ protoOf(MuscularPowerProvider).r1l = function (course, path, pointIndex) {
2844
+ var muscular = course.g1e_1.r1l(course, path, pointIndex);
2845
+ path.u1j(pointIndex, muscular);
2846
+ var wheel = muscular * course.j1e().u1d_1;
2847
+ path.v1j(pointIndex, wheel);
2848
+ return wheel;
2849
+ };
2850
+ var MuscularPowerProvider_instance;
2851
+ function MuscularPowerProvider_getInstance() {
2852
+ return MuscularPowerProvider_instance;
2853
+ }
2854
+ function getDtInner($this, pSum, equivalentMass, currentSpeed, dx, dt1Init, dt2Init) {
2855
+ var dt1 = dt1Init;
2856
+ var dt2 = dt2Init;
2857
+ var tol = dx / 1.0E7;
2858
+ while (dt2 - dt1 >= tol) {
2859
+ var dtMid = (dt1 + dt2) / 2.0;
2860
+ var dxMid = $this.f1m(pSum, equivalentMass, currentSpeed, dtMid);
2861
+ if (dxMid < dx)
2862
+ dt1 = dtMid;
2863
+ else
2864
+ dt2 = dtMid;
2865
+ }
2866
+ return (dt1 + dt2) / 2.0;
2867
+ }
2868
+ function PowerComputer() {
2869
+ }
2870
+ protoOf(PowerComputer).d1m = function (course, path, pointIndex, withCyclist) {
2871
+ var pSum = 0.0;
2872
+ pSum = pSum + WheelBearingsPowerProvider_instance.r1l(course, path, pointIndex);
2873
+ pSum = pSum + RollingResistancePowerProvider_instance.r1l(course, path, pointIndex);
2874
+ pSum = pSum + AeroPowerProvider_instance.r1l(course, path, pointIndex);
2875
+ pSum = pSum + GravPowerProvider_instance.r1l(course, path, pointIndex);
2876
+ if (withCyclist) {
2877
+ pSum = pSum + MuscularPowerProvider_instance.r1l(course, path, pointIndex);
2878
+ }
2879
+ return pSum;
2880
+ };
2881
+ protoOf(PowerComputer).f1m = function (pSum, equivalentMass, currentSpeed, dt) {
2882
+ // Inline function 'kotlin.math.sqrt' call
2883
+ var x = dt * pSum / (0.5 * equivalentMass) + currentSpeed * currentSpeed;
2884
+ var tmp0 = Math.sqrt(x);
2885
+ // Inline function 'kotlin.math.max' call
2886
+ var b = 0.5555555555555556;
2887
+ var newSpeed = Math.max(tmp0, b);
2888
+ return (currentSpeed + newSpeed) * dt / 2.0;
2889
+ };
2890
+ protoOf(PowerComputer).g1m = function (equivalentMass, s1, s2, dt) {
2891
+ return 0.5 * equivalentMass * (s2 * s2 - s1 * s1) / dt;
2892
+ };
2893
+ protoOf(PowerComputer).h1m = function (pSum, equivalentMass, currentSpeed, dx) {
2894
+ var dt = 0.1;
2895
+ while (this.f1m(pSum, equivalentMass, currentSpeed, dt) <= dx) {
2896
+ dt = dt + 0.1;
2897
+ }
2898
+ return getDtInner(this, pSum, equivalentMass, currentSpeed, dx, dt - 0.1, dt);
2899
+ };
2900
+ protoOf(PowerComputer).i1m = function (course, path, equivalentMass, i) {
2901
+ if (i === 0) {
2902
+ path.z1j(i, 0.0);
2903
+ return Unit_instance;
2904
+ }
2905
+ var resistive = this.d1m(course, path, i - 1 | 0, false);
2906
+ var s1 = path.a1k(i - 1 | 0);
2907
+ var s2 = path.a1k(i);
2908
+ var dtSeconds = path.d1j(i) / 1000.0;
2909
+ var totPower = this.g1m(equivalentMass, s1, s2, dtSeconds);
2910
+ path.w1j(i, totPower);
2911
+ var powerWheel = totPower - resistive;
2912
+ path.x1j(i, powerWheel);
2913
+ // Inline function 'kotlin.math.max' call
2914
+ var computed = Math.max(0.0, powerWheel) / course.j1e().u1d_1;
2915
+ path.z1j(i, computed);
2916
+ };
2917
+ protoOf(PowerComputer).j1m = function (course) {
2918
+ var m = course.x1d_1.m1e_1;
2919
+ var totalInertia = course.y1d_1.r1d_1 + course.y1d_1.s1d_1;
2920
+ return m + totalInertia / (course.y1d_1.t1d_1 * course.y1d_1.t1d_1);
2921
+ };
2922
+ protoOf(PowerComputer).k1m = function (course) {
2923
+ return this.j1m(course.c1e_1);
2924
+ };
2925
+ var PowerComputer_instance;
2926
+ function PowerComputer_getInstance() {
2927
+ return PowerComputer_instance;
2928
+ }
2929
+ function PowerProviderConstant(power, useHarmonics, random) {
2930
+ useHarmonics = useHarmonics === VOID ? false : useHarmonics;
2931
+ random = random === VOID ? Default_getInstance() : random;
2932
+ CyclistPowerProviderBase.call(this, useHarmonics, random);
2933
+ this.n1m_1 = power;
2934
+ }
2935
+ protoOf(PowerProviderConstant).z1l = function (course, path, pointIndex) {
2936
+ return this.n1m_1;
2937
+ };
2938
+ function RhoProviderDefault() {
2939
+ }
2940
+ protoOf(RhoProviderDefault).u1l = function (course, path, pointIndex) {
2941
+ return 1.225;
2942
+ };
2943
+ var RhoProviderDefault_instance;
2944
+ function RhoProviderDefault_getInstance() {
2945
+ return RhoProviderDefault_instance;
2946
+ }
2947
+ function RhoProviderEstimate() {
2948
+ this.o1m_1 = 101325.0;
2949
+ this.p1m_1 = 288.15;
2950
+ this.q1m_1 = 9.80665;
2951
+ this.r1m_1 = 0.0065;
2952
+ this.s1m_1 = 287.05;
2953
+ }
2954
+ protoOf(RhoProviderEstimate).u1l = function (course, path, pointIndex) {
2955
+ var providedTemp = path.k1i(pointIndex, PointField_TEMPERATURE_getInstance());
2956
+ var temperatureC = isNaN_0(providedTemp) || providedTemp === 0.0 ? 15.0 : providedTemp;
2957
+ var providedElevation = path.z1g(pointIndex);
2958
+ var altitude = isNaN_0(providedElevation) ? 0.0 : providedElevation;
2959
+ var tKelvin = temperatureC + 273.15;
2960
+ var tmp0 = 1.0 - 0.0065 * altitude / 288.15;
2961
+ // Inline function 'kotlin.math.pow' call
2962
+ var x = 9.80665 / (287.05 * 0.0065);
2963
+ var pressure = 101325.0 * Math.pow(tmp0, x);
2964
+ return pressure / (287.05 * tKelvin);
2965
+ };
2966
+ var RhoProviderEstimate_instance;
2967
+ function RhoProviderEstimate_getInstance() {
2968
+ return RhoProviderEstimate_instance;
2969
+ }
2970
+ function RollingResistancePowerProvider() {
2971
+ }
2972
+ protoOf(RollingResistancePowerProvider).r1l = function (course, path, pointIndex) {
2973
+ var m = course.i1e().m1e_1;
2974
+ var crr = course.j1e().q1d_1;
2975
+ var grade = path.h1j(pointIndex);
2976
+ var speed = path.a1k(pointIndex);
2977
+ // Inline function 'kotlin.math.atan' call
2978
+ // Inline function 'kotlin.math.cos' call
2979
+ var x = Math.atan(grade);
2980
+ var coef = Math.cos(x);
2981
+ var p = -coef * m * 9.8 * speed * crr;
2982
+ path.p1j(pointIndex, p);
2983
+ return p;
2984
+ };
2985
+ var RollingResistancePowerProvider_instance;
2986
+ function RollingResistancePowerProvider_getInstance() {
2987
+ return RollingResistancePowerProvider_instance;
2988
+ }
2989
+ function copyAllFields($this, src, i, dst, j) {
2990
+ var _iterator__ex2g4s = get_entries().i();
2991
+ while (_iterator__ex2g4s.j()) {
2992
+ var field = _iterator__ex2g4s.k();
2993
+ dst.l1i(j, field, src.k1i(i, field));
2994
+ }
2995
+ }
2996
+ function VirtualizeService() {
2997
+ this.b1g_1 = 100000;
2998
+ }
2999
+ protoOf(VirtualizeService).c1g = function (course) {
3000
+ var input = course.h1e();
3001
+ var n = input.v1g_1;
3002
+ if (n === 0)
3003
+ return new Path(0);
3004
+ if (n === 1) {
3005
+ var singleton = new Path(1);
3006
+ copyAllFields(this, input, 0, singleton, 0);
3007
+ return singleton;
3008
+ }
3009
+ var mEq = PowerComputer_instance.k1m(course);
3010
+ var out = new Path(n);
3011
+ copyAllFields(this, input, 0, out, 0);
3012
+ var speed = 0.5555555555555556;
3013
+ var startTimeMs = 0.0;
3014
+ var timeMs = startTimeMs;
3015
+ out.n1h(0, timeMs);
3016
+ out.c1j(0, 0.0);
3017
+ out.b1k(0, speed);
3018
+ out.f1k(0, speed);
3019
+ var i = 1;
3020
+ var iter = 0;
3021
+ $l$loop: while (i < n) {
3022
+ var dx = input.z1i(i) - input.z1i(i - 1 | 0);
3023
+ var pSum = PowerComputer_instance.d1m(course, out, i - 1 | 0, true);
3024
+ var dt = PowerComputer_instance.h1m(pSum, mEq, speed, dx);
3025
+ var speedNew = 2.0 * dx / dt - speed;
3026
+ copyAllFields(this, input, i, out, i);
3027
+ var speedMax = input.c1k(i);
3028
+ if (speedNew > speedMax) {
3029
+ speedNew = speedMax;
3030
+ dt = 2.0 * dx / (speedNew + speed);
3031
+ }
3032
+ speed = speedNew;
3033
+ timeMs = timeMs + dt * 1000.0;
3034
+ out.n1h(i, timeMs);
3035
+ out.c1j(i, timeMs - startTimeMs);
3036
+ out.b1j(i, dx);
3037
+ out.e1j(i, dt * 1000.0);
3038
+ out.b1k(i, speed);
3039
+ out.f1k(i, speed);
3040
+ i = i + 1 | 0;
3041
+ var _unary__edvuaz = iter;
3042
+ iter = _unary__edvuaz + 1 | 0;
3043
+ if (_unary__edvuaz > 100000)
3044
+ break $l$loop;
3045
+ }
3046
+ var progression = out.n1k();
3047
+ var inductionVariable = progression.qa_1;
3048
+ var last = progression.ra_1;
3049
+ if (inductionVariable <= last)
3050
+ do {
3051
+ var j = inductionVariable;
3052
+ inductionVariable = inductionVariable + 1 | 0;
3053
+ PowerComputer_instance.i1m(course, out, mEq, j);
3054
+ }
3055
+ while (!(j === last));
3056
+ out.b1i();
3057
+ return out;
3058
+ };
3059
+ var VirtualizeService_instance;
3060
+ function VirtualizeService_getInstance() {
3061
+ return VirtualizeService_instance;
3062
+ }
3063
+ function WheelBearingsPowerProvider() {
3064
+ }
3065
+ protoOf(WheelBearingsPowerProvider).r1l = function (course, path, pointIndex) {
3066
+ var speed = path.a1k(pointIndex);
3067
+ var p = -speed * (91.0 + 8.7 * speed) / 1000.0;
3068
+ path.q1j(pointIndex, p);
3069
+ return p;
3070
+ };
3071
+ var WheelBearingsPowerProvider_instance;
3072
+ function WheelBearingsPowerProvider_getInstance() {
3073
+ return WheelBearingsPowerProvider_instance;
3074
+ }
3075
+ function Companion_7() {
3076
+ Companion_instance_7 = this;
3077
+ this.t1m_1 = new Wind(0.0, 0.0);
3078
+ }
3079
+ var Companion_instance_7;
3080
+ function Companion_getInstance_8() {
3081
+ if (Companion_instance_7 == null)
3082
+ new Companion_7();
3083
+ return Companion_instance_7;
3084
+ }
3085
+ function Wind(speedMS, directionRad) {
3086
+ Companion_getInstance_8();
3087
+ this.o1l_1 = speedMS;
3088
+ this.p1l_1 = directionRad;
3089
+ }
3090
+ protoOf(Wind).toString = function () {
3091
+ return 'Wind(speedMS=' + this.o1l_1 + ', directionRad=' + this.p1l_1 + ')';
3092
+ };
3093
+ protoOf(Wind).hashCode = function () {
3094
+ var result = getNumberHashCode(this.o1l_1);
3095
+ result = imul(result, 31) + getNumberHashCode(this.p1l_1) | 0;
3096
+ return result;
3097
+ };
3098
+ protoOf(Wind).equals = function (other) {
3099
+ if (this === other)
3100
+ return true;
3101
+ if (!(other instanceof Wind))
3102
+ return false;
3103
+ if (!equals(this.o1l_1, other.o1l_1))
3104
+ return false;
3105
+ if (!equals(this.p1l_1, other.p1l_1))
3106
+ return false;
3107
+ return true;
3108
+ };
3109
+ function WindProviderNone() {
3110
+ }
3111
+ protoOf(WindProviderNone).t1l = function (course, path, pointIndex) {
3112
+ return Companion_getInstance_8().t1m_1;
3113
+ };
3114
+ var WindProviderNone_instance;
3115
+ function WindProviderNone_getInstance() {
3116
+ return WindProviderNone_instance;
3117
+ }
3118
+ function parseGpx(xml) {
3119
+ return firstTrackAsPath(GpxParser_instance.j1h(xml));
3120
+ }
3121
+ function pathSize(path) {
3122
+ return path.v1g_1;
3123
+ }
3124
+ function pathTotalDistance(path) {
3125
+ return path.u1h_1;
3126
+ }
3127
+ function pathDurationMs(path) {
3128
+ return path.z1h_1;
3129
+ }
3130
+ function pathElevationGain(path) {
3131
+ return path.x1h_1;
3132
+ }
3133
+ function pathElevationLoss(path) {
3134
+ return path.y1h_1;
3135
+ }
3136
+ function pointAt(path, i) {
3137
+ return pointObj(path.o1k(i), path.p1k(i), path.z1g(i), path.a1h(i), path.a1k(i), path.y1j(i), path.z1i(i), path.h1j(i));
3138
+ }
3139
+ function writeGpx(path) {
3140
+ return GpxWriter_instance.j1i(toGpxDocument(path, VOID, 'virtualized'));
3141
+ }
3142
+ function enhance(path, options) {
3143
+ var tmp = GlobalScope_instance;
3144
+ return promise(tmp, VOID, VOID, enhance$slambda_0(options, path, null));
3145
+ }
3146
+ function pointObj(latitudeDeg, longitudeDeg, elevation, timeMs, speed, pComputedPower, distance, grade) {
3147
+ var o = {};
3148
+ o.latitudeDeg = latitudeDeg;
3149
+ o.longitudeDeg = longitudeDeg;
3150
+ o.elevation = elevation;
3151
+ o.timeMs = timeMs;
3152
+ o.speed = speed;
3153
+ o.pComputedPower = pComputedPower;
3154
+ o.distance = distance;
3155
+ o.grade = grade;
3156
+ // Inline function 'kotlin.js.unsafeCast' call
3157
+ return o;
3158
+ }
3159
+ function toEnhanceOptions(_this__u8e3s4) {
3160
+ if (_this__u8e3s4 == null)
3161
+ return defaultJsOptions();
3162
+ var tmp0_elvis_lhs = _this__u8e3s4.fixElevation;
3163
+ var tmp = tmp0_elvis_lhs == null ? false : tmp0_elvis_lhs;
3164
+ var tmp1_elvis_lhs = _this__u8e3s4.computeMaxSpeeds;
3165
+ var tmp_0 = tmp1_elvis_lhs == null ? true : tmp1_elvis_lhs;
3166
+ var tmp2_elvis_lhs = _this__u8e3s4.virtualizeTrack;
3167
+ var tmp_1 = tmp2_elvis_lhs == null ? true : tmp2_elvis_lhs;
3168
+ var tmp3_elvis_lhs = _this__u8e3s4.computeOnePointPerSecond;
3169
+ var tmp_2 = tmp3_elvis_lhs == null ? false : tmp3_elvis_lhs;
3170
+ var tmp4_elvis_lhs = _this__u8e3s4.simplifyEnabled;
3171
+ var tmp_3 = tmp4_elvis_lhs == null ? false : tmp4_elvis_lhs;
3172
+ var tmp5_elvis_lhs = _this__u8e3s4.simplifyToleranceM;
3173
+ var tmp_4 = tmp5_elvis_lhs == null ? 10.0 : tmp5_elvis_lhs;
3174
+ var tmp6_elvis_lhs = _this__u8e3s4.simplifyZExaggeration;
3175
+ return new EnhanceOptions(tmp, tmp_0, tmp_1, tmp_2, new SimplifyPathOptions(tmp_3, tmp_4, tmp6_elvis_lhs == null ? 3.0 : tmp6_elvis_lhs));
3176
+ }
3177
+ function defaultJsOptions() {
3178
+ return new EnhanceOptions(false, true, true, false, new SimplifyPathOptions(false));
3179
+ }
3180
+ function enhance$slambda($options, $path, resultContinuation) {
3181
+ this.c1n_1 = $options;
3182
+ this.d1n_1 = $path;
3183
+ CoroutineImpl.call(this, resultContinuation);
3184
+ }
3185
+ protoOf(enhance$slambda).f1n = function ($this$promise, $completion) {
3186
+ var tmp = this.qz($this$promise, $completion);
3187
+ tmp.w5_1 = Unit_instance;
3188
+ tmp.x5_1 = null;
3189
+ return tmp.c6();
3190
+ };
3191
+ protoOf(enhance$slambda).k6 = function (p1, $completion) {
3192
+ return this.f1n((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
3193
+ };
3194
+ protoOf(enhance$slambda).c6 = function () {
3195
+ var suspendResult = this.w5_1;
3196
+ $sm: do
3197
+ try {
3198
+ var tmp = this.u5_1;
3199
+ switch (tmp) {
3200
+ case 0:
3201
+ this.v5_1 = 2;
3202
+ var opts = toEnhanceOptions(this.c1n_1);
3203
+ this.u5_1 = 1;
3204
+ suspendResult = Enhancer_instance.g1g(this.d1n_1, null, opts, this);
3205
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
3206
+ return suspendResult;
3207
+ }
3208
+
3209
+ continue $sm;
3210
+ case 1:
3211
+ return suspendResult;
3212
+ case 2:
3213
+ throw this.x5_1;
3214
+ }
3215
+ } catch ($p) {
3216
+ var e = $p;
3217
+ if (this.v5_1 === 2) {
3218
+ throw e;
3219
+ } else {
3220
+ this.u5_1 = this.v5_1;
3221
+ this.x5_1 = e;
3222
+ }
3223
+ }
3224
+ while (true);
3225
+ };
3226
+ protoOf(enhance$slambda).qz = function ($this$promise, completion) {
3227
+ var i = new enhance$slambda(this.c1n_1, this.d1n_1, completion);
3228
+ i.e1n_1 = $this$promise;
3229
+ return i;
3230
+ };
3231
+ function enhance$slambda_0($options, $path, resultContinuation) {
3232
+ var i = new enhance$slambda($options, $path, resultContinuation);
3233
+ var l = function ($this$promise, $completion) {
3234
+ return i.f1n($this$promise, $completion);
3235
+ };
3236
+ l.$arity = 1;
3237
+ return l;
3238
+ }
3239
+ //region block: init
3240
+ Enhancer_instance = new Enhancer();
3241
+ GpxParser_instance = new GpxParser();
3242
+ GpxWriter_instance = new GpxWriter();
3243
+ ElevationStep_instance = new ElevationStep();
3244
+ Companion_instance_4 = new Companion_4();
3245
+ PathSimplifier_instance = new PathSimplifier();
3246
+ PointPerDistance_instance = new PointPerDistance();
3247
+ PointPerSecond_instance = new PointPerSecond();
3248
+ AeroPowerProvider_instance = new AeroPowerProvider();
3249
+ AeroProviderConstant_instance = new AeroProviderConstant();
3250
+ Companion_instance_6 = new Companion_6();
3251
+ GravPowerProvider_instance = new GravPowerProvider();
3252
+ MaxSpeedComputer_instance = new MaxSpeedComputer();
3253
+ MuscularPowerProvider_instance = new MuscularPowerProvider();
3254
+ PowerComputer_instance = new PowerComputer();
3255
+ RhoProviderDefault_instance = new RhoProviderDefault();
3256
+ RhoProviderEstimate_instance = new RhoProviderEstimate();
3257
+ RollingResistancePowerProvider_instance = new RollingResistancePowerProvider();
3258
+ VirtualizeService_instance = new VirtualizeService();
3259
+ WheelBearingsPowerProvider_instance = new WheelBearingsPowerProvider();
3260
+ WindProviderNone_instance = new WindProviderNone();
3261
+ //endregion
3262
+ //region block: exports
3263
+ function $jsExportAll$(_) {
3264
+ var io = _.io || (_.io = {});
3265
+ var github = io.github || (io.github = {});
3266
+ var glandais = github.glandais || (github.glandais = {});
3267
+ var engine = glandais.engine || (glandais.engine = {});
3268
+ engine.parseGpx = parseGpx;
3269
+ engine.pathSize = pathSize;
3270
+ engine.pathTotalDistance = pathTotalDistance;
3271
+ engine.pathDurationMs = pathDurationMs;
3272
+ engine.pathElevationGain = pathElevationGain;
3273
+ engine.pathElevationLoss = pathElevationLoss;
3274
+ engine.pointAt = pointAt;
3275
+ engine.writeGpx = writeGpx;
3276
+ engine.enhance = enhance;
3277
+ }
3278
+ $jsExportAll$(_);
3279
+ kotlin_io_github_glandais_elevation.$jsExportAll$(_);
3280
+ //endregion
3281
+ return _;
3282
+ }));
3283
+
3284
+ //# sourceMappingURL=vcyclist-engine.js.map