668 lines
35 KiB
TypeScript
668 lines
35 KiB
TypeScript
/* Metro module 7509; source: components_native/premium/PremiumSubscriptionDetails.tsx; dependencies: [57, 5, 31, 27, 1878, 5140, 661, 1880, 33, 697, 4501, 3802, 7305, 7510, 7511, 7302, 7303, 7304, 7306, 7512, 7513, 7514, 7250, 7515, 7516, 7517, 7518, 7519, 7307, 7520, 7521, 7522, 7523, 7524, 7525, 7526, 7310, 7527, 7528, 7529, 7312, 7530, 7531, 7532, 7294, 7355, 7533, 7534, 7026, 1484, 566, 44, 6771, 5137, 477, 1305, 4578, 1244, 4573, 7545, 6789, 7546, 7547, 2] */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Module00044 from '../../by-id/module-00044.js'; /* Metro dependency 44 */
|
|
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Native from '../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import PremiumUtils from '../../utils/PremiumUtils.tsx'; /* Metro dependency 3802 */
|
|
import IAPStoreAndroid from '../../stores/native/IAPStore.android.tsx'; /* Metro dependency 5140 */
|
|
import UseAnalyticsLocations from '../../modules/app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import AnalyticsLocation from '../../modules/app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as NativeModule from '../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as UseNavigationNativeModule from '../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
|
|
import * as PremiumConstantsModule from '../../modules/premium/PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
import * as PremiumUtilsModule from '../../utils/PremiumUtils.tsx'; /* Metro dependency 3802 */
|
|
import * as TextModule from '../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as ButtonNativeModule from '../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as PremiumAnalyticsUtilsModule from '../../modules/premium/native/PremiumAnalyticsUtils.tsx'; /* Metro dependency 7294 */
|
|
import * as PremiumSubscriptionInvoiceModule from '../../modules/premium/PremiumSubscriptionInvoice.tsx'; /* Metro dependency 7545 */
|
|
|
|
function _fun60564(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:6, offset: 0x01706009, size: 3084 bytes, params: 8, frame: 40
|
|
const env0_0 = require;
|
|
const handleCancelSubscription = function() {
|
|
return _handleCancelSubscription.apply(this, arguments);
|
|
};
|
|
const onCancelClick2 = onCancelClick;
|
|
const handleManageSubscription2 = handleManageSubscription;
|
|
const closure3 = function() {
|
|
return _onResubscribeClick.apply(this, arguments);
|
|
};
|
|
const PremiumSubscriptionHeader2 = PremiumSubscriptionHeader;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
let value = ReactNativeModule;
|
|
const env0_5 = value.Image;
|
|
const env0_6 = value.ImageBackground;
|
|
const env0_7 = value.Linking;
|
|
const env0_8 = value.View;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_11 = value.AnalyticsPages;
|
|
const env0_12 = value.AnalyticsSections;
|
|
const env0_13 = value.SubscriptionStatusTypes;
|
|
const USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING = value.USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_15 = value.jsx;
|
|
const env0_16 = value.jsxs;
|
|
object = {imageTier2: {'height': 37, 'width': 49}, imageTier1: {'height': 35, 'width': 49},
|
|
imageTier0: {'height': 35, 'width': 29}, imageBundle: {'height': 35, 'width': 49},
|
|
imagePremiumNonActive: {'height': 36, 'width': 51}, imagePremiumGuild: {'width': 51, 'height': 36},
|
|
imagePremiumGuildNonActive: {'width': 51, 'height': 36}, logoPremiumBundle: {'height': 33, 'width': 205},
|
|
logoPremiumTier0: {'height': 32, 'width': 59}, logoPremiumTier1: {'height': 16, 'width': 156},
|
|
logoPremiumTier2: {'height': 32, 'width': 78}, logoPremiumGuild: {'height': 17, 'width': 184}};
|
|
const object2 = {};
|
|
const WHITE = (Native).unsafe_rawColors.WHITE;
|
|
object2.price = {'fontSize': 14, 'marginTop': 10, color: WHITE};
|
|
const BLACK = (Native).unsafe_rawColors.BLACK;
|
|
object2.priceDark = {'fontSize': 14, 'marginTop': 10, color: BLACK};
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const object5 = {};
|
|
object5.title = {paddingHorizontal: USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING};
|
|
object5.header = {padding: 16};
|
|
object5.wumpusImg = {marginRight: 10};
|
|
object5.logoContainer = {'flexDirection': 'row', 'alignItems': 'center'};
|
|
const BACKGROUND_BASE_LOWEST = (Native).colors.BACKGROUND_BASE_LOWEST;
|
|
object5.container = {'marginTop': 8, 'overflow': 'hidden', backgroundColor: BACKGROUND_BASE_LOWEST};
|
|
object5.buttonContainer = {'marginTop': 8, 'flexDirection': 'row'};
|
|
object5.buttonWrapper = {'alignSelf': 'flex-start', 'flexGrow': 0, 'flexShrink': 0, 'marginRight': 8};
|
|
object5.cancelLink = {'alignSelf': 'flex-start', 'flexGrow': 0, 'flexShrink': 0, 'marginLeft': 16, 'marginTop': 2};
|
|
object5.desktopSubtext = {marginTop: 8, paddingHorizontal: USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING};
|
|
const env0_17 = Reflect.apply(createStyles, value, [object5]);
|
|
const object11 = {ACTIVE: 'active', RESUB: 'resub', ERROR: 'error'};
|
|
const object12 = {};
|
|
const Branding = (PremiumUtilsModule).Branding;
|
|
let BUNDLE = Branding.BUNDLE;
|
|
const object13 = {};
|
|
let ACTIVE = object11.ACTIVE;
|
|
object13[ACTIVE] = importDefault(7305) /* metro dependency 7305 */;
|
|
let ERROR = object11.ERROR;
|
|
object13[ERROR] = importDefault(7510) /* metro dependency 7510 */;
|
|
let RESUB = object11.RESUB;
|
|
object13[RESUB] = importDefault(7511) /* metro dependency 7511 */;
|
|
object12[BUNDLE] = object13;
|
|
let TIER_0 = Branding.TIER_0;
|
|
const object14 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object14[ACTIVE] = importDefault(7302) /* metro dependency 7302 */;
|
|
ERROR = object11.ERROR;
|
|
object14[ERROR] = importDefault(7510) /* metro dependency 7510 */;
|
|
RESUB = object11.RESUB;
|
|
object14[RESUB] = importDefault(7511) /* metro dependency 7511 */;
|
|
object12[TIER_0] = object14;
|
|
let TIER_1 = Branding.TIER_1;
|
|
const object15 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object15[ACTIVE] = importDefault(7303) /* metro dependency 7303 */;
|
|
ERROR = object11.ERROR;
|
|
object15[ERROR] = importDefault(7510) /* metro dependency 7510 */;
|
|
RESUB = object11.RESUB;
|
|
object15[RESUB] = importDefault(7511) /* metro dependency 7511 */;
|
|
object12[TIER_1] = object15;
|
|
let TIER_2 = Branding.TIER_2;
|
|
const object16 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object16[ACTIVE] = importDefault(7304) /* metro dependency 7304 */;
|
|
ERROR = object11.ERROR;
|
|
object16[ERROR] = importDefault(7510) /* metro dependency 7510 */;
|
|
RESUB = object11.RESUB;
|
|
object16[RESUB] = importDefault(7511) /* metro dependency 7511 */;
|
|
object12[TIER_2] = object16;
|
|
let PREMIUM_GUILD = Branding.PREMIUM_GUILD;
|
|
const object17 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object17[ACTIVE] = importDefault(7306) /* metro dependency 7306 */;
|
|
ERROR = object11.ERROR;
|
|
object17[ERROR] = importDefault(7512) /* metro dependency 7512 */;
|
|
RESUB = object11.RESUB;
|
|
object17[RESUB] = importDefault(7513) /* metro dependency 7513 */;
|
|
object12[PREMIUM_GUILD] = object17;
|
|
const object18 = {};
|
|
BUNDLE = Branding.BUNDLE;
|
|
const object19 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object19[ACTIVE] = importDefault(7514) /* metro dependency 7514 */;
|
|
ERROR = object11.ERROR;
|
|
object19[ERROR] = importDefault(7514) /* metro dependency 7514 */;
|
|
RESUB = object11.RESUB;
|
|
object19[RESUB] = importDefault(7514) /* metro dependency 7514 */;
|
|
object18[BUNDLE] = object19;
|
|
TIER_0 = Branding.TIER_0;
|
|
const object20 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object20[ACTIVE] = importDefault(7250) /* metro dependency 7250 */;
|
|
ERROR = object11.ERROR;
|
|
object20[ERROR] = importDefault(7515) /* metro dependency 7515 */;
|
|
RESUB = object11.RESUB;
|
|
object20[RESUB] = importDefault(7516) /* metro dependency 7516 */;
|
|
object18[TIER_0] = object20;
|
|
TIER_1 = Branding.TIER_1;
|
|
const object21 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object21[ACTIVE] = importDefault(7517) /* metro dependency 7517 */;
|
|
ERROR = object11.ERROR;
|
|
object21[ERROR] = importDefault(7518) /* metro dependency 7518 */;
|
|
RESUB = object11.RESUB;
|
|
object21[RESUB] = importDefault(7519) /* metro dependency 7519 */;
|
|
object18[TIER_1] = object21;
|
|
TIER_2 = Branding.TIER_2;
|
|
const object22 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object22[ACTIVE] = importDefault(7307) /* metro dependency 7307 */;
|
|
ERROR = object11.ERROR;
|
|
object22[ERROR] = importDefault(7520) /* metro dependency 7520 */;
|
|
RESUB = object11.RESUB;
|
|
object22[RESUB] = importDefault(7521) /* metro dependency 7521 */;
|
|
object18[TIER_2] = object22;
|
|
PREMIUM_GUILD = Branding.PREMIUM_GUILD;
|
|
const object23 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object23[ACTIVE] = importDefault(7522) /* metro dependency 7522 */;
|
|
ERROR = object11.ERROR;
|
|
object23[ERROR] = importDefault(7523) /* metro dependency 7523 */;
|
|
RESUB = object11.RESUB;
|
|
object23[RESUB] = importDefault(7524) /* metro dependency 7524 */;
|
|
object18[PREMIUM_GUILD] = object23;
|
|
const object24 = {};
|
|
BUNDLE = Branding.BUNDLE;
|
|
ACTIVE = object11.ACTIVE;
|
|
ERROR = object11.ERROR;
|
|
RESUB = object11.RESUB;
|
|
object24[BUNDLE] = {[ACTIVE]: object.imageBundle, [ERROR]: object.imageBundle, [RESUB]: object.imageBundle};
|
|
TIER_0 = Branding.TIER_0;
|
|
ACTIVE = object11.ACTIVE;
|
|
ERROR = object11.ERROR;
|
|
RESUB = object11.RESUB;
|
|
object24[TIER_0] = {[ACTIVE]: object.imageTier0, [ERROR]: object.imagePremiumNonActive,
|
|
[RESUB]: object.imagePremiumNonActive};
|
|
TIER_1 = Branding.TIER_1;
|
|
ACTIVE = object11.ACTIVE;
|
|
ERROR = object11.ERROR;
|
|
RESUB = object11.RESUB;
|
|
object24[TIER_1] = {[ACTIVE]: object.imageTier1, [ERROR]: object.imagePremiumNonActive,
|
|
[RESUB]: object.imagePremiumNonActive};
|
|
TIER_2 = Branding.TIER_2;
|
|
ACTIVE = object11.ACTIVE;
|
|
ERROR = object11.ERROR;
|
|
RESUB = object11.RESUB;
|
|
object24[TIER_2] = {[ACTIVE]: object.imageTier2, [ERROR]: object.imagePremiumNonActive,
|
|
[RESUB]: object.imagePremiumNonActive};
|
|
PREMIUM_GUILD = Branding.PREMIUM_GUILD;
|
|
ACTIVE = object11.ACTIVE;
|
|
ERROR = object11.ERROR;
|
|
RESUB = object11.RESUB;
|
|
object24[PREMIUM_GUILD] = {[ACTIVE]: object.imagePremiumGuild, [ERROR]: object.imagePremiumGuildNonActive,
|
|
[RESUB]: object.imagePremiumGuildNonActive};
|
|
const object30 = {};
|
|
BUNDLE = Branding.BUNDLE;
|
|
const object31 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object31[ACTIVE] = importDefault(7525) /* metro dependency 7525 */;
|
|
ERROR = object11.ERROR;
|
|
object31[ERROR] = importDefault(7525) /* metro dependency 7525 */;
|
|
RESUB = object11.RESUB;
|
|
object31[RESUB] = importDefault(7526) /* metro dependency 7526 */;
|
|
object30[BUNDLE] = object31;
|
|
TIER_0 = Branding.TIER_0;
|
|
const object32 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object32[ACTIVE] = importDefault(7310) /* metro dependency 7310 */;
|
|
ERROR = object11.ERROR;
|
|
object32[ERROR] = importDefault(7310) /* metro dependency 7310 */;
|
|
RESUB = object11.RESUB;
|
|
object32[RESUB] = importDefault(7527) /* metro dependency 7527 */;
|
|
object30[TIER_0] = object32;
|
|
TIER_1 = Branding.TIER_1;
|
|
const object33 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object33[ACTIVE] = importDefault(7528) /* metro dependency 7528 */;
|
|
ERROR = object11.ERROR;
|
|
object33[ERROR] = importDefault(7528) /* metro dependency 7528 */;
|
|
RESUB = object11.RESUB;
|
|
object33[RESUB] = importDefault(7529) /* metro dependency 7529 */;
|
|
object30[TIER_1] = object33;
|
|
TIER_2 = Branding.TIER_2;
|
|
const object34 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object34[ACTIVE] = importDefault(7312) /* metro dependency 7312 */;
|
|
ERROR = object11.ERROR;
|
|
object34[ERROR] = importDefault(7312) /* metro dependency 7312 */;
|
|
RESUB = object11.RESUB;
|
|
object34[RESUB] = importDefault(7530) /* metro dependency 7530 */;
|
|
object30[TIER_2] = object34;
|
|
PREMIUM_GUILD = Branding.PREMIUM_GUILD;
|
|
const object35 = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object35[ACTIVE] = importDefault(7531) /* metro dependency 7531 */;
|
|
ERROR = object11.ERROR;
|
|
object35[ERROR] = importDefault(7531) /* metro dependency 7531 */;
|
|
RESUB = object11.RESUB;
|
|
object35[RESUB] = importDefault(7532) /* metro dependency 7532 */;
|
|
object30[PREMIUM_GUILD] = object35;
|
|
const object36 = {};
|
|
BUNDLE = Branding.BUNDLE;
|
|
object36[BUNDLE] = object.logoPremiumBundle;
|
|
TIER_0 = Branding.TIER_0;
|
|
object36[TIER_0] = object.logoPremiumTier0;
|
|
TIER_1 = Branding.TIER_1;
|
|
object36[TIER_1] = object.logoPremiumTier1;
|
|
TIER_2 = Branding.TIER_2;
|
|
object36[TIER_2] = object.logoPremiumTier2;
|
|
PREMIUM_GUILD = Branding.PREMIUM_GUILD;
|
|
object36[PREMIUM_GUILD] = object.logoPremiumGuild;
|
|
object = {};
|
|
ACTIVE = object11.ACTIVE;
|
|
object[ACTIVE] = object2.price;
|
|
ERROR = object11.ERROR;
|
|
object[ERROR] = object2.price;
|
|
RESUB = object11.RESUB;
|
|
object[RESUB] = object2.priceDark;
|
|
(FileImportTrackerModule).fileFinishedImporting('components_native/premium/PremiumSubscriptionDetails.tsx');
|
|
exports.default = PremiumSubscriptionDetails;
|
|
exports.onCancelClick = onCancelClick2;
|
|
exports.handleManageSubscription = handleManageSubscription2;
|
|
exports.onResubscribeClick = closure3;
|
|
exports.PremiumSubscriptionHeader = PremiumSubscriptionHeader2;
|
|
function getHeaderBackground_60565(a0, a1) { // fn#60565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:3850, offset: 0x01706c15, size: 23 bytes, params: 3, frame: 2
|
|
return env0_19[a0][a1];
|
|
}
|
|
|
|
function getPremiumImage(a0, a1) { // fn#60566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:3899, offset: 0x01706c2c, size: 23 bytes, params: 3, frame: 2
|
|
return env0_20[a0][a1];
|
|
}
|
|
|
|
function getPremiumImageStyle(a0, a1) { // fn#60567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:3944, offset: 0x01706c43, size: 23 bytes, params: 3, frame: 2
|
|
return env0_21[a0][a1];
|
|
}
|
|
|
|
function getLogo_60568(a0, a1) { // fn#60568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:3994, offset: 0x01706c5a, size: 23 bytes, params: 3, frame: 2
|
|
return env0_22[a0][a1];
|
|
}
|
|
|
|
function getLogoStyle(a0) { // fn#60569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4031, offset: 0x01706c71, size: 16 bytes, params: 2, frame: 2
|
|
return env0_23[a0];
|
|
}
|
|
|
|
function getPlanDescriptionStyle(a0) { // fn#60570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4068, offset: 0x01706c81, size: 16 bytes, params: 2, frame: 2
|
|
return env0_24[a0];
|
|
}
|
|
|
|
function _handleCancelSubscription() { // fn#60572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4207, offset: 0x01706c91, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun60574).apply(this, arguments);
|
|
function* _fun60574(a0, a1, a2) { // fn#60574, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4280, offset: 0x01706cca, size: 256 bytes, params: 4, frame: 20
|
|
var openURL;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var binding = env2_0;
|
|
var binding2 = env2_2;
|
|
var value3 = binding(binding2[44]);
|
|
var trackPremiumSubscriptionCancellationFlowStep = value3.trackPremiumSubscriptionCancellationFlowStep;
|
|
var STEP_ANALYTICS_NAMES = binding(binding2[44]).STEP_ANALYTICS_NAMES;
|
|
var CancellationFlowSteps = binding(binding2[44]).CancellationFlowSteps;
|
|
var MOBILE_SUBSCRIPTION_MANAGE = CancellationFlowSteps.MOBILE_SUBSCRIPTION_MANAGE;
|
|
Reflect.apply(trackPremiumSubscriptionCancellationFlowStep, value3, [{subscription: a0, analyticsLocations: a1,
|
|
fromStep: a2, toStep: STEP_ANALYTICS_NAMES[MOBILE_SUBSCRIPTION_MANAGE]}]);
|
|
if (a0 != null) {
|
|
if (a0.isPurchasedViaApple) {
|
|
value = env2_0(env2_2[45]);
|
|
yield value.manageSubscription();
|
|
value = undefined;
|
|
return undefined;
|
|
}
|
|
}
|
|
if (a0 != null && a0.isPurchasedViaGoogle) {
|
|
binding = env2_7;
|
|
openURL = binding.openURL;
|
|
value = env2_0(env2_2[11]);
|
|
Reflect.apply(openURL, binding, [value.getExternalSubscriptionMethodUrl(a0.paymentGateway,
|
|
'SUBSCRIPTION_MANAGEMENT')]);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function onCancelClick(a0, a1) { // fn#60575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4720, offset: 0x01706dca, size: 171 bytes, params: 3, frame: 19
|
|
var r0;
|
|
var defaultImport2;
|
|
var object;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
(PremiumAnalyticsUtilsModule).trackPremiumSubscriptionCancellationStarted(a0,
|
|
a1);
|
|
const defaultImport = PremiumUtils;
|
|
if (defaultImport.isBoostOnlySubscription(a0)) {
|
|
r0 = handleCancelSubscription(a0, a1);
|
|
} else {
|
|
defaultImport2 = importDefault(7533) /* metro dependency 7533: openPremiumPlanWhatYouLoseActionSheet */;
|
|
object = {subscription: a0};
|
|
object.mode = (require(7534) /* metro dependency 7534: PremiumPlanWhatYouLoseActionSheet */).WhatYouLoseMode.CANCEL;
|
|
object.onContinue = onContinue;
|
|
r0 = defaultImport2(object);
|
|
}
|
|
return r0;
|
|
function onContinue(a0) { // fn#60576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4952, owner: onCancelClick.onContinue, offset: 0x01706e75, size: 32 bytes, params: 2, frame: 15
|
|
return handleCancelSubscription(env0_0, require, a0);
|
|
}
|
|
|
|
}
|
|
|
|
function handleManageSubscription(a0, a1, a2) { // fn#60577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4989, offset: 0x01706e95, size: 178 bytes, params: 4, frame: 16
|
|
var openURL;
|
|
const status = a0.status;
|
|
var value;
|
|
const ACCOUNT_HOLD = SubscriptionStatusTypes.ACCOUNT_HOLD;
|
|
if (status === ACCOUNT_HOLD) {
|
|
openURL = Linking.openURL;
|
|
value = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
Reflect.apply(openURL, Linking, [value.getExternalSubscriptionMethodUrl(a0.paymentGateway,
|
|
'PAYMENT_SOURCE_MANAGEMENT')]);
|
|
} else {
|
|
(require(7026) /* metro dependency 7026: launchPremiumPlanSelect */).launchPremiumPlanSelect({navigation: a1,
|
|
analyticsLocation: {page: AnalyticsPages.USER_SETTINGS, section: AnalyticsSections.SETTINGS_PREMIUM},
|
|
analyticsLocations: a2});
|
|
}
|
|
}
|
|
|
|
function _onResubscribeClick() { // fn#60579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:5372, offset: 0x01706f65, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun60581).apply(this, arguments);
|
|
function* _fun60581(a0) { // fn#60581, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:5433, offset: 0x01706f9e, size: 151 bytes, params: 2, frame: 16
|
|
var binding;
|
|
var openURL;
|
|
let value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
if (a0.isPurchasedViaApple) {
|
|
value = environment.__proto__.__proto__;
|
|
value = env2_0(env2_2[45]);
|
|
yield value.manageSubscription();
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
} else if (a0.isPurchasedViaGoogle) {
|
|
value = environment.__proto__.__proto__;
|
|
binding = env2_7;
|
|
openURL = binding.openURL;
|
|
value = env2_0(env2_2[11]);
|
|
Reflect.apply(openURL, binding, [value.getExternalSubscriptionMethodUrl(a0.paymentGateway,
|
|
'SUBSCRIPTION_MANAGEMENT')]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function PremiumSubscriptionHeader({subscription, renewalInvoicePreview, onClickManagePremiumGuild, style}) { // fn#60582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:5651, offset: 0x01707035, size: 1752 bytes, params: 2, frame: 43
|
|
var r6;
|
|
var r1;
|
|
var r12;
|
|
var r18;
|
|
var r15;
|
|
var statusFromInvoice;
|
|
var property;
|
|
var defaultImport3;
|
|
var value6;
|
|
var defaultImport4;
|
|
var getPlanDescription;
|
|
var moduleValue5;
|
|
var value8;
|
|
var coercedPremiumGuildSubscriptionStatus;
|
|
var premiumGuildHeaderDescription;
|
|
var isAndroid2;
|
|
const Button = (ButtonNativeModule).Button;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var object2;
|
|
var object3;
|
|
const styles = useStyles();
|
|
const env0_1 = (UseNavigationNativeModule).useNavigation();
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
let object = [UserStore];
|
|
const currentUser = Reflect.apply(useStateFromStores, FluxModule, [object, _fun60583]);
|
|
const product = FluxModule.useStateFromStores([IAPStoreAndroid], _fun60584);
|
|
const planIdFromInvoice = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).getPlanIdFromInvoice(subscription,
|
|
renewalInvoicePreview);
|
|
const premiumBranding = (require(3802) /* metro dependency 3802: PremiumUtils */).getPremiumBranding(subscription);
|
|
const env0_2 = (UseAnalyticsLocations)().analyticsLocations;
|
|
const Branding = (require(3802) /* metro dependency 3802: PremiumUtils */).Branding;
|
|
const PREMIUM_GUILD = Branding.PREMIUM_GUILD;
|
|
if (premiumBranding === PREMIUM_GUILD) {
|
|
coercedPremiumGuildSubscriptionStatus = (require(3802) /* metro dependency 3802: PremiumUtils */).getCoercedPremiumGuildSubscriptionStatus(subscription);
|
|
premiumGuildHeaderDescription = (require(3802) /* metro dependency 3802: PremiumUtils */).getPremiumGuildHeaderDescription({subscription: subscription,
|
|
|
|
user: currentUser, price: product?.priceString, renewalInvoicePreview: renewalInvoicePreview});
|
|
r1 = coercedPremiumGuildSubscriptionStatus;
|
|
r12 = premiumGuildHeaderDescription;
|
|
} else {
|
|
statusFromInvoice = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).getStatusFromInvoice(subscription,
|
|
|
|
renewalInvoicePreview);
|
|
property = SubscriptionPlanInfo[planIdFromInvoice];
|
|
defaultImport3 = importDefault(44) /* metro dependency 44 */;
|
|
value6 = null;
|
|
defaultImport3(value6 != property, 'missing subscription planInfo');
|
|
defaultImport4 = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
|
getPlanDescription = defaultImport4.getPlanDescription;
|
|
object = {subscription: subscription, planId: planIdFromInvoice};
|
|
if (value6 != product) {
|
|
moduleValue5 = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
r6 = moduleValue5.formatRate(product.priceString, property.interval, property.intervalCount);
|
|
} else {
|
|
r6 = value6;
|
|
}
|
|
object.price = r6;
|
|
object.includePremiumGuilds = true;
|
|
value8 = Reflect.apply(getPlanDescription, defaultImport4, [object]);
|
|
r1 = statusFromInvoice;
|
|
r12 = value8;
|
|
}
|
|
const CANCELED = SubscriptionStatusTypes.CANCELED;
|
|
const value11 = r1 === CANCELED;
|
|
const ACTIVE = SubscriptionStatusTypes.ACTIVE;
|
|
const r21 = r1 === ACTIVE ? env0_18.ACTIVE : value11 ? env0_18.RESUB : env0_18.ERROR;
|
|
const r0 = value11 || !subscription.isOnPlatformMatchingExternalPaymentGateway;
|
|
if (r0) {
|
|
r18 = !r0;
|
|
} else {
|
|
isAndroid2 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
|
|
r18 = isAndroid2 ? subscription.renewalMutations == null : !isAndroid2;
|
|
}
|
|
const r14 = !value11 && subscription.isOnPlatformMatchingExternalPaymentGateway;
|
|
const items3 = [styles.container, style];
|
|
const imageBackgroundBindingProps = {source: getHeaderBackground_60565(premiumBranding, r21), style: styles.header};
|
|
const imageBindingProps = {source: getPremiumImage(premiumBranding, r21)};
|
|
const items2 = [getPremiumImageStyle(premiumBranding, r21)];
|
|
items2[1] = styles.wumpusImg;
|
|
imageBindingProps.style = items2;
|
|
const items4 = [
|
|
<View style={styles.logoContainer}>
|
|
<Image {...imageBindingProps} />
|
|
<Image source={getLogo_60568(premiumBranding, r21)} style={getLogoStyle(premiumBranding)} />
|
|
</View>,
|
|
];
|
|
const LegacyText = (NativeModule).LegacyText;
|
|
items4[1] = (
|
|
<LegacyText style={getPlanDescriptionStyle(r21)}>
|
|
{r12}
|
|
</LegacyText>
|
|
);
|
|
const items5 = [
|
|
value11 && subscription != null && subscription.isOnPlatformMatchingExternalPaymentGateway
|
|
? (
|
|
<View style={styles.buttonWrapper}>
|
|
<Button
|
|
onPress={function() {
|
|
return onResubscribeClick(subscription);
|
|
}}
|
|
variant="primary-overlay"
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lTCb0c)}
|
|
/>
|
|
</View>
|
|
)
|
|
: null,
|
|
];
|
|
if (r18) {
|
|
r15 = (
|
|
<View style={styles.buttonWrapper}>
|
|
<Button
|
|
onPress={onPress_60586}
|
|
variant="primary-overlay"
|
|
text={subscription.status === SubscriptionStatusTypes.ACCOUNT_HOLD ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.SgX7Ra) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.gmVtgF)}
|
|
size="sm"
|
|
/>
|
|
</View>
|
|
);
|
|
} else {
|
|
r15 = null;
|
|
}
|
|
items5[1] = r15;
|
|
const premiumUtilsModule = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
if (premiumUtilsModule.subscriptionHasPremiumGuildPlan(subscription)) {
|
|
if (onClickManagePremiumGuild != null) {
|
|
r15 = (
|
|
<View style={styles.buttonWrapper}>
|
|
<Button
|
|
onPress={onClickManagePremiumGuild}
|
|
variant="primary-overlay"
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.gIVkjm)}
|
|
size="sm"
|
|
/>
|
|
</View>
|
|
);
|
|
} else {
|
|
r15 = null;
|
|
}
|
|
} else {
|
|
r15 = null;
|
|
}
|
|
items5[2] = r15;
|
|
items5[3] = (
|
|
r14
|
|
? ((Text) => <Text accessibilityRole="link" style={styles.cancelLink} onPress={function() {
|
|
return onCancelClick(subscription, analyticsLocations);
|
|
}} variant="text-sm/medium" color="always-white">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC'])}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)
|
|
: null
|
|
);
|
|
items4[2] = (
|
|
<View style={styles.buttonContainer}>
|
|
{items5}
|
|
</View>
|
|
);
|
|
return (
|
|
<View style={items3}>
|
|
<ImageBackground {...imageBackgroundBindingProps}>
|
|
{items4}
|
|
</ImageBackground>
|
|
</View>
|
|
);
|
|
function _fun60583() { // fn#60583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:5840, offset: 0x0170770d, size: 58 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
(Module00044)(currentUser != null,
|
|
'PremiumSubscriptionHeader: currentUser cannot be undefined');
|
|
return currentUser;
|
|
}
|
|
|
|
function _fun60584() { // fn#60584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:5996, offset: 0x01707747, size: 118 bytes, params: 1, frame: 11
|
|
var paymentGatewayPlanId;
|
|
var value2;
|
|
var iapStoreAndroidBinding;
|
|
var getProduct;
|
|
if (subscription.isOnPlatformMatchingExternalPaymentGateway) {
|
|
paymentGatewayPlanId = subscription.paymentGatewayPlanId;
|
|
if (paymentGatewayPlanId == null) {
|
|
throw new global.Error('Subscription missing plan ID');
|
|
}
|
|
paymentGatewayPlanId = subscription.paymentGatewayPlanId;
|
|
if (paymentGatewayPlanId === '') {
|
|
throw new global.Error('Subscription missing plan ID');
|
|
}
|
|
value2 = environment.__proto__;
|
|
iapStoreAndroidBinding = IAPStoreAndroid;
|
|
getProduct = iapStoreAndroidBinding.getProduct;
|
|
paymentGatewayPlanId = subscription.paymentGatewayPlanId;
|
|
return Reflect.apply(getProduct, iapStoreAndroidBinding, [paymentGatewayPlanId]);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function PremiumSubscriptionHeaderOnPress_60586() { // fn#60586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:7700, owner: PremiumSubscriptionHeader.onPress, offset: 0x017077d4, size: 33 bytes, params: 1, frame: 15
|
|
handleManageSubscription(subscription, env0_1, analyticsLocations);
|
|
}
|
|
|
|
}
|
|
|
|
function PremiumSubscriptionDetails({style, onClickManagePremiumGuild, subscription}) { // fn#60588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:8313, offset: 0x01707811, size: 606 bytes, params: 2, frame: 29
|
|
var r8;
|
|
var r0;
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
const t = (IndexNativeModule).t;
|
|
var items2;
|
|
const styles = useStyles();
|
|
const analyticsLocations = (UseAnalyticsLocations)().analyticsLocations;
|
|
const useFetchSubscriptionInvoicePreview = PremiumSubscriptionInvoiceModule.useFetchSubscriptionInvoicePreview;
|
|
let object = {};
|
|
object.subscriptionId = subscription.id;
|
|
object.renewal = true;
|
|
object.analyticsLocations = analyticsLocations;
|
|
const PREMIUM_SUBSCRIPTION_DETAILS = (AnalyticsLocation).PREMIUM_SUBSCRIPTION_DETAILS;
|
|
object.analyticsLocation = PREMIUM_SUBSCRIPTION_DETAILS;
|
|
const property = Module00057(Reflect.apply(useFetchSubscriptionInvoicePreview, PremiumSubscriptionInvoiceModule,
|
|
[object]), 1)[0];
|
|
if (property == null) {
|
|
r0 = null;
|
|
} else {
|
|
object = {style: style};
|
|
string = intl.string;
|
|
items2 = [
|
|
<Text
|
|
style={styles.title}
|
|
accessibilityRole="header"
|
|
variant="eyebrow"
|
|
color="text-default"
|
|
>
|
|
{Reflect.apply(string, intl, [t.ITurwY])}
|
|
</Text>,
|
|
];
|
|
r8 = subscription.renewalMutations != null && subscription.status !== SubscriptionStatusTypes.CANCELED;
|
|
r8 = r8 && ((Component) => <Component subscription={subscription} renewalMutations={subscription.renewalMutations} />)(importDefault(7546) /* metro dependency 7546: SubscriptionRenewalMutationsNotice */);
|
|
items2[1] = r8;
|
|
r8 = subscription.status === SubscriptionStatusTypes.ACCOUNT_HOLD && ((Component) => <Component subscription={subscription} />)(importDefault(7547) /* metro dependency 7547: SubscriptionAccountHoldNotice */);
|
|
items2[2] = r8;
|
|
items2[3] = (
|
|
<PremiumSubscriptionHeader
|
|
subscription={subscription}
|
|
renewalInvoicePreview={property}
|
|
onClickManagePremiumGuild={onClickManagePremiumGuild}
|
|
/>
|
|
);
|
|
string = intl.string;
|
|
items2[4] = (
|
|
<Text style={styles.desktopSubtext} variant="text-sm/medium">
|
|
{Reflect.apply(string, intl, [t['MTG+3O']])}
|
|
</Text>
|
|
);
|
|
r0 = (
|
|
<View {...object}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun60564, 7509, [57, 5, 31, 27, 1878, 5140, 661, 1880, 33, 697, 4501, 3802, 7305, 7510, 7511, 7302,
|
|
7303, 7304, 7306, 7512, 7513, 7514, 7250, 7515, 7516, 7517, 7518, 7519, 7307, 7520, 7521, 7522, 7523, 7524,
|
|
7525, 7526, 7310, 7527, 7528, 7529, 7312, 7530, 7531, 7532, 7294, 7355, 7533, 7534, 7026, 1484, 566, 44, 6771,
|
|
5137, 477, 1305, 4578, 1244, 4573, 7545, 6789, 7546, 7547,
|
|
2]) /* metro module 7509, dependencies: [57, 5, 31, 27, 1878, 5140, 661, 1880, 33, 697, 4501, 3802, 7305, 7510, 7511, 7302, 7303, 7304, 7306, 7512, 7513, 7514, 7250, 7515, 7516, 7517, 7518, 7519, 7307, 7520, 7521, 7522, 7523, 7524, 7525, 7526, 7310, 7527, 7528, 7529, 7312, 7530, 7531, 7532, 7294, 7355, 7533, 7534, 7026, 1484, 566, 44, 6771, 5137, 477, 1305, 4578, 1244, 4573, 7545, 6789, 7546, 7547, 2] */;
|