decord/alpha/source/modules/user_profile/WidgetAssetUtils.tsx
2026-10-13 12:43:34 +00:00

38 lines
1,002 B
TypeScript

// Module ID: 13713
// Function ID: 13714
// Name: WidgetAssetUtils
// Dependencies: [1085, 1415, 2]
// Exports: getWidgetAssetURL
// Module 13713 (WidgetAssetUtils)
import Constants from "Constants" /* 1085 */;
import AvatarUtils from "AvatarUtils" /* 1415 */;
import size from "module_2" /* 2 */;
let CDN_HOST;
const DEFAULT_CDN_HOST = Constants.DEFAULT_CDN_HOST;
const result = size.fileFinishedImporting("modules/user_profile/WidgetAssetUtils.tsx");
export const getWidgetAssetURL = function getWidgetAssetURL(arg0, fileId, arg2) {
let obj = arg2;
if (arg2 === undefined) {
obj = {};
}
let flag = obj.animated;
if (flag === undefined) {
flag = false;
}
if (CDN_HOST == null) {
CDN_HOST = DEFAULT_CDN_HOST;
}
let str = "webp";
if (!AvatarUtils.SUPPORTS_WEBP) {
let str2 = "png";
if (flag) {
str2 = "gif";
}
str = str2;
}
return "https://" + CDN_HOST + "/widget-assets/" + arg0 + "/" + fileId + "?format=" + str + "&animated=" + flag;
};