101 lines
5.9 KiB
TypeScript
101 lines
5.9 KiB
TypeScript
/* Metro module 13215; source: modules/collectibles/profile_effects/useProfileEffectSections.tsx; dependencies: [57, 31, 5121, 5145, 632, 5134, 1244, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import CollectiblesCategoryStore from '../CollectiblesCategoryStore.tsx'; /* Metro dependency 5121 */
|
|
import CollectiblesPurchaseStore from '../CollectiblesPurchaseStore.tsx'; /* Metro dependency 5145 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as CollectiblesUtilsModule from '../CollectiblesUtils.tsx'; /* Metro dependency 5134 */
|
|
|
|
function _fun100817(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13405:6, offset: 0x021fab20, size: 251 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/collectibles/profile_effects/useProfileEffectSections.tsx');
|
|
exports.default = _default_100818;
|
|
exports.Section = {PURCHASE: 'purchase', PREMIUM_PURCHASE: 'premium_purchase', PREVIEW: 'preview'};
|
|
exports.NONE_ITEM = {skuId: 'None'};
|
|
exports.SHOP_ITEM = {skuId: 'Shop'};
|
|
function _default_100818() { // fn#100818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13405:295, offset: 0x021fac1b, size: 170 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 = Module00057(Reflect.apply(useStateFromStoresArray, useStateFromStoresModule, [[CollectiblesCategoryStore],
|
|
function() {
|
|
var collectiblesCategoryStoreBinding = CollectiblesCategoryStore;
|
|
return [collectiblesCategoryStoreBinding.categories, collectiblesCategoryStoreBinding.products];
|
|
}]), 2);
|
|
return useMemo(_fun100821, [value3[0], value3[1], purchases]);
|
|
function _fun100821() { // fn#100821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13405:460, offset: 0x021facc5, size: 403 bytes, params: 1, frame: 23
|
|
const value4 = (CollectiblesUtilsModule).getProfileEffects(purchases,
|
|
env0_1).reduce(_fun100822, {purchase: [], premium_purchase: [], preview: []});
|
|
object = {};
|
|
const binding = env1_6;
|
|
const PURCHASE = binding.PURCHASE;
|
|
object.section = PURCHASE;
|
|
const items3 = [env1_7, env1_8];
|
|
arraySpread(items3, value4.purchase, 2, undefined);
|
|
object.items = items3;
|
|
object.height = 12;
|
|
const intl = (IndexNativeModule).intl;
|
|
let string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
object.header = Reflect.apply(string, intl, [t['9x1v/p']]);
|
|
const items2 = [object];
|
|
const PREMIUM_PURCHASE = binding.PREMIUM_PURCHASE;
|
|
string = intl.string;
|
|
const TiLCgw = t.TiLCgw;
|
|
items2[1] = {section: PREMIUM_PURCHASE, items: value4.premium_purchase, height: 12, header: Reflect.apply(string,
|
|
intl, [TiLCgw])};
|
|
object = {};
|
|
const PREVIEW = binding.PREVIEW;
|
|
object.section = PREVIEW;
|
|
object.items = value4.preview;
|
|
object.height = 12;
|
|
object.header = intl.string(t['1vbbee']);
|
|
items2[2] = object;
|
|
return items2.filter(function(a0) {
|
|
return a0.items.length > 0;
|
|
});
|
|
function _fun100822(a0, a1) { // fn#100822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13405:510, offset: 0x01c0abff, 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;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun100817, 13215, [57, 31, 5121, 5145, 632, 5134, 1244,
|
|
2]) /* metro module 13215, dependencies: [57, 31, 5121, 5145, 632, 5134, 1244, 2] */;
|