decord/source/modules/wishlists/CollectiblesWishlistUtils.tsx

52 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9215
// Function ID: 9216
2026-07-20 16:05:17 +00:00
// Name: getProductNameAndTypeFromSku
2026-08-24 06:08:38 +00:00
// Dependencies: [1949, 1236, 5318, 2]
2026-07-20 16:05:17 +00:00
// Exports: getProductNameAndTypeFromSku, isWishlistableCollectiblesProduct
2026-08-24 06:08:38 +00:00
// Module 9215 (getProductNameAndTypeFromSku)
import set from "set" /* 2 */;
import CollectiblesItemType from "CollectiblesItemType" /* 1949 */;
import getItemRecordsFromPurchases from "getItemRecordsFromPurchases" /* 5318 */;
let result = set.fileFinishedImporting("modules/wishlists/CollectiblesWishlistUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getProductNameAndTypeFromSku = function getProductNameAndTypeFromSku(sku) {
({ name, tenantMetadata } = sku);
let type;
2026-07-29 08:29:29 +00:00
if (tenantMetadata != null) {
2026-07-20 16:05:17 +00:00
const collectibles = tenantMetadata.collectibles;
2026-07-29 08:29:29 +00:00
if (collectibles != null) {
2026-07-20 16:05:17 +00:00
type = collectibles.type;
}
}
2026-08-24 06:08:38 +00:00
if (CollectiblesItemType.CollectiblesItemType.AVATAR_DECORATION === type) {
2026-07-29 08:29:29 +00:00
const intl2 = tmp2(1236).intl;
let obj = { product: null };
obj[0] = name;
let formatToPlainStringResult = intl2.formatToPlainString(tmp2(1236).t.lvBzLi, obj);
2026-08-11 06:20:06 +00:00
} else if (tmp2(1949).CollectiblesItemType.PROFILE_EFFECT === type) {
2026-07-29 08:29:29 +00:00
const intl = tmp2(1236).intl;
obj = { product: null };
obj[0] = name;
formatToPlainStringResult = intl.formatToPlainString(tmp2(1236).t.eR7moP, obj);
2026-07-20 16:05:17 +00:00
} else {
formatToPlainStringResult = name;
2026-08-11 06:20:06 +00:00
if (tmp2(1949).CollectiblesItemType.NAMEPLATE === type) {
2026-07-29 08:29:29 +00:00
const intl3 = tmp2(1236).intl;
obj = { product: null };
obj[0] = name;
formatToPlainStringResult = intl3.formatToPlainString(tmp2(1236).t.YFOwHj, obj);
2026-07-20 16:05:17 +00:00
}
}
return formatToPlainStringResult;
};
export const isWishlistableCollectiblesProduct = function isWishlistableCollectiblesProduct(selectedProduct) {
2026-08-24 06:08:38 +00:00
const result = getItemRecordsFromPurchases.isPremiumCollectiblesProduct(selectedProduct);
2026-07-29 08:29:29 +00:00
let tmp4 = !result;
if (!result) {
2026-08-24 06:08:38 +00:00
tmp4 = selectedProduct.type !== CollectiblesItemType.CollectiblesItemType.EXTERNAL_SKU;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp4;
2026-07-20 16:05:17 +00:00
};