incyclist-services 1.9.27 → 1.9.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/lib/cjs/routes/library/service.js +1 -1
  2. package/lib/cjs/workouts/index.js +1 -0
  3. package/lib/cjs/workouts/list/service.js +0 -16
  4. package/lib/cjs/workouts/page/base/service.js +460 -0
  5. package/lib/cjs/workouts/page/base/types.js +2 -0
  6. package/lib/cjs/workouts/page/desktop/service.js +470 -0
  7. package/lib/cjs/workouts/page/desktop/types.js +2 -0
  8. package/lib/cjs/workouts/page/index.js +17 -15
  9. package/lib/cjs/workouts/page/mobile/service.js +135 -0
  10. package/lib/cjs/workouts/page/mobile/types.js +2 -0
  11. package/lib/cjs/workouts/prompt/index.js +18 -0
  12. package/lib/cjs/workouts/prompt/service.js +132 -0
  13. package/lib/cjs/workouts/prompt/types.js +2 -0
  14. package/lib/esm/routes/library/service.js +1 -1
  15. package/lib/esm/workouts/index.js +1 -0
  16. package/lib/esm/workouts/list/service.js +0 -16
  17. package/lib/esm/workouts/page/base/service.js +457 -0
  18. package/lib/esm/workouts/page/base/types.js +1 -0
  19. package/lib/esm/workouts/page/desktop/service.js +467 -0
  20. package/lib/esm/workouts/page/desktop/types.js +1 -0
  21. package/lib/esm/workouts/page/index.js +12 -1
  22. package/lib/esm/workouts/page/mobile/service.js +132 -0
  23. package/lib/esm/workouts/page/mobile/types.js +1 -0
  24. package/lib/esm/workouts/prompt/index.js +2 -0
  25. package/lib/esm/workouts/prompt/service.js +128 -0
  26. package/lib/esm/workouts/prompt/types.js +1 -0
  27. package/lib/types/workouts/index.d.ts +1 -0
  28. package/lib/types/workouts/list/service.d.ts +0 -1
  29. package/lib/types/workouts/page/base/service.d.ts +56 -0
  30. package/lib/types/workouts/page/base/types.d.ts +59 -0
  31. package/lib/types/workouts/page/desktop/service.d.ts +66 -0
  32. package/lib/types/workouts/page/desktop/types.d.ts +47 -0
  33. package/lib/types/workouts/page/index.d.ts +6 -1
  34. package/lib/types/workouts/page/mobile/service.d.ts +11 -0
  35. package/lib/types/workouts/page/mobile/types.d.ts +48 -0
  36. package/lib/types/workouts/page/types.d.ts +3 -99
  37. package/lib/types/workouts/prompt/index.d.ts +2 -0
  38. package/lib/types/workouts/prompt/service.d.ts +17 -0
  39. package/lib/types/workouts/prompt/types.d.ts +9 -0
  40. package/lib/types/workouts/types.d.ts +1 -0
  41. package/package.json +5 -5
@@ -495,7 +495,7 @@ let RouteLibraryScannerService = (() => {
495
495
  }
496
496
  countFailedFolder(ctx, err, folderName) {
497
497
  ctx.progress.failedFolders++;
498
- this.logError(err, 'scanFolder', { folderName });
498
+ this.logEvent({ message: 'scanFolder failed', folderName, reason: err.message });
499
499
  this.emitScanProgress(ctx);
500
500
  }
501
501
  emitScanProgress(ctx) {
@@ -20,6 +20,7 @@ __exportStar(require("./ride"), exports);
20
20
  __exportStar(require("./base/model"), exports);
21
21
  __exportStar(require("./base/graph"), exports);
22
22
  __exportStar(require("./page"), exports);
23
+ __exportStar(require("./prompt"), exports);
23
24
  var calendar_1 = require("./calendar");
24
25
  Object.defineProperty(exports, "WorkoutCalendarService", { enumerable: true, get: function () { return calendar_1.WorkoutCalendarService; } });
25
26
  Object.defineProperty(exports, "useWorkoutCalendar", { enumerable: true, get: function () { return calendar_1.useWorkoutCalendar; } });
@@ -249,9 +249,6 @@ let WorkoutListService = (() => {
249
249
  this.getWorkoutCalendar().once('scheduled', (event) => {
250
250
  this.scheduledToday = event;
251
251
  this.getAppState().setState('scheduledToday', event.workout.id);
252
- if (!this.isMobile()) {
253
- this.getAppState().setPersistedState('page', 'workouts');
254
- }
255
252
  });
256
253
  this.getWorkoutCalendar().init().catch(err => { this.logError(err, 'preload'); });
257
254
  this.preloadObserver.start()
@@ -353,16 +350,6 @@ let WorkoutListService = (() => {
353
350
  getScheduledWorkouts(scheduled) {
354
351
  const schedList = new cardlist_1.CardList('scheduled', 'Scheduled Workouts');
355
352
  scheduled.forEach(w => schedList.add(new ScheduledWorkoutCard_1.ScheduledWorkoutCard(w)));
356
- if (!this.isMobile()) {
357
- const today = this.getAppState().getState('scheduledToday');
358
- if (today) {
359
- schedList.getCards().forEach(c => {
360
- if (c.getId() === today) {
361
- c.select();
362
- }
363
- });
364
- }
365
- }
366
353
  const newList = (this.scheduledList === undefined || this.scheduledList === null);
367
354
  if (newList) {
368
355
  this.scheduledList = schedList;
@@ -698,9 +685,6 @@ let WorkoutListService = (() => {
698
685
  getAppState() {
699
686
  return (0, appstate_1.useAppState)();
700
687
  }
701
- isMobile() {
702
- return this.getBindings()?.appInfo?.getChannel() === 'mobile';
703
- }
704
688
  getBindings() {
705
689
  return (0, api_1.getBindings)();
706
690
  }
@@ -0,0 +1,460 @@
1
+ "use strict";
2
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
3
+ var useValue = arguments.length > 2;
4
+ for (var i = 0; i < initializers.length; i++) {
5
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
6
+ }
7
+ return useValue ? value : void 0;
8
+ };
9
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
10
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
11
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
12
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
13
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
14
+ var _, done = false;
15
+ for (var i = decorators.length - 1; i >= 0; i--) {
16
+ var context = {};
17
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
18
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
19
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
20
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
21
+ if (kind === "accessor") {
22
+ if (result === void 0) continue;
23
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
24
+ if (_ = accept(result.get)) descriptor.get = _;
25
+ if (_ = accept(result.set)) descriptor.set = _;
26
+ if (_ = accept(result.init)) initializers.unshift(_);
27
+ }
28
+ else if (_ = accept(result)) {
29
+ if (kind === "field") initializers.unshift(_);
30
+ else descriptor[key] = _;
31
+ }
32
+ }
33
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
34
+ done = true;
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.WorkoutListPageService = exports.IMPORT_FILE_EXTENSIONS = void 0;
38
+ const pages_1 = require("../../../base/pages");
39
+ const decorators_1 = require("../../../base/decorators");
40
+ const observer_1 = require("../../../base/types/observer");
41
+ const settings_1 = require("../../../settings");
42
+ const calendar_1 = require("../../calendar");
43
+ const service_1 = require("../../list/service");
44
+ const devices_1 = require("../../../devices");
45
+ const routes_1 = require("../../../routes");
46
+ const DEFAULT_IMPORT_GROUP = 'My Workouts';
47
+ exports.IMPORT_FILE_EXTENSIONS = ['zwo', 'json'];
48
+ let WorkoutListPageService = (() => {
49
+ let _classSuper = pages_1.IncyclistPageService;
50
+ let _instanceExtraInitializers = [];
51
+ let _getDevicePairing_decorators;
52
+ let _getWorkoutList_decorators;
53
+ let _getRouteList_decorators;
54
+ let _getWorkoutCalendar_decorators;
55
+ let _getUserSettings_decorators;
56
+ return class WorkoutListPageService extends _classSuper {
57
+ static {
58
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
59
+ _getDevicePairing_decorators = [decorators_1.Injectable];
60
+ _getWorkoutList_decorators = [decorators_1.Injectable];
61
+ _getRouteList_decorators = [decorators_1.Injectable];
62
+ _getWorkoutCalendar_decorators = [decorators_1.Injectable];
63
+ _getUserSettings_decorators = [decorators_1.Injectable];
64
+ __esDecorate(this, null, _getDevicePairing_decorators, { kind: "method", name: "getDevicePairing", static: false, private: false, access: { has: obj => "getDevicePairing" in obj, get: obj => obj.getDevicePairing }, metadata: _metadata }, null, _instanceExtraInitializers);
65
+ __esDecorate(this, null, _getWorkoutList_decorators, { kind: "method", name: "getWorkoutList", static: false, private: false, access: { has: obj => "getWorkoutList" in obj, get: obj => obj.getWorkoutList }, metadata: _metadata }, null, _instanceExtraInitializers);
66
+ __esDecorate(this, null, _getRouteList_decorators, { kind: "method", name: "getRouteList", static: false, private: false, access: { has: obj => "getRouteList" in obj, get: obj => obj.getRouteList }, metadata: _metadata }, null, _instanceExtraInitializers);
67
+ __esDecorate(this, null, _getWorkoutCalendar_decorators, { kind: "method", name: "getWorkoutCalendar", static: false, private: false, access: { has: obj => "getWorkoutCalendar" in obj, get: obj => obj.getWorkoutCalendar }, metadata: _metadata }, null, _instanceExtraInitializers);
68
+ __esDecorate(this, null, _getUserSettings_decorators, { kind: "method", name: "getUserSettings", static: false, private: false, access: { has: obj => "getUserSettings" in obj, get: obj => obj.getUserSettings }, metadata: _metadata }, null, _instanceExtraInitializers);
69
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
70
+ }
71
+ detailWorkoutId = (__runInitializers(this, _instanceExtraInitializers), null);
72
+ importPhase;
73
+ importingFileName;
74
+ importResult;
75
+ importError;
76
+ importGeneration = 0;
77
+ listObserver;
78
+ listUpdateHandler = this.emitPageUpdate.bind(this);
79
+ calendarUpdateHandler = this.emitPageUpdate.bind(this);
80
+ constructor() {
81
+ super('WorkoutListPage');
82
+ }
83
+ getRideNavigationState() {
84
+ return undefined;
85
+ }
86
+ openPage() {
87
+ try {
88
+ super.openPage();
89
+ this.logEvent({ message: 'page shown', page: 'Workouts' });
90
+ const { observer } = this.getWorkoutList().open();
91
+ this.listObserver = observer;
92
+ this.listObserver?.on('started', this.listUpdateHandler);
93
+ this.listObserver?.on('loading', this.listUpdateHandler);
94
+ this.listObserver?.on('loaded', this.listUpdateHandler);
95
+ this.listObserver?.on('updated', this.listUpdateHandler);
96
+ this.getWorkoutCalendar().on('updated', this.calendarUpdateHandler);
97
+ this.emitPageUpdate();
98
+ }
99
+ catch (err) {
100
+ this.logError(err, 'openPage');
101
+ }
102
+ return this.getPageObserver();
103
+ }
104
+ closePage() {
105
+ try {
106
+ this.getWorkoutList().close();
107
+ this.listObserver?.off('started', this.listUpdateHandler);
108
+ this.listObserver?.off('loading', this.listUpdateHandler);
109
+ this.listObserver?.off('loaded', this.listUpdateHandler);
110
+ this.listObserver?.off('updated', this.listUpdateHandler);
111
+ this.getWorkoutCalendar().off('updated', this.calendarUpdateHandler);
112
+ delete this.listObserver;
113
+ this.logEvent({ message: 'page closed', page: 'Workouts' });
114
+ super.closePage();
115
+ }
116
+ catch (err) {
117
+ this.logError(err, 'closePage');
118
+ }
119
+ }
120
+ getWorkoutDetailsProps(id) {
121
+ try {
122
+ const card = this.findWorkoutCard(id, { includeScheduled: true });
123
+ if (!card)
124
+ return null;
125
+ const workout = card.getData();
126
+ const settingsProps = card.openSettings();
127
+ const isScheduled = card.getCardType() === 'ScheduledWorkout';
128
+ return {
129
+ id,
130
+ title: card.getTitle(),
131
+ description: workout?.description,
132
+ duration: settingsProps.duration,
133
+ workout,
134
+ ftp: settingsProps.settings?.ftp,
135
+ ftpRequired: settingsProps.ftpRequired,
136
+ useErgMode: settingsProps.settings?.useErgMode,
137
+ canStart: settingsProps.canStart,
138
+ canStartWorkoutOnly: settingsProps.canStartWorkoutOnly,
139
+ groups: settingsProps.categories,
140
+ group: settingsProps.category,
141
+ canDelete: card.canDelete(),
142
+ isScheduled,
143
+ date: isScheduled ? settingsProps.date : undefined,
144
+ attachedRoute: this.getAttachedRouteProps()
145
+ };
146
+ }
147
+ catch (err) {
148
+ this.logError(err, 'getWorkoutDetailsProps');
149
+ return null;
150
+ }
151
+ }
152
+ getAttachedRouteProps() {
153
+ try {
154
+ const route = this.getRouteList().getSelected();
155
+ if (!route)
156
+ return null;
157
+ return { id: route.description?.id, title: route.title };
158
+ }
159
+ catch (err) {
160
+ this.logError(err, 'getAttachedRouteProps');
161
+ return null;
162
+ }
163
+ }
164
+ onOpenDetails(id) {
165
+ try {
166
+ this.detailWorkoutId = id;
167
+ this.logEvent({ message: 'details opened', id });
168
+ this.emitPageUpdate();
169
+ }
170
+ catch (err) {
171
+ this.logError(err, 'onOpenDetails');
172
+ }
173
+ }
174
+ onCloseDetails() {
175
+ try {
176
+ this.detailWorkoutId = null;
177
+ this.logEvent({ message: 'details closed' });
178
+ this.emitPageUpdate();
179
+ }
180
+ catch (err) {
181
+ this.logError(err, 'onCloseDetails');
182
+ }
183
+ }
184
+ onSetFtp(ftp) {
185
+ try {
186
+ const current = this.getWorkoutList().getStartSettings();
187
+ this.getWorkoutList().setStartSettings({ ...current, ftp });
188
+ this.emitPageUpdate();
189
+ }
190
+ catch (err) {
191
+ this.logError(err, 'onSetFtp');
192
+ }
193
+ }
194
+ onSetErgMode(enabled) {
195
+ try {
196
+ const current = this.getWorkoutList().getStartSettings();
197
+ this.getWorkoutList().setStartSettings({ ...current, useErgMode: enabled });
198
+ this.emitPageUpdate();
199
+ }
200
+ catch (err) {
201
+ this.logError(err, 'onSetErgMode');
202
+ }
203
+ }
204
+ onChangeGroup(id, group) {
205
+ try {
206
+ const card = this.findWorkoutCard(id);
207
+ card?.move(group);
208
+ this.emitPageUpdate();
209
+ }
210
+ catch (err) {
211
+ this.logError(err, 'onChangeGroup');
212
+ }
213
+ }
214
+ async onDelete(id) {
215
+ try {
216
+ const observer = this.getWorkoutList().deleteWorkout(id);
217
+ const deleted = await observer.wait();
218
+ this.emitPageUpdate();
219
+ return !!deleted;
220
+ }
221
+ catch (err) {
222
+ this.logError(err, 'onDelete');
223
+ return false;
224
+ }
225
+ }
226
+ getImportDisplayProps() {
227
+ try {
228
+ const phase = this.importPhase ?? 'landing';
229
+ const knownGroups = this.getKnownGroups();
230
+ const props = { phase, knownGroups };
231
+ if (phase === 'importing')
232
+ props.importing = { fileName: this.importingFileName };
233
+ if (phase === 'result')
234
+ props.result = this.importResult;
235
+ if (phase === 'error')
236
+ props.error = this.importError;
237
+ return props;
238
+ }
239
+ catch (err) {
240
+ this.logError(err, 'getImportDisplayProps');
241
+ return { phase: 'landing', knownGroups: [] };
242
+ }
243
+ }
244
+ onImportOpen() {
245
+ try {
246
+ this.importPhase = 'landing';
247
+ delete this.importError;
248
+ delete this.importResult;
249
+ this.emitImportUpdate();
250
+ }
251
+ catch (err) {
252
+ this.logError(err, 'onImportOpen');
253
+ }
254
+ }
255
+ onImportFile(file) {
256
+ const observer = new observer_1.Observer();
257
+ const generation = this.importGeneration = Date.now();
258
+ try {
259
+ this.importPhase = 'importing';
260
+ this.importingFileName = file?.name;
261
+ this.emitImportUpdate();
262
+ this.logEvent({ message: 'workout import attempted', file: file?.name });
263
+ this.getWorkoutList().import(file, { showImportCards: false })
264
+ .then(([card]) => {
265
+ const group = this.getLastUsedImportGroup();
266
+ observer.emit('success');
267
+ this.logEvent({ message: 'workout import succeeded', file: file?.name, workoutName: card.getTitle(), group });
268
+ if (generation !== this.importGeneration)
269
+ return;
270
+ if (group !== DEFAULT_IMPORT_GROUP)
271
+ card.move(group);
272
+ this.importPhase = 'result';
273
+ this.importResult = {
274
+ id: card.getId(),
275
+ workoutName: card.getTitle(),
276
+ group,
277
+ workout: card.getData?.(),
278
+ ftp: card.openSettings?.()?.settings?.ftp
279
+ };
280
+ this.emitImportUpdate();
281
+ })
282
+ .catch((err) => {
283
+ observer.emit('error', err);
284
+ this.logEvent({ message: 'workout import failed', file: file?.name, error: err?.message });
285
+ if (generation !== this.importGeneration)
286
+ return;
287
+ this.importPhase = 'error';
288
+ this.importError = err?.message;
289
+ this.emitImportUpdate();
290
+ });
291
+ }
292
+ catch (err) {
293
+ this.logError(err, 'onImportFile');
294
+ }
295
+ return observer;
296
+ }
297
+ onImportSetGroup(id, group) {
298
+ try {
299
+ const card = this.findWorkoutCard(id);
300
+ card?.move(group);
301
+ this.persistLastUsedImportGroup(group);
302
+ if (this.importResult)
303
+ this.importResult = { ...this.importResult, group };
304
+ this.emitImportUpdate();
305
+ }
306
+ catch (err) {
307
+ this.logError(err, 'onImportSetGroup');
308
+ }
309
+ }
310
+ onImportClose() {
311
+ try {
312
+ this.importGeneration = Date.now();
313
+ delete this.importPhase;
314
+ delete this.importingFileName;
315
+ delete this.importResult;
316
+ delete this.importError;
317
+ this.emitImportUpdate();
318
+ }
319
+ catch (err) {
320
+ this.logError(err, 'onImportClose');
321
+ }
322
+ }
323
+ onStart(id, opts) {
324
+ try {
325
+ const card = this.findWorkoutCard(id, { includeScheduled: true });
326
+ if (!card)
327
+ return;
328
+ const service = this.getWorkoutList();
329
+ const pairing = this.getDevicePairing();
330
+ const settings = service.getStartSettings() ?? {};
331
+ card.select({ ...settings, noRoute: opts?.noRoute });
332
+ this.logEvent({ message: 'Attempting to start a ride', id, ...settings, noRoute: opts?.noRoute, readyToStart: pairing.isReadyToStart(), });
333
+ this.detailWorkoutId = null;
334
+ service.close();
335
+ const next = this.getRideTarget(pairing.isReadyToStart());
336
+ const state = this.getRideNavigationState();
337
+ if (state === undefined)
338
+ this.moveTo(next);
339
+ else
340
+ this.moveTo(next, true, state);
341
+ }
342
+ catch (err) {
343
+ this.logError(err, 'onStart');
344
+ }
345
+ }
346
+ onMarkForRoute(id) {
347
+ try {
348
+ const card = this.findWorkoutCard(id, { includeScheduled: true });
349
+ if (!card)
350
+ return;
351
+ const settings = this.getWorkoutList().getStartSettings();
352
+ card.select({ ...settings, noRoute: false });
353
+ this.detailWorkoutId = null;
354
+ this.emitPageUpdate();
355
+ }
356
+ catch (err) {
357
+ this.logError(err, 'onMarkForRoute');
358
+ }
359
+ }
360
+ onClearSelection() {
361
+ try {
362
+ this.getWorkoutList().unselect();
363
+ this.emitPageUpdate();
364
+ }
365
+ catch (err) {
366
+ this.logError(err, 'onClearSelection');
367
+ }
368
+ }
369
+ onClearRouteSelection() {
370
+ try {
371
+ this.getRouteList().unselect();
372
+ this.emitPageUpdate();
373
+ }
374
+ catch (err) {
375
+ this.logError(err, 'onClearRouteSelection');
376
+ }
377
+ }
378
+ findWorkoutCard(id, opts) {
379
+ const includeScheduled = opts?.includeScheduled ?? false;
380
+ const lists = this.getWorkoutList().getLists(false) ?? [];
381
+ const regularLists = lists.filter(l => l.getId() !== 'scheduled');
382
+ const scheduledLists = includeScheduled ? lists.filter(l => l.getId() === 'scheduled') : [];
383
+ const orderedLists = [...regularLists, ...scheduledLists];
384
+ for (const list of orderedLists) {
385
+ const card = list.getCards().find(c => c.getId() === id);
386
+ if (card)
387
+ return card;
388
+ }
389
+ return undefined;
390
+ }
391
+ getKnownGroups() {
392
+ const lists = this.getWorkoutList().getLists(false) ?? [];
393
+ return lists.filter(l => l.getId() !== 'scheduled').map(l => l.getTitle());
394
+ }
395
+ getLastUsedImportGroup() {
396
+ return this.getUserSettings().get('preferences.workouts.lastImportGroup', DEFAULT_IMPORT_GROUP);
397
+ }
398
+ persistLastUsedImportGroup(group) {
399
+ try {
400
+ this.getUserSettings().set('preferences.workouts.lastImportGroup', group);
401
+ }
402
+ catch (err) {
403
+ this.logError(err, 'persistLastUsedImportGroup');
404
+ }
405
+ }
406
+ emitImportUpdate() {
407
+ try {
408
+ this.getPageObserver()?.emit('import-update');
409
+ }
410
+ catch (err) {
411
+ this.logError(err, 'emitImportUpdate');
412
+ }
413
+ }
414
+ getScheduledTodayWorkoutId() {
415
+ try {
416
+ const today = this.getWorkoutCalendar().getScheduledToday();
417
+ return today?.workout?.id ?? today?.workoutId ?? null;
418
+ }
419
+ catch (err) {
420
+ this.logError(err, 'getScheduledTodayWorkoutId');
421
+ return null;
422
+ }
423
+ }
424
+ formatDuration(duration) {
425
+ if (duration === undefined || duration === null)
426
+ return '';
427
+ if (duration < 120)
428
+ return `${duration.toFixed(0)}s`;
429
+ if (duration % 60 === 0)
430
+ return `${duration / 60}min`;
431
+ const secVal = duration % 60;
432
+ const minVal = (duration - secVal) / 60 % 60;
433
+ const h = Math.floor((duration - secVal - minVal * 60) / 3600);
434
+ const sec = secVal < 10 ? `0${secVal}` : secVal;
435
+ const min = minVal < 10 ? `0${minVal}` : minVal;
436
+ if (h > 0)
437
+ return `${h}:${min}:${sec}`;
438
+ return `${min}:${sec}`;
439
+ }
440
+ emitPageUpdate() {
441
+ this.getPageObserver()?.emit('page-update');
442
+ }
443
+ getDevicePairing() {
444
+ return (0, devices_1.useDevicePairing)();
445
+ }
446
+ getWorkoutList() {
447
+ return (0, service_1.useWorkoutList)();
448
+ }
449
+ getRouteList() {
450
+ return (0, routes_1.useRouteList)();
451
+ }
452
+ getWorkoutCalendar() {
453
+ return (0, calendar_1.useWorkoutCalendar)();
454
+ }
455
+ getUserSettings() {
456
+ return (0, settings_1.useUserSettings)();
457
+ }
458
+ };
459
+ })();
460
+ exports.WorkoutListPageService = WorkoutListPageService;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });