@glandais/vcyclist-engine 4.2.0 → 4.3.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.
@@ -43,11 +43,11 @@
43
43
  var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.a2;
44
44
  var Unit_instance = kotlin_kotlin.$_$.g1;
45
45
  var CoroutineImpl = kotlin_kotlin.$_$.d5;
46
- var PointPerDistance_instance = kotlin_io_github_glandais_gpx.$_$.k;
47
- var ElevationStep_instance = kotlin_io_github_glandais_gpx.$_$.h;
46
+ var PointPerDistance_instance = kotlin_io_github_glandais_gpx.$_$.l;
47
+ var ElevationStep_instance = kotlin_io_github_glandais_gpx.$_$.i;
48
48
  var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.o4;
49
- var PointPerSecond_instance = kotlin_io_github_glandais_gpx.$_$.l;
50
- var PathSimplifier_instance = kotlin_io_github_glandais_gpx.$_$.i;
49
+ var PointPerSecond_instance = kotlin_io_github_glandais_gpx.$_$.m;
50
+ var PathSimplifier_instance = kotlin_io_github_glandais_gpx.$_$.j;
51
51
  var initMetadataForCoroutine = kotlin_kotlin.$_$.w6;
52
52
  var enumEntries = kotlin_kotlin.$_$.f5;
53
53
  var Enum = kotlin_kotlin.$_$.t9;
@@ -79,8 +79,8 @@
79
79
  var isNaN_0 = kotlin_kotlin.$_$.oa;
80
80
  var isFinite = kotlin_kotlin.$_$.ma;
81
81
  var PointField_TEMPERATURE_getInstance = kotlin_io_github_glandais_gpx.$_$.c;
82
- var get_entries = kotlin_io_github_glandais_gpx.$_$.u;
83
- var Path = kotlin_io_github_glandais_gpx.$_$.t;
82
+ var get_entries = kotlin_io_github_glandais_gpx.$_$.w;
83
+ var Path = kotlin_io_github_glandais_gpx.$_$.v;
84
84
  var arrayCopy = kotlin_kotlin.$_$.t2;
85
85
  var sort = kotlin_kotlin.$_$.d4;
86
86
  var numberToInt = kotlin_kotlin.$_$.h7;
@@ -104,34 +104,36 @@
104
104
  var joinToString = kotlin_kotlin.$_$.m3;
105
105
  var GpxParser_instance = kotlin_io_github_glandais_gpx.$_$.d;
106
106
  var copyToArray = kotlin_kotlin.$_$.f3;
107
- var firstTrackAsPath = kotlin_io_github_glandais_gpx.$_$.n;
108
- var tracksAsPaths = kotlin_io_github_glandais_gpx.$_$.q;
109
- var segmentsAsPaths = kotlin_io_github_glandais_gpx.$_$.o;
107
+ var firstTrackAsPath = kotlin_io_github_glandais_gpx.$_$.o;
108
+ var tracksAsPaths = kotlin_io_github_glandais_gpx.$_$.s;
109
+ var segmentsAsPaths = kotlin_io_github_glandais_gpx.$_$.q;
110
110
  var GpxPathKind_TRACK_getInstance = kotlin_io_github_glandais_gpx.$_$.b;
111
111
  var setOf = kotlin_kotlin.$_$.z3;
112
112
  var GpxPathKind_ROUTE_getInstance = kotlin_io_github_glandais_gpx.$_$.a;
113
- var GpxWriter_instance = kotlin_io_github_glandais_gpx.$_$.e;
113
+ var GpxWriter_instance = kotlin_io_github_glandais_gpx.$_$.f;
114
114
  var toList = kotlin_kotlin.$_$.i4;
115
- var toGpxDocument = kotlin_io_github_glandais_gpx.$_$.p;
115
+ var pathsToGpxDocument = kotlin_io_github_glandais_gpx.$_$.p;
116
+ var toGpxDocument = kotlin_io_github_glandais_gpx.$_$.r;
116
117
  var Companion_getInstance = kotlin_kotlin.$_$.d1;
117
118
  var GlobalScope_instance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a;
118
119
  var promise = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j;
119
- var Companion_getInstance_0 = kotlin_io_github_glandais_gpx.$_$.j;
120
+ var Companion_getInstance_0 = kotlin_io_github_glandais_gpx.$_$.k;
120
121
  var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.c2;
121
- var CsvWriter_instance = kotlin_io_github_glandais_gpx.$_$.f;
122
+ var CsvWriter_instance = kotlin_io_github_glandais_gpx.$_$.g;
122
123
  var firstOrNull = kotlin_kotlin.$_$.q8;
123
124
  var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.b;
124
125
  var Char = kotlin_kotlin.$_$.r9;
125
- var CsvOptions = kotlin_io_github_glandais_gpx.$_$.r;
126
- var JsonWriter_instance = kotlin_io_github_glandais_gpx.$_$.g;
127
- var JsonOptions = kotlin_io_github_glandais_gpx.$_$.s;
126
+ var CsvOptions = kotlin_io_github_glandais_gpx.$_$.t;
127
+ var JsonWriter_instance = kotlin_io_github_glandais_gpx.$_$.h;
128
+ var JsonOptions = kotlin_io_github_glandais_gpx.$_$.u;
128
129
  var toFitBytes = kotlin_io_github_glandais_fit.$_$.a;
129
130
  var Companion_getInstance_1 = kotlin_kotlin.$_$.c1;
130
131
  var DurationUnit_MILLISECONDS_getInstance = kotlin_kotlin.$_$.w;
131
132
  var toDuration = kotlin_kotlin.$_$.q9;
132
133
  var toFitBytes_0 = kotlin_io_github_glandais_fit.$_$.b;
133
134
  var toNumber = kotlin_kotlin.$_$.a6;
134
- var GpxWaypoint = kotlin_io_github_glandais_gpx.$_$.m;
135
+ var Companion_getInstance_2 = kotlin_io_github_glandais_gpx.$_$.e;
136
+ var GpxWaypoint = kotlin_io_github_glandais_gpx.$_$.n;
135
137
  var sorted = kotlin_kotlin.$_$.c4;
136
138
  var THROW_CCE = kotlin_kotlin.$_$.ca;
137
139
  var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h;
@@ -228,13 +230,13 @@
228
230
  this.DEFAULT_1 = new Bike();
229
231
  }
230
232
  var Companion_instance_0;
231
- function Companion_getInstance_2() {
233
+ function Companion_getInstance_3() {
232
234
  if (Companion_instance_0 == null)
233
235
  new Companion();
234
236
  return Companion_instance_0;
235
237
  }
236
238
  function Bike(crr, inertiaFront, inertiaRear, wheelRadiusM, efficiency, maxPedalingLeanAngleDeg) {
237
- Companion_getInstance_2();
239
+ Companion_getInstance_3();
238
240
  crr = crr === VOID ? 0.004 : crr;
239
241
  inertiaFront = inertiaFront === VOID ? 0.05 : inertiaFront;
240
242
  inertiaRear = inertiaRear === VOID ? 0.07 : inertiaRear;
@@ -291,8 +293,8 @@
291
293
  return true;
292
294
  };
293
295
  function Course(path, cyclist, bike) {
294
- cyclist = cyclist === VOID ? Companion_getInstance_4().DEFAULT_1 : cyclist;
295
- bike = bike === VOID ? Companion_getInstance_2().DEFAULT_1 : bike;
296
+ cyclist = cyclist === VOID ? Companion_getInstance_5().DEFAULT_1 : cyclist;
297
+ bike = bike === VOID ? Companion_getInstance_3().DEFAULT_1 : bike;
296
298
  this.path_1 = path;
297
299
  this.cyclist_1 = cyclist;
298
300
  this.bike_1 = bike;
@@ -333,17 +335,17 @@
333
335
  this.DEFAULT_CYCLIST_POWER_PROVIDER_1 = new PowerProviderConstant(280.0);
334
336
  }
335
337
  var Companion_instance_1;
336
- function Companion_getInstance_3() {
338
+ function Companion_getInstance_4() {
337
339
  if (Companion_instance_1 == null)
338
340
  new Companion_0();
339
341
  return Companion_instance_1;
340
342
  }
341
343
  function CoursePhysics(course, rhoProvider, aeroProvider, windProvider, cyclistPowerProvider) {
342
- Companion_getInstance_3();
344
+ Companion_getInstance_4();
343
345
  rhoProvider = rhoProvider === VOID ? RhoProviderDefault_instance : rhoProvider;
344
346
  aeroProvider = aeroProvider === VOID ? AeroProviderConstant_instance : aeroProvider;
345
347
  windProvider = windProvider === VOID ? WindProviderNone_instance : windProvider;
346
- cyclistPowerProvider = cyclistPowerProvider === VOID ? Companion_getInstance_3().DEFAULT_CYCLIST_POWER_PROVIDER_1 : cyclistPowerProvider;
348
+ cyclistPowerProvider = cyclistPowerProvider === VOID ? Companion_getInstance_4().DEFAULT_CYCLIST_POWER_PROVIDER_1 : cyclistPowerProvider;
347
349
  this.course_1 = course;
348
350
  this.rhoProvider_1 = rhoProvider;
349
351
  this.aeroProvider_1 = aeroProvider;
@@ -403,13 +405,13 @@
403
405
  this.DEFAULT_1 = new Cyclist();
404
406
  }
405
407
  var Companion_instance_2;
406
- function Companion_getInstance_4() {
408
+ function Companion_getInstance_5() {
407
409
  if (Companion_instance_2 == null)
408
410
  new Companion_1();
409
411
  return Companion_instance_2;
410
412
  }
411
413
  function Cyclist(massKg, maxBrakeG, cd, frontalAreaM2, maxLeanAngleDeg, maxSpeedKmH) {
412
- Companion_getInstance_4();
414
+ Companion_getInstance_5();
413
415
  massKg = massKg === VOID ? 80.0 : massKg;
414
416
  maxBrakeG = maxBrakeG === VOID ? 0.4 : maxBrakeG;
415
417
  cd = cd === VOID ? 0.7 : cd;
@@ -577,13 +579,13 @@
577
579
  this.DEFAULT_1 = new EnhanceOptions();
578
580
  }
579
581
  var Companion_instance_3;
580
- function Companion_getInstance_5() {
582
+ function Companion_getInstance_6() {
581
583
  if (Companion_instance_3 == null)
582
584
  new Companion_2();
583
585
  return Companion_instance_3;
584
586
  }
585
587
  function EnhanceOptions(fixElevation, computeMaxSpeeds, virtualizeTrack, computeOnePointPerSecond, simplifyPath, wPrimeBalance, curvature, racingLine) {
586
- Companion_getInstance_5();
588
+ Companion_getInstance_6();
587
589
  fixElevation = fixElevation === VOID ? true : fixElevation;
588
590
  computeMaxSpeeds = computeMaxSpeeds === VOID ? true : computeMaxSpeeds;
589
591
  virtualizeTrack = virtualizeTrack === VOID ? true : virtualizeTrack;
@@ -934,13 +936,13 @@
934
936
  this.DEFAULT_1 = new ClimbOptions();
935
937
  }
936
938
  var Companion_instance_4;
937
- function Companion_getInstance_6() {
939
+ function Companion_getInstance_7() {
938
940
  if (Companion_instance_4 == null)
939
941
  new Companion_3();
940
942
  return Companion_instance_4;
941
943
  }
942
944
  function ClimbOptions(minMinClimbElevationM, maxMinClimbElevationM, minClimbElevationRatio, minGradePercent, maxDiffRealGradeRatio, booster, maxAnalysisPoints) {
943
- Companion_getInstance_6();
945
+ Companion_getInstance_7();
944
946
  minMinClimbElevationM = minMinClimbElevationM === VOID ? 10.0 : minMinClimbElevationM;
945
947
  maxMinClimbElevationM = maxMinClimbElevationM === VOID ? 35.0 : maxMinClimbElevationM;
946
948
  minClimbElevationRatio = minClimbElevationRatio === VOID ? 100.0 : minClimbElevationRatio;
@@ -1042,7 +1044,7 @@
1042
1044
  return new Profile(tmp_6, tmp_10, indices);
1043
1045
  };
1044
1046
  var Companion_instance_5;
1045
- function Companion_getInstance_7() {
1047
+ function Companion_getInstance_8() {
1046
1048
  return Companion_instance_5;
1047
1049
  }
1048
1050
  function Profile(distance, elevation, sourceIndex) {
@@ -1337,7 +1339,7 @@
1337
1339
  return destination_0;
1338
1340
  };
1339
1341
  protoOf(ClimbDetector).detect$default_6ml3ny_k$ = function (path, options, $super) {
1340
- options = options === VOID ? Companion_getInstance_6().DEFAULT_1 : options;
1342
+ options = options === VOID ? Companion_getInstance_7().DEFAULT_1 : options;
1341
1343
  return $super === VOID ? this.detect_llooq2_k$(path, options) : $super.detect_llooq2_k$.call(this, path, options);
1342
1344
  };
1343
1345
  var ClimbDetector_instance;
@@ -1495,7 +1497,7 @@
1495
1497
  this.MAX_MULTIPLIER_1 = 3.0;
1496
1498
  }
1497
1499
  var Companion_instance_6;
1498
- function Companion_getInstance_8() {
1500
+ function Companion_getInstance_9() {
1499
1501
  return Companion_instance_6;
1500
1502
  }
1501
1503
  function CyclistPowerProviderBase(useHarmonics, random) {
@@ -1594,7 +1596,7 @@
1594
1596
  return tmp$ret$0;
1595
1597
  };
1596
1598
  var Companion_instance_7;
1597
- function Companion_getInstance_9() {
1599
+ function Companion_getInstance_10() {
1598
1600
  return Companion_instance_7;
1599
1601
  }
1600
1602
  function values_0() {
@@ -1971,7 +1973,7 @@
1971
1973
  path.setPBrake_iza4qj_k$(i, 0.0);
1972
1974
  return Unit_instance;
1973
1975
  }
1974
- var dtSeconds = path.dt_17uzp4_k$(i) / 1000.0;
1976
+ var dtSeconds = path.dt_17uzp4_k$(i);
1975
1977
  if (dtSeconds <= 0.0) {
1976
1978
  path.setPComputedTotalPower_wm6di_k$(i, 0.0);
1977
1979
  path.setPComputedWheelPower_qplog3_k$(i, 0.0);
@@ -2018,7 +2020,7 @@
2018
2020
  this.DEFAULT_TAPER_START_FRACTION_1 = 0.5;
2019
2021
  }
2020
2022
  var Companion_instance_8;
2021
- function Companion_getInstance_10() {
2023
+ function Companion_getInstance_11() {
2022
2024
  return Companion_instance_8;
2023
2025
  }
2024
2026
  function PowerProviderCriticalPower(powerW, criticalPowerW, wPrimeJ, taperStartFraction, useHarmonics, random) {
@@ -2066,7 +2068,7 @@
2066
2068
  this.reset_5u6xz3_k$();
2067
2069
  }
2068
2070
  if (pointIndex > this.lastIndex_1) {
2069
- var elapsedS = path.elapsed_7307rw_k$(pointIndex) / 1000.0;
2071
+ var elapsedS = path.elapsed_7307rw_k$(pointIndex);
2070
2072
  var dtS = elapsedS - this.lastElapsedS_1;
2071
2073
  if (dtS > 0.0 && isFinite(dtS)) {
2072
2074
  this.wPrimeBalanceJ_1 = WPrimeBalanceComputer_instance.step_447nu7_k$(this.wPrimeBalanceJ_1, this.lastPowerW_1, this.criticalPowerW_1, this.wPrimeJ_1, dtS);
@@ -2102,7 +2104,7 @@
2102
2104
  this.DEFAULT_MAX_DECLINE_1 = 0.2;
2103
2105
  }
2104
2106
  var Companion_instance_9;
2105
- function Companion_getInstance_11() {
2107
+ function Companion_getInstance_12() {
2106
2108
  return Companion_instance_9;
2107
2109
  }
2108
2110
  function PowerProviderDurability(powerW, criticalPowerW, declinePerKjPerKg, maxDecline, useHarmonics, random) {
@@ -2155,7 +2157,7 @@
2155
2157
  this.reset_5u6xz3_k$();
2156
2158
  }
2157
2159
  if (pointIndex > this.lastIndex_1) {
2158
- var elapsedS = path.elapsed_7307rw_k$(pointIndex) / 1000.0;
2160
+ var elapsedS = path.elapsed_7307rw_k$(pointIndex);
2159
2161
  var dtS = elapsedS - this.lastElapsedS_1;
2160
2162
  if (dtS > 0.0 && isFinite(dtS)) {
2161
2163
  var tmp = this;
@@ -2207,7 +2209,7 @@
2207
2209
  }
2208
2210
  if (pointIndex === this.lastIndex_1)
2209
2211
  return this.lastPowerW_1;
2210
- var elapsedS = path.elapsed_7307rw_k$(pointIndex) / 1000.0;
2212
+ var elapsedS = path.elapsed_7307rw_k$(pointIndex);
2211
2213
  var dtS = elapsedS - this.lastElapsedS_1;
2212
2214
  var tmp;
2213
2215
  if (dtS > 0.0 && isFinite(dtS)) {
@@ -2245,7 +2247,7 @@
2245
2247
  this.DEFAULT_ENERGY_BUDGET_SECONDS_1 = 600.0;
2246
2248
  }
2247
2249
  var Companion_instance_10;
2248
- function Companion_getInstance_12() {
2250
+ function Companion_getInstance_13() {
2249
2251
  return Companion_instance_10;
2250
2252
  }
2251
2253
  function PowerProviderTerrainPacing(delegate, gradientGain, headwindGainPerMS, minMultiplier, maxMultiplier, rampDistanceM, energyBudgetSeconds) {
@@ -2311,7 +2313,7 @@
2311
2313
  this.multiplier_1 = this.smooth_uy9sy9_k$(this.multiplier_1, this.rawMultiplier_2rfnpc_k$(path, pointIndex), dx);
2312
2314
  if (isFinite(distanceM))
2313
2315
  this.lastDistanceM_1 = distanceM;
2314
- var elapsedS = path.elapsed_7307rw_k$(pointIndex) / 1000.0;
2316
+ var elapsedS = path.elapsed_7307rw_k$(pointIndex);
2315
2317
  var dtS = elapsedS - this.lastElapsedS_1;
2316
2318
  if (dtS > 0.0 && isFinite(dtS)) {
2317
2319
  this.energyDebtJ_1 = this.energyDebtJ_1 + (this.lastDeliveredW_1 - this.lastTargetW_1) * dtS;
@@ -2453,7 +2455,7 @@
2453
2455
  if (dx <= 0.0) {
2454
2456
  copyAllFields(this, input, i, out, i);
2455
2457
  out.setTime_rfmvcd_k$(i, timeMs);
2456
- out.setElapsed_916ug_k$(i, timeMs - startTimeMs);
2458
+ out.setElapsed_916ug_k$(i, (timeMs - startTimeMs) / 1000.0);
2457
2459
  out.setDx_uk0ky4_k$(i, 0.0);
2458
2460
  out.setDt_sgarxs_k$(i, 0.0);
2459
2461
  out.setSpeed_1slan1_k$(i, speed);
@@ -2473,9 +2475,9 @@
2473
2475
  speed = speedNew;
2474
2476
  timeMs = timeMs + dt * 1000.0;
2475
2477
  out.setTime_rfmvcd_k$(i, timeMs);
2476
- out.setElapsed_916ug_k$(i, timeMs - startTimeMs);
2478
+ out.setElapsed_916ug_k$(i, (timeMs - startTimeMs) / 1000.0);
2477
2479
  out.setDx_uk0ky4_k$(i, dx);
2478
- out.setDt_sgarxs_k$(i, dt * 1000.0);
2480
+ out.setDt_sgarxs_k$(i, dt);
2479
2481
  out.setSpeed_1slan1_k$(i, speed);
2480
2482
  out.setVirtSpeedCurrent_kvg8yv_k$(i, speed);
2481
2483
  i = i + 1 | 0;
@@ -2518,13 +2520,13 @@
2518
2520
  this.NONE_1 = new Wind(0.0, 0.0);
2519
2521
  }
2520
2522
  var Companion_instance_11;
2521
- function Companion_getInstance_13() {
2523
+ function Companion_getInstance_14() {
2522
2524
  if (Companion_instance_11 == null)
2523
2525
  new Companion_10();
2524
2526
  return Companion_instance_11;
2525
2527
  }
2526
2528
  function Wind(speedMS, directionRad) {
2527
- Companion_getInstance_13();
2529
+ Companion_getInstance_14();
2528
2530
  this.speedMS_1 = speedMS;
2529
2531
  this.directionRad_1 = directionRad;
2530
2532
  }
@@ -2550,7 +2552,7 @@
2550
2552
  function WindProviderNone() {
2551
2553
  }
2552
2554
  protoOf(WindProviderNone).wind_umf2tf_k$ = function (course, path, pointIndex) {
2553
- return Companion_getInstance_13().NONE_1;
2555
+ return Companion_getInstance_14().NONE_1;
2554
2556
  };
2555
2557
  var WindProviderNone_instance;
2556
2558
  function WindProviderNone_getInstance() {
@@ -3606,7 +3608,7 @@
3606
3608
  return new OffsetEnergy(h0, h1, h2, linear, constant);
3607
3609
  };
3608
3610
  var Companion_instance_12;
3609
- function Companion_getInstance_14() {
3611
+ function Companion_getInstance_15() {
3610
3612
  return Companion_instance_12;
3611
3613
  }
3612
3614
  function OffsetEnergy(h0, h1, h2, linear, constant) {
@@ -3868,13 +3870,13 @@
3868
3870
  this.DEFAULT_1 = new CurvatureOptions();
3869
3871
  }
3870
3872
  var Companion_instance_13;
3871
- function Companion_getInstance_15() {
3873
+ function Companion_getInstance_16() {
3872
3874
  if (Companion_instance_13 == null)
3873
3875
  new Companion_12();
3874
3876
  return Companion_instance_13;
3875
3877
  }
3876
3878
  function CurvatureOptions(enabled, geometrySmoothWindowM, curvatureWindowsM, headingNoiseRad, curvatureSmoothWindowM) {
3877
- Companion_getInstance_15();
3879
+ Companion_getInstance_16();
3878
3880
  enabled = enabled === VOID ? true : enabled;
3879
3881
  geometrySmoothWindowM = geometrySmoothWindowM === VOID ? 3.0 : geometrySmoothWindowM;
3880
3882
  curvatureWindowsM = curvatureWindowsM === VOID ? listOf_0([3.0, 6.0, 12.0, 25.0]) : curvatureWindowsM;
@@ -4277,7 +4279,7 @@
4277
4279
  return tmp;
4278
4280
  };
4279
4281
  var Companion_instance_14;
4280
- function Companion_getInstance_16() {
4282
+ function Companion_getInstance_17() {
4281
4283
  return Companion_instance_14;
4282
4284
  }
4283
4285
  function values_1() {
@@ -4332,13 +4334,13 @@
4332
4334
  this.DEFAULT_1 = new RacingLineOptions();
4333
4335
  }
4334
4336
  var Companion_instance_15;
4335
- function Companion_getInstance_17() {
4337
+ function Companion_getInstance_18() {
4336
4338
  if (Companion_instance_15 == null)
4337
4339
  new Companion_14();
4338
4340
  return Companion_instance_15;
4339
4341
  }
4340
4342
  function RacingLineOptions(enabled, defaultRoadWidthM, edgeMarginM, corridor, cornerEnterRadiusM, cornerExitRadiusM, minCornerLengthM, minCornerTurnDeg, hairpinTurnDeg, gentleRadiusM, regularityFactor, selfProximityGapM, straightRunM, straightRadiusM, widthSmoothWindowM, objectiveRadiusM, steeringLengthM, centeringLengthM, maxNewtonIterations, gradientTolerance, boundEpsilonM, curvature, simplifyToleranceCapM) {
4341
- Companion_getInstance_17();
4343
+ Companion_getInstance_18();
4342
4344
  enabled = enabled === VOID ? false : enabled;
4343
4345
  defaultRoadWidthM = defaultRoadWidthM === VOID ? 6.0 : defaultRoadWidthM;
4344
4346
  edgeMarginM = edgeMarginM === VOID ? 0.5 : edgeMarginM;
@@ -4360,7 +4362,7 @@
4360
4362
  maxNewtonIterations = maxNewtonIterations === VOID ? 200 : maxNewtonIterations;
4361
4363
  gradientTolerance = gradientTolerance === VOID ? 1.0E-8 : gradientTolerance;
4362
4364
  boundEpsilonM = boundEpsilonM === VOID ? 1.0E-6 : boundEpsilonM;
4363
- curvature = curvature === VOID ? Companion_getInstance_15().DEFAULT_1 : curvature;
4365
+ curvature = curvature === VOID ? Companion_getInstance_16().DEFAULT_1 : curvature;
4364
4366
  simplifyToleranceCapM = simplifyToleranceCapM === VOID ? 2.0 : simplifyToleranceCapM;
4365
4367
  this.enabled_1 = enabled;
4366
4368
  this.defaultRoadWidthM_1 = defaultRoadWidthM;
@@ -4625,7 +4627,7 @@
4625
4627
  var this_0 = tracksAsPaths(GpxParser_instance.parse$default_ez0f31_k$(xml), setOf(GpxPathKind_ROUTE_getInstance()));
4626
4628
  return copyToArray(this_0);
4627
4629
  }
4628
- function writeGpxTracks(paths, waypoints, writeExtensions) {
4630
+ function writeGpxTracks(paths, waypoints, writeExtensions, powerSource) {
4629
4631
  var tmp;
4630
4632
  if (waypoints === VOID) {
4631
4633
  // Inline function 'kotlin.emptyArray' call
@@ -4635,6 +4637,7 @@
4635
4637
  }
4636
4638
  waypoints = tmp;
4637
4639
  writeExtensions = writeExtensions === VOID ? true : writeExtensions;
4640
+ powerSource = powerSource === VOID ? null : powerSource;
4638
4641
  _init_properties_EngineJsApi_kt__9bputf();
4639
4642
  var tmp_0 = GpxWriter_instance;
4640
4643
  var tmp_1 = toList(paths);
@@ -4649,7 +4652,7 @@
4649
4652
  var tmp$ret$3 = toGpxWaypoint(item);
4650
4653
  destination.add_utx5q5_k$(tmp$ret$3);
4651
4654
  }
4652
- return tmp_0.write$default_koqy5u_k$(tmp_1, VOID, VOID, destination, VOID, writeExtensions);
4655
+ return tmp_0.write_7y52k2_k$(pathsToGpxDocument(tmp_1, VOID, VOID, destination, VOID, VOID, toGpxPowerSource(powerSource)), writeExtensions);
4653
4656
  }
4654
4657
  function pathSize(path) {
4655
4658
  _init_properties_EngineJsApi_kt__9bputf();
@@ -4675,15 +4678,21 @@
4675
4678
  _init_properties_EngineJsApi_kt__9bputf();
4676
4679
  return pointObj(path.latitudeDeg_i25sm6_k$(i), path.longitudeDeg_ikk1un_k$(i), path.elevation_iziwkb_k$(i), path.time_ryc845_k$(i), path.speed_npav2n_k$(i), path.pComputedPower_g6dnn4_k$(i), path.distance_5s4s77_k$(i), path.grade_c4yjz5_k$(i));
4677
4680
  }
4678
- function writeGpx(path, writeExtensions) {
4681
+ function writeGpx(path, writeExtensions, powerSource, trackName) {
4679
4682
  writeExtensions = writeExtensions === VOID ? true : writeExtensions;
4683
+ powerSource = powerSource === VOID ? null : powerSource;
4684
+ trackName = trackName === VOID ? null : trackName;
4680
4685
  _init_properties_EngineJsApi_kt__9bputf();
4681
- return GpxWriter_instance.write_7y52k2_k$(toGpxDocument(path, VOID, 'virtualized'), writeExtensions);
4686
+ var tmp = GpxWriter_instance;
4687
+ return tmp.write_7y52k2_k$(toGpxDocument(path, VOID, trackName == null ? 'virtualized' : trackName, VOID, toGpxPowerSource(powerSource)), writeExtensions);
4682
4688
  }
4683
- function writeGpxAt(path, startTimeEpochMs, writeExtensions) {
4689
+ function writeGpxAt(path, startTimeEpochMs, writeExtensions, powerSource, trackName) {
4684
4690
  writeExtensions = writeExtensions === VOID ? true : writeExtensions;
4691
+ powerSource = powerSource === VOID ? null : powerSource;
4692
+ trackName = trackName === VOID ? null : trackName;
4685
4693
  _init_properties_EngineJsApi_kt__9bputf();
4686
- return GpxWriter_instance.write_7y52k2_k$(toGpxDocument(path, VOID, 'virtualized', Companion_getInstance().fromEpochMilliseconds_uaz65_k$(numberToLong(startTimeEpochMs))), writeExtensions);
4694
+ var tmp = GpxWriter_instance;
4695
+ return tmp.write_7y52k2_k$(toGpxDocument(path, VOID, trackName == null ? 'virtualized' : trackName, Companion_getInstance().fromEpochMilliseconds_uaz65_k$(numberToLong(startTimeEpochMs)), toGpxPowerSource(powerSource)), writeExtensions);
4687
4696
  }
4688
4697
  function enhance(path, options) {
4689
4698
  _init_properties_EngineJsApi_kt__9bputf();
@@ -4879,6 +4888,19 @@
4879
4888
  // Inline function 'kotlin.js.unsafeCast' call
4880
4889
  return o;
4881
4890
  }
4891
+ function toGpxPowerSource(_this__u8e3s4) {
4892
+ _init_properties_EngineJsApi_kt__9bputf();
4893
+ if (_this__u8e3s4 == null)
4894
+ return Companion_getInstance_2().DEFAULT_1;
4895
+ var tmp0_elvis_lhs = Companion_getInstance_2().fromWire_2092k5_k$(_this__u8e3s4);
4896
+ var tmp;
4897
+ if (tmp0_elvis_lhs == null) {
4898
+ throw IllegalArgumentException_init_$Create$('powerSource must be one of ' + joinToString(Companion_getInstance_2().get_wireNames_7fokbq_k$(), ', ') + ', got: ' + _this__u8e3s4);
4899
+ } else {
4900
+ tmp = tmp0_elvis_lhs;
4901
+ }
4902
+ return tmp;
4903
+ }
4882
4904
  function toGpxWaypoint(_this__u8e3s4) {
4883
4905
  _init_properties_EngineJsApi_kt__9bputf();
4884
4906
  var tmp = _this__u8e3s4.latitudeDeg;
@@ -4922,12 +4944,12 @@
4922
4944
  var tmp13_enabled = tmp11_elvis_lhs == null ? false : tmp11_elvis_lhs;
4923
4945
  var tmp14_corridor = parseCorridor(_this__u8e3s4.racingLineCorridor);
4924
4946
  var tmp12_elvis_lhs = _this__u8e3s4.racingLineRoadWidthM;
4925
- var tmp15_defaultRoadWidthM = tmp12_elvis_lhs == null ? Companion_getInstance_17().DEFAULT_1.defaultRoadWidthM_1 : tmp12_elvis_lhs;
4947
+ var tmp15_defaultRoadWidthM = tmp12_elvis_lhs == null ? Companion_getInstance_18().DEFAULT_1.defaultRoadWidthM_1 : tmp12_elvis_lhs;
4926
4948
  return new EnhanceOptions(tmp, tmp_0, tmp_1, tmp_2, tmp_5, tmp_8, tmp_9, new RacingLineOptions(tmp13_enabled, tmp15_defaultRoadWidthM, VOID, tmp14_corridor));
4927
4949
  }
4928
4950
  function parseCorridor(name) {
4929
4951
  _init_properties_EngineJsApi_kt__9bputf();
4930
- return name == null ? Companion_getInstance_17().DEFAULT_1.corridor_1 : Companion_instance_14.byId_8gmd94_k$(name);
4952
+ return name == null ? Companion_getInstance_18().DEFAULT_1.corridor_1 : Companion_instance_14.byId_8gmd94_k$(name);
4931
4953
  }
4932
4954
  function defaultJsOptions() {
4933
4955
  _init_properties_EngineJsApi_kt__9bputf();