107 lines
6.5 KiB
TypeScript
107 lines
6.5 KiB
TypeScript
/* Metro module 7549; source: components_native/premium/PremiumBillingInfo.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 697, 3815, 6766, 1244, 3802, 7545, 6771, 6789, 7022, 4573, 2] */
|
|
function _fun60690(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60690, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7727:6, offset: 0x0170a5ad, size: 351 bytes, params: 8, frame: 25
|
|
var object2;
|
|
const env0_0 = require;
|
|
const closure = GoogleManagementLink;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
importAll(31) /* metro dependency 31 */;
|
|
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
|
let value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_5 = value.SubscriptionStatusTypes;
|
|
const USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING = value.USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_6 = value.jsx;
|
|
const env0_7 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
object2.title = {paddingHorizontal: USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING};
|
|
object2.externalSubtext = {marginTop: 8, paddingHorizontal: USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING};
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object2.billingContainer = {'backgroundColor': null, 'padding': 16, 'marginTop': 8,
|
|
backgroundColor: BACKGROUND_SURFACE_HIGH};
|
|
object2.billingRenewalInfo = {marginTop: 4};
|
|
object2.billingManageGoogle = {marginTop: 8};
|
|
const env0_8 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/premium/PremiumBillingInfo.tsx');
|
|
exports.default = PremiumBillingInfo;
|
|
exports.GoogleManagementLink = closure;
|
|
}
|
|
|
|
function GoogleManagementLink({style, subscription}) { // fn#60691, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7727:511, offset: 0x0170a70c, size: 232 bytes, params: 2, frame: 22
|
|
var r0;
|
|
var TextWithIOSLinkWorkaround;
|
|
var intl;
|
|
var format;
|
|
var property;
|
|
var value;
|
|
if ((require(3815) /* metro dependency 3815: BillingPlatformUtils */).isGooglePlayBillingSupported()) {
|
|
if (subscription.isPurchasedViaGoogle) {
|
|
TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
|
|
var textWithIOSLinkWorkaroundProps = {'style': null, 'variant': 'text-sm/medium', 'color': 'text-link',
|
|
style: [style]};
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
format = intl.format;
|
|
property = (require(1244) /* metro dependency 1244: indexNative */).t['9NPc+O'];
|
|
value = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
value = <TextWithIOSLinkWorkaround {...textWithIOSLinkWorkaroundProps}>{Reflect.apply(format, intl,
|
|
[property,
|
|
{onClick: value.getExternalSubscriptionMethodUrl(subscription.paymentGateway,
|
|
'SUBSCRIPTION_MANAGEMENT')}])}</TextWithIOSLinkWorkaround>;
|
|
r0 = value;
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function PremiumBillingInfo({style, subscription}) { // fn#60692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7727:886, offset: 0x0170a7f4, size: 700 bytes, params: 2, frame: 32
|
|
const styles = useStyles();
|
|
const premiumSubscriptionInvoiceModule = require(7545) /* metro dependency 7545: PremiumSubscriptionInvoice */;
|
|
const useFetchSubscriptionInvoicePreview = premiumSubscriptionInvoiceModule.useFetchSubscriptionInvoicePreview;
|
|
const object2 = {'subscriptionId': null, 'renewal': true, 'applyEntitlements': true};
|
|
object2.subscriptionId = subscription.id;
|
|
object2.analyticsLocations = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)();
|
|
const PREMIUM_BILLING_INFO = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_BILLING_INFO;
|
|
object2.analyticsLocation = PREMIUM_BILLING_INFO;
|
|
const value2 = Reflect.apply(useFetchSubscriptionInvoicePreview, premiumSubscriptionInvoiceModule, [object2]);
|
|
const binding = env0_3;
|
|
const property = binding(value2, 1)[0];
|
|
const moduleValue2 = premiumSubscriptionInvoiceModule;
|
|
const useGetSubscriptionInvoice = moduleValue2.useGetSubscriptionInvoice;
|
|
const status = subscription.status;
|
|
const PAST_DUE = SubscriptionStatusTypes.PAST_DUE;
|
|
const property2 = binding(Reflect.apply(useGetSubscriptionInvoice, moduleValue2, [{subscriptionId: subscription.id,
|
|
preventFetch: status !== PAST_DUE}]), 1)[0];
|
|
if (property == null) {
|
|
return null;
|
|
}
|
|
const externalManagementMessage = (require(7022) /* metro dependency 7022: PremiumManagementUtils */).getExternalManagementMessage(subscription,
|
|
{shouldAllowExternalManagement: true});
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const Sb6wI1 = (require(1244) /* metro dependency 1244: indexNative */).t.Sb6wI1;
|
|
const items3 = [<Text style={styles.title} accessibilityRole="header" variant="eyebrow" color="text-default">{Reflect.apply(string,
|
|
intl, [Sb6wI1])}</Text>];
|
|
string = intl.string;
|
|
const KXQjfc = (require(1244) /* metro dependency 1244: indexNative */).t.KXQjfc;
|
|
const items2 = [<Text variant="text-md/semibold">{Reflect.apply(string, intl, [KXQjfc])}</Text>];
|
|
items2[1] = <Text style={styles.billingRenewalInfo} variant="text-sm/medium">{(require(3802) /* metro dependency 3802: PremiumUtils */).getBillingInformationString(subscription,
|
|
property, property2)}</Text>;
|
|
items2[2] = <GoogleManagementLink style={styles.billingManageGoogle} subscription={subscription} />;
|
|
items3[1] = <View style={styles.billingContainer}>{items2}</View>;
|
|
items3[2] = externalManagementMessage != null ? <Text style={styles.externalSubtext} variant="text-sm/medium">{externalManagementMessage}</Text> : null;
|
|
return (
|
|
<View style={style}>
|
|
{items3}
|
|
</View>
|
|
);
|
|
}
|
|
|