97 lines
5.0 KiB
TypeScript
97 lines
5.0 KiB
TypeScript
/* Metro module 13219; source: modules/collectibles/profile_frames/useProfileFrameSections.tsx; dependencies: [57, 31, 5121, 5145, 632, 10054, 5134, 1244, 2] */
|
|
function _fun100845(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100845, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13409:6, offset: 0x021fc6b2, size: 251 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_3 = (require(31) /* metro dependency 31 */).useMemo;
|
|
const collectiblesCategoryStore = importDefault(5121) /* metro dependency 5121: CollectiblesCategoryStore */;
|
|
const collectiblesPurchaseStore = importDefault(5145) /* metro dependency 5145: CollectiblesPurchaseStore */;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/collectibles/profile_frames/useProfileFrameSections.tsx');
|
|
exports.default = _default_100846;
|
|
exports.Section = {PURCHASE: 'purchase', PREMIUM_PURCHASE: 'premium_purchase', PREVIEW: 'preview'};
|
|
exports.NONE_ITEM = {skuId: 'None'};
|
|
exports.SHOP_ITEM = {skuId: 'Shop'};
|
|
}
|
|
|
|
function _default_100846() { // fn#100846, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13409:295, offset: 0x021fc7ad, size: 207 bytes, params: 1, frame: 19
|
|
const purchases = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([CollectiblesPurchaseStore],
|
|
function() {
|
|
return CollectiblesPurchaseStore.purchases;
|
|
});
|
|
const useStateFromStoresModule = require(632) /* metro dependency 632: useStateFromStores */;
|
|
const useStateFromStoresArray = useStateFromStoresModule.useStateFromStoresArray;
|
|
const value3 = env0_2(Reflect.apply(useStateFromStoresArray, useStateFromStoresModule, [[CollectiblesCategoryStore],
|
|
function() {
|
|
return [CollectiblesCategoryStore.categories, CollectiblesCategoryStore.products];
|
|
}]), 2);
|
|
return useMemo(_fun100849, [value3[0], value3[1], purchases,
|
|
(require(10054) /* metro dependency 10054: useCanPurchaseFrames */).useIsProfileFramesEarlyAccessPhase('useProfileFrameSections')]);
|
|
}
|
|
|
|
function _fun100849() { // fn#100849, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13409:532, offset: 0x021fc87c, size: 418 bytes, params: 1, frame: 24
|
|
var object2;
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
const value4 = (require(5134) /* metro dependency 5134: CollectiblesUtils */).getProfileFrames(purchases,
|
|
env0_1).reduce(_fun100850, {purchase: [], premium_purchase: [], preview: []});
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const TiLCgw = t.TiLCgw;
|
|
const value5 = Reflect.apply(string, intl, [TiLCgw]);
|
|
object2 = {};
|
|
const binding = env1_6;
|
|
const PURCHASE = binding.PURCHASE;
|
|
object2.section = PURCHASE;
|
|
const items3 = [env1_7, env1_8];
|
|
arraySpread(items3, value4.purchase, 2, require);
|
|
object2.items = items3;
|
|
object2.height = 12;
|
|
object2.header = intl.string(t['9eZ4aO']);
|
|
const items2 = [object2];
|
|
const PREMIUM_PURCHASE = binding.PREMIUM_PURCHASE;
|
|
items2[1] = {section: PREMIUM_PURCHASE, items: value4.premium_purchase, height: 12, header: value5};
|
|
object2 = {};
|
|
const PREVIEW = binding.PREVIEW;
|
|
object2.section = PREVIEW;
|
|
object2.items = value4.preview;
|
|
object2.height = 12;
|
|
object2.header = env0_3 ? value5 : intl.string(t['1vbbee']);
|
|
items2[2] = object2;
|
|
return items2.filter(function(a0) {
|
|
return a0.items.length > 0;
|
|
});
|
|
}
|
|
|
|
function _fun100850(a0, a1) { // fn#100850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13409:581, offset: 0x021fca1e, size: 188 bytes, params: 3, frame: 17
|
|
var r4;
|
|
var value3;
|
|
var moduleValue;
|
|
var isPremiumCollectiblesProduct;
|
|
var binding;
|
|
let value = environment.__proto__;
|
|
const value2 = purchases.get(a1.skuId);
|
|
if (value2 != null) {
|
|
value = environment.__proto__.__proto__;
|
|
value = require(5134) /* metro dependency 5134: CollectiblesUtils */;
|
|
value = value.isPremiumCollectiblesPurchase(value2);
|
|
r4 = value;
|
|
} else {
|
|
value3 = environment.__proto__.__proto__;
|
|
moduleValue = require(5134) /* metro dependency 5134: CollectiblesUtils */;
|
|
isPremiumCollectiblesProduct = moduleValue.isPremiumCollectiblesProduct;
|
|
binding = env1_2;
|
|
r4 = Reflect.apply(isPremiumCollectiblesProduct, moduleValue, [binding.get(a1.skuId)]);
|
|
}
|
|
if (r4) {
|
|
a0.premium_purchase.push(a1);
|
|
} else if (value2 != null) {
|
|
a0.purchase.push(a1);
|
|
} else {
|
|
a0.preview.push(a1);
|
|
}
|
|
return a0;
|
|
}
|
|
|