213 lines
12 KiB
TypeScript
213 lines
12 KiB
TypeScript
/* Metro module 11070; source: modules/stickers/native/premium/StickersPremiumUpsellAlert.tsx; dependencies: [31, 27, 5140, 661, 1880, 33, 11071, 1244, 697, 11072, 11073, 4501, 1305, 4573, 694, 7037, 7942, 1478, 6771, 4596, 683, 5080, 7028, 1962, 5278, 8160, 11074, 2] */
|
|
import UseWindowDimensionsNative from '../../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
|
|
import Alert from '../../../../components_native/common/Alert.tsx'; /* Metro dependency 4596 */
|
|
import IAPStoreAndroid from '../../../../stores/native/IAPStore.android.tsx'; /* Metro dependency 5140 */
|
|
import UseAnalyticsLocations from '../../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import BillingActionCreators from '../../../../actions/native/BillingActionCreators.tsx'; /* Metro dependency 7037 */
|
|
import UsePremiumPlanPrice from '../../../premium/native/hooks/usePremiumPlanPrice.tsx'; /* Metro dependency 7942 */
|
|
import Module08160 from '../../../../by-id/module-08160.js'; /* Metro dependency 8160 */
|
|
import Module11074 from '../../../../by-id/module-11074.js'; /* Metro dependency 11074 */
|
|
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 NativeModule from '../../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as PressablesModule from '../../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
|
|
|
|
function _fun84760(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11256:6, offset: 0x01f564d5, size: 742 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_4 = value.View;
|
|
const env0_5 = value.Image;
|
|
const env0_6 = value.ScrollView;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_8 = value.AnalyticEvents;
|
|
const env0_9 = value.AnalyticsSections;
|
|
const env0_10 = value.AnalyticsObjects;
|
|
value = require(1880) /* metro dependency 1880: PremiumConstants */;
|
|
const env0_11 = value.SubscriptionPlans;
|
|
const env0_12 = value.NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_13 = value.jsx;
|
|
const env0_14 = value.jsxs;
|
|
object = {icon: importDefault(11071) /* metro dependency 11071 */, description: function() {
|
|
return require(dependencyMap[7]).intl.string(require(dependencyMap[7]).t.uAfKTe);
|
|
}};
|
|
const PREMIUM_PERK_PURPLE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PREMIUM_PERK_PURPLE;
|
|
object.color = PREMIUM_PERK_PURPLE;
|
|
const items2 = [object];
|
|
items2[1] = {icon: importDefault(11072) /* metro dependency 11072 */, description: function() {
|
|
return require(dependencyMap[7]).intl.formatToPlainString(require(dependencyMap[7]).t.aVSVBO,
|
|
{numFreeGuildSubscriptions: NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM});
|
|
}};
|
|
object = {icon: importDefault(11073) /* metro dependency 11073 */, description: function() {
|
|
return require(dependencyMap[7]).intl.string(require(dependencyMap[7]).t.pqHIf7);
|
|
}};
|
|
const PREMIUM_PERK_GREEN = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PREMIUM_PERK_GREEN;
|
|
object.color = PREMIUM_PERK_GREEN;
|
|
items2[2] = object;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {};
|
|
object.alert = {paddingTop: 18};
|
|
object.shortHeightAlert = {height: 500};
|
|
object.content = {alignItems: 'center'};
|
|
object.closeContainer = {'flexDirection': 'row-reverse', 'width': '100%', 'marginBottom': 16};
|
|
object.description = {'textAlign': 'center', 'lineHeight': 20};
|
|
const object4 = {'backgroundColor': null, 'borderRadius': null, 'marginTop': 16, 'marginBottom': 0,
|
|
'paddingHorizontal': 12, 'paddingVertical': 8, 'width': '100%'};
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object4.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object.perks = object4;
|
|
const PRIMARY_560 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_560;
|
|
object.perkRow = {'paddingVertical': 10, 'borderBottomColor': null, 'borderBottomWidth': 1, 'flexDirection': 'row',
|
|
'alignItems': 'center', borderBottomColor: PRIMARY_560};
|
|
object.lastPerkRow = {borderBottomWidth: 0};
|
|
object.perkIcon = {'width': 24, 'marginRight': 20};
|
|
object.perkText = {'lineHeight': 20, 'flexShrink': 1};
|
|
object.imageHeader = {marginBottom: 12};
|
|
const env0_16 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/stickers/native/premium/StickersPremiumUpsellAlert.tsx');
|
|
exports.default = _default_84765;
|
|
function PerkRow({perk, isLastPerk}) { // fn#84764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11256:1378, offset: 0x01f56887, size: 238 bytes, params: 2, frame: 22
|
|
const styles = useStyles();
|
|
const items2 = [styles.perkRow];
|
|
items2[1] = isLastPerk ? styles.lastPerkRow : undefined;
|
|
const Icon = (NativeModule).Icon;
|
|
const icon = (
|
|
<Icon
|
|
style={styles.perkIcon}
|
|
source={perk.icon}
|
|
disableColor={perk.color == null}
|
|
color={perk.color}
|
|
/>
|
|
);
|
|
const Text = (TextModule).Text;
|
|
return (
|
|
<View style={items2}>
|
|
{icon}
|
|
<Text
|
|
style={styles.perkText}
|
|
variant="text-md/medium"
|
|
color="interactive-text-active"
|
|
>
|
|
{perk.description()}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _default_84765({onClose, analyticsLocation}) { // fn#84765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11256:1699, offset: 0x01f56975, size: 814 bytes, params: 2, frame: 33
|
|
const styles = useStyles();
|
|
ReactModule.useEffect(_fun84766, []);
|
|
const defaultImport = UsePremiumPlanPrice;
|
|
const PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
|
|
const priceString = defaultImport(PREMIUM_MONTH_TIER_2)?.priceString;
|
|
const height = (UseWindowDimensionsNative)().height;
|
|
const env0_1 = (UseAnalyticsLocations)().analyticsLocations;
|
|
const object = {};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object.cancelText = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.f3Pet9);
|
|
const ButtonColors = (NativeModule).ButtonColors;
|
|
const GREEN = ButtonColors.GREEN;
|
|
object.confirmColor = GREEN;
|
|
object.confirmText = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.o3Tnif);
|
|
object.onConfirm = onConfirm_84768;
|
|
object.onClose = onClose;
|
|
object.onCancel = onClose;
|
|
object.style = [styles.alert, height <= 580 ? styles.shortHeightAlert : null];
|
|
const PressableOpacity = (PressablesModule).PressableOpacity;
|
|
const Icon = (NativeModule).Icon;
|
|
const view = (
|
|
<View style={styles.closeContainer}>
|
|
<PressableOpacity
|
|
accessibilityRole="button"
|
|
accessibilityLabel="close"
|
|
onPress={onClose}
|
|
>
|
|
<Icon source={Module08160} />
|
|
</PressableOpacity>
|
|
</View>
|
|
);
|
|
const items3 = [
|
|
<Image source={Module11074} style={styles.imageHeader} />,
|
|
];
|
|
const Text = (TextModule).Text;
|
|
const format = intl.format;
|
|
const TBsJfQ = (require(1244) /* metro dependency 1244: indexNative */).t.TBsJfQ;
|
|
items3[1] = (
|
|
<Text style={styles.description} variant="text-md/medium">
|
|
{Reflect.apply(format, intl, [TBsJfQ, {monthlyPrice: priceString ?? '$...'}])}
|
|
</Text>
|
|
);
|
|
items3[2] = (
|
|
<View style={styles.perks}>
|
|
{env0_15.map(_fun84770)}
|
|
</View>
|
|
);
|
|
return (
|
|
<Alert {...object}>
|
|
{view}
|
|
<ScrollView>
|
|
<View style={styles.content} onStartShouldSetResponder={function() {
|
|
return true;
|
|
}}>
|
|
{items3}
|
|
</View>
|
|
</ScrollView>
|
|
</Alert>
|
|
);
|
|
function _fun84766() { // fn#84766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11256:1758, offset: 0x01f56ca3, size: 66 bytes, params: 1, frame: 11
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
const iapStoreAndroidBinding = IAPStoreAndroid;
|
|
if (!iapStoreAndroidBinding.isReady()) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(_fun84767);
|
|
}
|
|
function _fun84767() { // fn#84767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11256:1791, offset: 0x01f56ce5, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__.__proto__;
|
|
return (BillingActionCreators).loadProducts();
|
|
}
|
|
|
|
}
|
|
|
|
function _default_84765OnConfirm() { // fn#84768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11256:2118, owner: _default_84765.onConfirm, offset: 0x01f56d0a, size: 177 bytes, params: 1, frame: 21
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(dependencyMap[20]);
|
|
const track = defaultImport.track;
|
|
const PREMIUM_PROMOTION_OPENED = AnalyticEvents.PREMIUM_PROMOTION_OPENED;
|
|
const object2 = {};
|
|
copyDataProperties(object2, analyticsLocation, undefined);
|
|
const STICKER_PREMIUM_TIER_2_UPSELL_MODAL = AnalyticsSections.STICKER_PREMIUM_TIER_2_UPSELL_MODAL;
|
|
object2['section'] = STICKER_PREMIUM_TIER_2_UPSELL_MODAL;
|
|
const BUTTON_CTA = AnalyticsObjects.BUTTON_CTA;
|
|
object2['object'] = BUTTON_CTA;
|
|
Reflect.apply(track, defaultImport, [PREMIUM_PROMOTION_OPENED, {location: object2}]);
|
|
const defaultImport2 = importDefault(dependencyMap[21]);
|
|
const pushLazy = defaultImport2.pushLazy;
|
|
value = require(dependencyMap[23]);
|
|
value = value(dependencyMap[22], dependencyMap.paths);
|
|
Reflect.apply(pushLazy, defaultImport2, [value, {analyticsLocations: analyticsLocations}]);
|
|
}
|
|
|
|
function _fun84770(a0, a1) { // fn#84770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11256:2872, offset: 0x01f56dbb, size: 60 bytes, params: 3, frame: 16
|
|
return (
|
|
<PerkRow
|
|
perk={a0}
|
|
isLastPerk={a1 === env1_15.length - 1}
|
|
key={a1}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun84760, 11070, [31, 27, 5140, 661, 1880, 33, 11071, 1244, 697, 11072, 11073, 4501, 1305, 4573, 694,
|
|
7037, 7942, 1478, 6771, 4596, 683, 5080, 7028, 1962, 5278, 8160, 11074,
|
|
2]) /* metro module 11070, dependencies: [31, 27, 5140, 661, 1880, 33, 11071, 1244, 697, 11072, 11073, 4501, 1305, 4573, 694, 7037, 7942, 1478, 6771, 4596, 683, 5080, 7028, 1962, 5278, 8160, 11074, 2] */;
|