decord/beta/source/modules/checkpoint/CheckpointUtils.tsx
github-actions 9b6fea255e chore: update source for beta 346.12
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-18 19:45:33 +00:00

72 lines
2.7 KiB
TypeScript

// Module ID: 8260
// Function ID: 8261
// Name: CheckpointUtils
// Dependencies: [4665, 7744, 1114, 8261, 8262, 8263, 8264, 8265, 8266, 8267, 8268, 8269, 8270, 2]
// Exports: getCardAssetUrl, getCheckpointPowerBarUnits, getVoiceDurationString
// Module 8260 (CheckpointUtils)
import TimeUtils from "TimeUtils" /* 4665 */;
import notification_center_getTimestampString from "notification_center/getTimestampString" /* 7744 */;
import _modDef8261 from "module_8261" /* 8261 */;
import _modDef8262 from "module_8262" /* 8262 */;
import _modDef8263 from "module_8263" /* 8263 */;
import _modDef8264 from "module_8264" /* 8264 */;
import _modDef8265 from "module_8265" /* 8265 */;
import _modDef8266 from "module_8266" /* 8266 */;
import _modDef8267 from "module_8267" /* 8267 */;
import _modDef8268 from "module_8268" /* 8268 */;
import _modDef8269 from "module_8269" /* 8269 */;
import _modDef8270 from "module_8270" /* 8270 */;
import size from "module_2" /* 2 */;
const items = [TimeUtils.TimeUnits.HOURS, TimeUtils.TimeUnits.MINUTES];
const result = size.fileFinishedImporting("modules/checkpoint/CheckpointUtils.tsx");
export const getVoiceDurationString = function getVoiceDurationString(totalVoiceMinutes) {
const timeAndUnit = TimeUtils.getTimeAndUnit(totalVoiceMinutes, items);
({ time, unit } = timeAndUnit);
const time2 = notification_center_getTimestampString.getAbbreviatedFormatter();
if (null == time) {
const intl3 = tmp(1114).intl;
return intl3.formatToPlainString(time2.minutes, { minutes: 0 });
} else {
const _Math = Math;
const rounded = Math.round(time);
if (unit === tmp(4665).TimeUnits.HOURS) {
const intl2 = tmp(1114).intl;
const obj3 = { hours: rounded };
let formatToPlainStringResult = intl2.formatToPlainString(time2.hours, obj3);
} else {
const intl = tmp(1114).intl;
const obj4 = { minutes: rounded };
formatToPlainStringResult = intl.formatToPlainString(time2.minutes, obj4);
}
return formatToPlainStringResult;
}
};
export const getCardAssetUrl = function getCardAssetUrl(cardId) {
if (0 === cardId) {
return _modDef8261;
} else if (1 === cardId) {
return _modDef8262;
} else if (2 === cardId) {
return _modDef8263;
} else if (3 === cardId) {
return _modDef8264;
} else if (4 === cardId) {
return _modDef8265;
} else if (5 === cardId) {
return _modDef8266;
} else if (6 === cardId) {
return _modDef8267;
} else if (7 === cardId) {
return _modDef8268;
} else if (8 === cardId) {
return _modDef8269;
} else {
return _modDef8270;
}
};
export const getCheckpointPowerBarUnits = function getCheckpointPowerBarUnits(arg0) {
return Math.min(Math.max(Math.round(arg0 / 10), 1), 9);
};