decord/source/modules/user_profile/WidgetAssetUtils.tsx

37 lines
962 B
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 12345
// Function ID: 12346
2026-08-06 08:05:19 +00:00
// Name: getWidgetAssetURL
2026-08-14 17:33:39 +00:00
// Dependencies: [676, 1435, 2]
2026-08-06 08:05:19 +00:00
// Exports: getWidgetAssetURL
2026-08-24 06:08:38 +00:00
// Module 12345 (getWidgetAssetURL)
import set from "set" /* 2 */;
import ME from "ME" /* 676 */;
import getAvatarURL from "getAvatarURL" /* 1435 */;
2026-08-06 08:05:19 +00:00
2026-08-24 06:08:38 +00:00
const DEFAULT_CDN_HOST = ME.DEFAULT_CDN_HOST;
const result = set.fileFinishedImporting("modules/user_profile/WidgetAssetUtils.tsx");
2026-08-06 08:05:19 +00:00
2026-08-14 17:33:39 +00:00
export const getWidgetAssetURL = function getWidgetAssetURL(arg0, fileId, arg2) {
let obj = arg2;
if (arg2 === undefined) {
obj = {};
}
let flag = obj.animated;
if (flag === undefined) {
flag = false;
}
2026-08-06 08:05:19 +00:00
if (CDN_HOST == null) {
CDN_HOST = DEFAULT_CDN_HOST;
}
2026-08-14 17:33:39 +00:00
let str = "webp";
2026-08-24 06:08:38 +00:00
if (!getAvatarURL.SUPPORTS_WEBP) {
2026-08-14 17:33:39 +00:00
let str2 = "png";
if (flag) {
str2 = "gif";
}
str = str2;
}
return "https://" + CDN_HOST + "/widget-assets/" + arg0 + "/" + fileId + "?format=" + str + "&animated=" + flag;
2026-08-06 08:05:19 +00:00
};