264 lines
17 KiB
TypeScript
264 lines
17 KiB
TypeScript
/* Metro module 10135; source: modules/virtual_currency/native/BalanceWidgetActionSheet.tsx; dependencies: [31, 27, 661, 1376, 33, 10136, 10137, 10138, 1244, 3847, 1948, 3875, 3860, 697, 683, 3968, 1365, 3868, 6275, 5475, 9543, 6515, 10139, 10076, 4573, 4578, 4501, 477, 2] */
|
|
import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as Dismissible_contentModule from '../../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/dismissible_content.tsx'; /* Metro dependency 1365 */
|
|
import * as DismissibleContentConstantsModule from '../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */
|
|
import * as UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
|
|
import * as NativeModule from '../../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */
|
|
import * as AccessibilityPreferencesContextModule from '../../../external/discord_common/js/packages/design/components/AccessibilityPreferencesContext/AccessibilityPreferencesContext.tsx'; /* Metro dependency 3875 */
|
|
import * as DismissibleContentUnsafeUtilsModule from '../../dismissible_content/DismissibleContentUnsafeUtils.tsx'; /* Metro dependency 3968 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
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 BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
|
|
import * as ActionSheetHeaderBarNativeModule from '../../../design/components/Sheet/native/ActionSheetHeaderBar.native.tsx'; /* Metro dependency 6515 */
|
|
import * as OrbsIconModule from '../../../design/components/Icon/native/redesign/generated/OrbsIcon.tsx'; /* Metro dependency 10076 */
|
|
import * as CircleQuestionIconModule from '../../../design/components/Icon/native/redesign/generated/CircleQuestionIcon.tsx'; /* Metro dependency 10139 */
|
|
|
|
function _fun79061(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10321:6, offset: 0x01e42f5a, size: 279 bytes, params: 8, frame: 18
|
|
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.TouchableOpacity;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_6 = value.AnalyticEvents;
|
|
const env0_7 = value.Fonts;
|
|
const env0_8 = value.HelpdeskArticles;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
const env0_12 = (CreateStylesModule).createStyles(_fun79062);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/virtual_currency/native/BalanceWidgetActionSheet.tsx');
|
|
exports.default = _default_79063;
|
|
function _fun79062(a0) { // fn#79062, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10321:293, offset: 0x01e43071, size: 676 bytes, params: 2, frame: 19
|
|
const object = {};
|
|
const object2 = {'flex': 1, 'flexDirection': 'column', 'gap': null, 'minWidth': '100%'};
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object2.gap = PX_12;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object2.paddingTop = PX_12;
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.paddingHorizontal = PX_16;
|
|
object.actions = object2;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.balanceHeader = {'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'center', 'gap': null,
|
|
'flexWrap': 'wrap', gap: PX_8};
|
|
const object4 = {color: a0};
|
|
const value2 = 36;
|
|
object4.fontSize = value2;
|
|
object4.lineHeight = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? value2 : 44;
|
|
object4.textAlignVertical = 'center';
|
|
object.balanceText = object4;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.content = {'width': '100%', 'height': '100%', 'alignItems': 'center', 'flex': 1, marginBottom: PX_16};
|
|
const object6 = {'width': '100%', 'paddingTop': null, 'paddingBottom': null, 'alignItems': 'center',
|
|
'position': 'relative', 'flexDirection': 'column'};
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object6.paddingTop = PX_12;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object6.paddingBottom = PX_16;
|
|
object.header = object6;
|
|
const object7 = {'width': 32, 'height': 32, 'backgroundColor': null, 'borderRadius': null,
|
|
'justifyContent': 'center', 'alignItems': 'center'};
|
|
const REDESIGN_BUTTON_TERTIARY_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_BUTTON_TERTIARY_BACKGROUND;
|
|
object7.backgroundColor = REDESIGN_BUTTON_TERTIARY_BACKGROUND;
|
|
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
object.infoIconBackground = object7;
|
|
const object8 = {position: 'absolute'};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object8.left = PX_16;
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object8.top = PX_16;
|
|
object8.zIndex = 10;
|
|
object.infoIconContainer = object8;
|
|
const object9 = {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'borderRadius': null, 'bottom': -100};
|
|
object9.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl;
|
|
object.promotionalBackground = object9;
|
|
object.promotionalBackgroundContainer = {'flex': 1, 'height': 428};
|
|
object.promotionalBannerAsset = {'width': '100%', 'height': '100%'};
|
|
const object10 = {'width': '100%', 'height': 144};
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object10.gap = PX_12;
|
|
const PX_64 = (importDefault(697) /* metro dependency 697: native */).space.PX_64;
|
|
object10.marginBottom = PX_64;
|
|
object.promotionalBannerContainer = object10;
|
|
const PRIMARY_BOLD = Fonts.PRIMARY_BOLD;
|
|
object.promotionalBannerText = {'color': null, 'fontFamily': null, 'fontWeight': '600', 'fontSize': 16,
|
|
'lineHeight': 20, 'textAlign': 'center', color: a0, fontFamily: PRIMARY_BOLD};
|
|
return object;
|
|
}
|
|
|
|
function _default_79063({balance, themeOverride, primaryButtonConfig, secondaryButtonConfig, source}) { // fn#79063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10321:1662, offset: 0x01e43315, size: 1565 bytes, params: 2, frame: 42
|
|
const Text = (TextModule).Text;
|
|
var r18;
|
|
var items4;
|
|
const value2 = ReactModule.useRef(null);
|
|
const value3 = ReactModule.useCallback(function() {
|
|
importDefault(dependencyMap[9])(importDefault(dependencyMap[10]).getArticleURL(HelpdeskArticles.ORBS_FAQ));
|
|
}, []);
|
|
const useContext = ReactModule.useContext;
|
|
const AccessibilityPreferencesContext = (AccessibilityPreferencesContextModule).AccessibilityPreferencesContext;
|
|
const enabled = Reflect.apply(useContext, ReactModule, [AccessibilityPreferencesContext]).reducedMotion.enabled;
|
|
const value4 = ReactModule.useMemo(_fun79065, [balance]);
|
|
themeOverride = themeOverride === undefined && value4 != null ? 'dark' : themeOverride;
|
|
const useToken = UseTokenModule.useToken;
|
|
const MOBILE_TEXT_HEADING_PRIMARY = (Native).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
const value8 = Reflect.apply(useToken, UseTokenModule, [MOBILE_TEXT_HEADING_PRIMARY, themeOverride]);
|
|
const styles = useStyles(value8);
|
|
ReactModule.useEffect(_fun79066, []);
|
|
const ThemeContextProvider = (NativeModule).ThemeContextProvider;
|
|
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
|
|
const object2 = {ref: value2, startExpanded: true, handleComponent: handleComponent, handleDisabled: false};
|
|
const items3 = [styles.content];
|
|
let r10 = value4 != null && value4.backgroundVideo != null && value4.backgroundImage != null && styles.promotionalBackgroundContainer;
|
|
items3[1] = r10;
|
|
const items2 = [
|
|
value4 != null && value4.backgroundVideo != null && value4.backgroundImage != null && (enabled ? ((Component) => <Component source={{uri: value4.backgroundImage}} style={styles.promotionalBackground} resizeMode="cover" />)(importDefault(5475) /* metro dependency 5475: FastImage */) : ((VideoComponent) => <VideoComponent source={{uri: value4.backgroundVideo}} poster={value4.backgroundImage} style={styles.promotionalBackground} muted disableFocus pauseWhileAppInactive paused={enabled} posterResizeMode="cover" resizeMode="cover" preventsDisplaySleepDuringVideoPlayback={false} />)((require(9543) /* metro dependency 9543: Video */).VideoComponent)),
|
|
|
|
];
|
|
const ActionSheetHeaderBar = (ActionSheetHeaderBarNativeModule).ActionSheetHeaderBar;
|
|
items2[1] = <ActionSheetHeaderBar onPress={onPress_79068} />;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const B1oJtQ = (IndexNativeModule).t.B1oJtQ;
|
|
const CircleQuestionIcon = (CircleQuestionIconModule).CircleQuestionIcon;
|
|
const INTERACTIVE_TEXT_DEFAULT = (Native).colors.INTERACTIVE_TEXT_DEFAULT;
|
|
items2[2] = (
|
|
<View style={styles.infoIconContainer}>
|
|
<TouchableOpacity
|
|
onPress={value3}
|
|
accessibilityRole="link"
|
|
accessibilityLabel={Reflect.apply(string, intl, [B1oJtQ])}
|
|
>
|
|
<View style={styles.infoIconBackground}>
|
|
<CircleQuestionIcon size="sm" color={INTERACTIVE_TEXT_DEFAULT} />
|
|
</View>
|
|
</TouchableOpacity>
|
|
</View>
|
|
);
|
|
const OrbsIcon = (OrbsIconModule).OrbsIcon;
|
|
const orbsIcon = <OrbsIcon size="lg" color={value8} />;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const W4DfeF = (IndexNativeModule).t.W4DfeF;
|
|
items2[3] = (
|
|
<View style={styles.header}>
|
|
<View style={styles.balanceHeader}>
|
|
{orbsIcon}
|
|
<Text
|
|
variant="display-md"
|
|
style={styles.balanceText}
|
|
accessibilityLabel={Reflect.apply(formatToPlainString, intl, [W4DfeF, {orbAmount: balance ?? 0}])}
|
|
>
|
|
{balance ?? 0}
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
);
|
|
r10 = value4 != null && value4.bannerImage != null;
|
|
if (r10) {
|
|
var viewBinding3Props = {style: styles.promotionalBannerContainer};
|
|
items4 = [
|
|
((Component) => <Component source={{uri: value4.bannerImage}} style={styles.promotionalBannerAsset} resizeMode="contain" />)(importDefault(5475) /* metro dependency 5475: FastImage */),
|
|
|
|
|
|
];
|
|
r18 = value4.bannerText != null && value4.bannerText !== '';
|
|
r18 = r18 && <Text variant="heading-xl/medium" style={styles.promotionalBannerText}>{value4.bannerText}</Text>;
|
|
items4[1] = r18;
|
|
r10 = (
|
|
<View {...viewBinding3Props}>
|
|
{items4}
|
|
</View>
|
|
);
|
|
}
|
|
items2[4] = r10;
|
|
const Button = (ButtonNativeModule).Button;
|
|
items2[5] = (
|
|
<View style={styles.actions}>
|
|
<Button
|
|
text={primaryButtonConfig.buttonText}
|
|
variant="primary"
|
|
size="lg"
|
|
onPress={primaryButtonConfig.onButtonPress}
|
|
/>
|
|
<Button
|
|
text={secondaryButtonConfig.buttonText}
|
|
variant="tertiary"
|
|
size="lg"
|
|
onPress={secondaryButtonConfig.onButtonPress}
|
|
/>
|
|
</View>
|
|
);
|
|
return (
|
|
<ThemeContextProvider theme={themeOverride}>
|
|
<BottomSheet {...object2}>
|
|
<View style={items3}>
|
|
{items2}
|
|
</View>
|
|
</BottomSheet>
|
|
</ThemeContextProvider>
|
|
);
|
|
function _fun79065() { // fn#79065, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10321:1934, offset: 0x01e43973, size: 179 bytes, params: 1, frame: 16
|
|
var r0;
|
|
var object;
|
|
var intl;
|
|
var __proto__;
|
|
if ((balance ?? 0) > 4100) {
|
|
object = {};
|
|
__proto__ = environment.__proto__;
|
|
object.backgroundVideo = (require(10136) /* metro dependency 10136: balancePromotion_bg_animatedMp4 */).default;
|
|
object.backgroundImage = (require(10137) /* metro dependency 10137: balancePromotion_bg_staticPng */).default;
|
|
object.bannerImage = (require(10138) /* metro dependency 10138: balancePromotion_rewardsPng */).default;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object.bannerText = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.LaMEFL);
|
|
r0 = object;
|
|
} else {
|
|
r0 = __proto__;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun79066() { // fn#79066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10321:2249, offset: 0x01e43a26, size: 199 bytes, params: 1, frame: 18
|
|
var moduleValue2;
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const ORB_BALANCE_ACTION_SHEET_ACTION = AnalyticEvents.ORB_BALANCE_ACTION_SHEET_ACTION;
|
|
Reflect.apply(track, defaultImport, [ORB_BALANCE_ACTION_SHEET_ACTION, {type: 'VIEW', source: source,
|
|
balance: balance}]);
|
|
const UNSAFE_isDismissibleContentDismissed = DismissibleContentUnsafeUtilsModule.UNSAFE_isDismissibleContentDismissed;
|
|
const DismissibleContent = (Dismissible_contentModule).DismissibleContent;
|
|
const VIRTUAL_CURRENCY_MOBILE_ONBOARDING_PILL = DismissibleContent.VIRTUAL_CURRENCY_MOBILE_ONBOARDING_PILL;
|
|
if (!Reflect.apply(UNSAFE_isDismissibleContentDismissed, DismissibleContentUnsafeUtilsModule,
|
|
[VIRTUAL_CURRENCY_MOBILE_ONBOARDING_PILL])) {
|
|
moduleValue2 = DismissibleContentUnsafeUtilsModule;
|
|
moduleValue2.UNSAFE_markDismissibleContentAsDismissed(DismissibleContent.VIRTUAL_CURRENCY_MOBILE_ONBOARDING_PILL,
|
|
|
|
{dismissAction: ContentDismissActionType.AUTO_DISMISS});
|
|
}
|
|
}
|
|
|
|
function handleComponent() { // fn#79067, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10321:2722, owner: _default_79063.handleComponent, offset: 0x01e43aed, size: 23 bytes, params: 1, frame: 13
|
|
return <View />;
|
|
}
|
|
|
|
function _default_79063OnPress() { // fn#79068, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10321:3345, owner: _default_79063.onPress, offset: 0x01e43b04, size: 32 bytes, params: 1, frame: 9
|
|
const current = env0_2.current;
|
|
if (current != null) {
|
|
current.closeActionSheet();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun79061, 10135, [31, 27, 661, 1376, 33, 10136, 10137, 10138, 1244, 3847, 1948, 3875, 3860, 697, 683,
|
|
3968, 1365, 3868, 6275, 5475, 9543, 6515, 10139, 10076, 4573, 4578, 4501, 477,
|
|
2]) /* metro module 10135, dependencies: [31, 27, 661, 1376, 33, 10136, 10137, 10138, 1244, 3847, 1948, 3875, 3860, 697, 683, 3968, 1365, 3868, 6275, 5475, 9543, 6515, 10139, 10076, 4573, 4578, 4501, 477, 2] */;
|