decord/source/modules/wishlists/CollectiblesWishlistUtils.tsx

55 lines
2.4 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 8597
2026-07-27 11:26:19 +00:00
// Function ID: 68290
2026-07-20 16:05:17 +00:00
// Name: getProductNameAndTypeFromSku
2026-07-25 08:10:48 +00:00
// Dependencies: [1877, 1212, 5782, 8598, 2]
2026-07-20 16:05:17 +00:00
// Exports: getProductNameAndTypeFromSku, isWishlistableCollectiblesProduct
2026-07-25 08:10:48 +00:00
// Module 8597 (getProductNameAndTypeFromSku)
2026-07-23 10:11:24 +00:00
const result = require("getPriceForCollectiblesProduct").fileFinishedImporting("modules/wishlists/CollectiblesWishlistUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getProductNameAndTypeFromSku = function getProductNameAndTypeFromSku(sku) {
let name;
let tenantMetadata;
({ name, tenantMetadata } = sku);
let type;
if (null != tenantMetadata) {
const collectibles = tenantMetadata.collectibles;
if (null != collectibles) {
type = collectibles.type;
}
}
2026-07-25 08:10:48 +00:00
if (require(1877) /* CollectiblesItemType */.CollectiblesItemType.AVATAR_DECORATION === type) {
2026-07-23 10:11:24 +00:00
const intl2 = require(1212) /* getSystemLocale */.intl;
2026-07-20 16:05:17 +00:00
let obj = { product: name };
2026-07-23 10:11:24 +00:00
let formatToPlainStringResult = intl2.formatToPlainString(require(1212) /* getSystemLocale */.t.lvBzLi, obj);
2026-07-25 08:10:48 +00:00
} else if (require(1877) /* CollectiblesItemType */.CollectiblesItemType.PROFILE_EFFECT === type) {
2026-07-23 10:11:24 +00:00
const intl = require(1212) /* getSystemLocale */.intl;
2026-07-20 16:05:17 +00:00
obj = { product: name };
2026-07-23 10:11:24 +00:00
formatToPlainStringResult = intl.formatToPlainString(require(1212) /* getSystemLocale */.t.eR7moP, obj);
2026-07-20 16:05:17 +00:00
} else {
formatToPlainStringResult = name;
2026-07-25 08:10:48 +00:00
if (require(1877) /* CollectiblesItemType */.CollectiblesItemType.NAMEPLATE === type) {
2026-07-23 10:11:24 +00:00
const intl3 = require(1212) /* getSystemLocale */.intl;
2026-07-20 16:05:17 +00:00
obj = { product: name };
2026-07-23 10:11:24 +00:00
formatToPlainStringResult = intl3.formatToPlainString(require(1212) /* getSystemLocale */.t.YFOwHj, obj);
2026-07-20 16:05:17 +00:00
}
}
return formatToPlainStringResult;
};
export const isWishlistableCollectiblesProduct = function isWishlistableCollectiblesProduct(selectedProduct) {
2026-07-25 08:10:48 +00:00
let tmp = !require(5782) /* getPriceForCollectiblesProduct */.isPremiumCollectiblesProduct(selectedProduct);
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-25 08:10:48 +00:00
let tmp4 = selectedProduct.type !== require(1877) /* CollectiblesItemType */.CollectiblesItemType.EXTERNAL_SKU;
2026-07-20 16:05:17 +00:00
if (tmp4) {
2026-07-25 08:10:48 +00:00
let tmp7 = selectedProduct.type === require(1877) /* CollectiblesItemType */.CollectiblesItemType.PROFILE_FRAME;
2026-07-20 16:05:17 +00:00
if (tmp7) {
2026-07-25 08:10:48 +00:00
tmp7 = !require(8598) /* apexExperiment */.getIsProfileFrameGiftingEnabled("isWishlistableCollectiblesProduct");
const obj2 = require(8598) /* apexExperiment */;
2026-07-20 16:05:17 +00:00
}
tmp4 = !tmp7;
}
tmp = tmp4;
}
return tmp;
};