129 lines
7.1 KiB
TypeScript
129 lines
7.1 KiB
TypeScript
/* Metro module 7021; source: modules/guild_boosting/native/GuildBoostPurchasingUtils.tsx; dependencies: [5, 3808, 661, 1880, 4496, 1244, 683, 4223, 7022, 7026, 3802, 2] */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import SubscriptionStore from '../../../stores/billing/SubscriptionStore.tsx'; /* Metro dependency 3808 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun55639(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55639, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7199:6, offset: 0x013ac815, size: 200 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ConstantsModule;
|
|
const env0_5 = value.AnalyticEvents;
|
|
const env0_6 = value.AnalyticsSections;
|
|
value = require(1880) /* metro dependency 1880: PremiumConstants */;
|
|
const env0_7 = value.NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM;
|
|
const env0_8 = value.PremiumTypes;
|
|
value = _fun55640();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_boosting/native/GuildBoostPurchasingUtils.tsx');
|
|
exports.launchGuildBoostFlowOrAlert = value;
|
|
function _fun55640() { // fn#55640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7199:235, offset: 0x013ac8dd, size: 32 bytes, params: 1, frame: 12
|
|
const env0_0 = Module00005(_fun55642);
|
|
return _fun55644;
|
|
function* _fun55642(a0, a1, a2, a3, a4) { // fn#55642, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7199:255, offset: 0x013ac906, size: 384 bytes, params: 6, frame: 23
|
|
var environment;
|
|
var premiumTypeSubscription;
|
|
var externalManagementMessage;
|
|
var object;
|
|
var binding2;
|
|
var value9;
|
|
var show;
|
|
var binding3;
|
|
var intl;
|
|
var value10;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var binding = env2_4;
|
|
if (binding.hasFetchedSubscriptions()) {
|
|
binding = env2_4;
|
|
premiumTypeSubscription = binding.getPremiumTypeSubscription();
|
|
binding = env2_0;
|
|
externalManagementMessage = binding(env2_2[8]).getExternalManagementMessage(premiumTypeSubscription);
|
|
if (externalManagementMessage != null) {
|
|
binding = env2_1;
|
|
binding2 = env2_2;
|
|
value9 = binding(binding2[4]);
|
|
show = value9.show;
|
|
object = {};
|
|
binding3 = env2_0;
|
|
intl = binding3(binding2[5]).intl;
|
|
object.title = intl.string(binding3(binding2[5]).t['8P7MX0']);
|
|
object.body = externalManagementMessage;
|
|
Reflect.apply(show, value9, [object]);
|
|
value10 = binding(binding2[6]);
|
|
value10.track(env2_5.OPEN_MODAL, {type: env2_6.IOS_CANNOT_MANAGE_SUBSCRIPTION, source: a0});
|
|
} else {
|
|
value = env2_0(env2_2[9]);
|
|
value.launchPremiumPlanSelect({showCurrentPlan: false, predicate: predicate_55643,
|
|
analyticsLocation: a0,
|
|
analyticsLocations: a1, onBack: a2, onPaymentSuccess: a3, onPaymentDismiss: a4});
|
|
}
|
|
} else {
|
|
binding = env2_0;
|
|
var value3 = binding(env2_2[7]);
|
|
yield value3.fetchSubscriptions();
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
binding = env2_4;
|
|
premiumTypeSubscription = binding.getPremiumTypeSubscription();
|
|
binding = env2_0;
|
|
externalManagementMessage = binding(env2_2[8]).getExternalManagementMessage(premiumTypeSubscription);
|
|
if (externalManagementMessage != null) {
|
|
binding = env2_1;
|
|
binding2 = env2_2;
|
|
value9 = binding(binding2[4]);
|
|
show = value9.show;
|
|
object = {};
|
|
binding3 = env2_0;
|
|
intl = binding3(binding2[5]).intl;
|
|
object.title = intl.string(binding3(binding2[5]).t['8P7MX0']);
|
|
object.body = externalManagementMessage;
|
|
Reflect.apply(show, value9, [object]);
|
|
value10 = binding(binding2[6]);
|
|
value10.track(env2_5.OPEN_MODAL, {type: env2_6.IOS_CANNOT_MANAGE_SUBSCRIPTION, source: a0});
|
|
} else {
|
|
value = env2_0(env2_2[9]);
|
|
value.launchPremiumPlanSelect({showCurrentPlan: false, predicate: predicate_55643,
|
|
analyticsLocation: a0,
|
|
analyticsLocations: a1, onBack: a2, onPaymentSuccess: a3, onPaymentDismiss: a4});
|
|
}
|
|
}
|
|
}
|
|
function predicate_55643({numPremiumGuild, premiumTier}) { // fn#55643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7199:654, offset: 0x013aca86, size: 147 bytes, params: 2, frame: 18
|
|
var r1;
|
|
var binding;
|
|
var binding2;
|
|
var value5;
|
|
var value6;
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
const TIER_2 = env3_8.TIER_2;
|
|
const value3 = numPremiumGuild + (premiumTier !== TIER_2 ? 0 : env3_7);
|
|
if (env0_0 != null) {
|
|
binding = env3_0;
|
|
binding2 = env3_2;
|
|
value5 = binding(binding2[10]);
|
|
value6 = value5.getNumPremiumGuildSubscriptions(env0_0.additionalPlans);
|
|
binding = env3_1;
|
|
value = binding(binding2[10]);
|
|
value = value6 + value.getNumIncludedPremiumGuildSubscriptionSlots(env0_0.planId);
|
|
r1 = value;
|
|
} else {
|
|
r1 = 0;
|
|
}
|
|
return value3 > r1;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun55644() { // fn#55644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7199:941, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
|
|
return env0_0.apply(this, arguments);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun55639, 7021, [5, 3808, 661, 1880, 4496, 1244, 683, 4223, 7022, 7026, 3802,
|
|
2]) /* metro module 7021, dependencies: [5, 3808, 661, 1880, 4496, 1244, 683, 4223, 7022, 7026, 3802, 2] */;
|