decord/alpha/source/modules/checkpoint/2025/CheckpointUtils.tsx

78 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-10-06 11:16:32 +00:00
// Module ID: 5131
// Function ID: 5132
// Name: CheckpointUtils
2026-10-06 11:16:32 +00:00
// Dependencies: [4925, 5132, 1126, 5133, 5134, 5135, 5136, 5137, 5138, 5139, 5140, 5141, 5142, 2]
2026-07-20 16:05:17 +00:00
// Exports: getCardAssetUrl, getCheckpointPowerBarUnits, getVoiceDurationString
2026-10-06 11:16:32 +00:00
// Module 5131 (CheckpointUtils)
import TimeUtils from "TimeUtils" /* 4925 */;
import getTimestampString from "getTimestampString" /* 5132 */;
2026-10-03 08:58:59 +00:00
import _modDef5133 from "module_5133" /* 5133 */;
import _modDef5134 from "module_5134" /* 5134 */;
import _modDef5135 from "module_5135" /* 5135 */;
2026-10-06 11:16:32 +00:00
import _modDef5136 from "module_5136" /* 5136 */;
import _modDef5137 from "module_5137" /* 5137 */;
import _modDef5138 from "module_5138" /* 5138 */;
import _modDef5139 from "module_5139" /* 5139 */;
import _modDef5140 from "module_5140" /* 5140 */;
import _modDef5141 from "module_5141" /* 5141 */;
import _modDef5142 from "module_5142" /* 5142 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
const items = [TimeUtils.TimeUnits.HOURS, TimeUtils.TimeUnits.MINUTES];
const result = size.fileFinishedImporting("modules/checkpoint/2025/CheckpointUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getVoiceDurationString = function getVoiceDurationString(rounded) {
2026-10-03 08:58:59 +00:00
let time;
let unit;
const obj = TimeUtils;
const timeAndUnit = obj.getTimeAndUnit(rounded, items);
2026-07-29 08:29:29 +00:00
({ time, unit } = timeAndUnit);
2026-10-03 08:58:59 +00:00
const obj2 = getTimestampString;
const time2 = obj2.getAbbreviatedFormatter();
2026-07-20 16:05:17 +00:00
if (null == time) {
2026-10-03 08:58:59 +00:00
const intl3 = tmp(1126).intl;
return intl3.formatToPlainString(time2.minutes, { minutes: 0 });
2026-07-20 16:05:17 +00:00
} else {
2026-10-03 08:58:59 +00:00
let formatToPlainStringResult;
2026-07-20 16:05:17 +00:00
const _Math = Math;
rounded = Math.round(time);
2026-10-03 08:58:59 +00:00
if (unit === TimeUtils.TimeUnits.HOURS) {
const intl2 = tmp(1126).intl;
const obj3 = { hours: rounded };
2026-10-03 08:58:59 +00:00
formatToPlainStringResult = intl2.formatToPlainString(time2.hours, obj3);
2026-07-20 16:05:17 +00:00
} else {
2026-10-03 08:58:59 +00:00
const intl = tmp(1126).intl;
const obj4 = { minutes: rounded };
formatToPlainStringResult = intl.formatToPlainString(time2.minutes, obj4);
2026-07-20 16:05:17 +00:00
}
return formatToPlainStringResult;
}
};
export const getCardAssetUrl = function getCardAssetUrl(cardId) {
if (0 === cardId) {
2026-10-06 11:16:32 +00:00
return _modDef5133;
} else if (1 === cardId) {
2026-10-06 11:16:32 +00:00
return _modDef5134;
} else if (2 === cardId) {
2026-10-06 11:16:32 +00:00
return _modDef5135;
} else if (3 === cardId) {
2026-10-06 11:16:32 +00:00
return _modDef5136;
} else if (4 === cardId) {
2026-10-06 11:16:32 +00:00
return _modDef5137;
} else if (5 === cardId) {
2026-10-06 11:16:32 +00:00
return _modDef5138;
} else if (6 === cardId) {
2026-10-06 11:16:32 +00:00
return _modDef5139;
} else if (7 === cardId) {
2026-10-06 11:16:32 +00:00
return _modDef5140;
} else if (8 === cardId) {
2026-10-06 11:16:32 +00:00
return _modDef5141;
} else {
2026-10-06 11:16:32 +00:00
return _modDef5142;
2026-07-20 16:05:17 +00:00
}
};
export const getCheckpointPowerBarUnits = function getCheckpointPowerBarUnits(powerLevelPercentile) {
return Math.min(Math.max(Math.round(powerLevelPercentile / 10), 1), 9);
2026-07-20 16:05:17 +00:00
};