312 lines
18 KiB
TypeScript
312 lines
18 KiB
TypeScript
/* Metro module 6790; source: modules/guild_onboarding/native/GuildOnboardingCompleted.tsx; dependencies: [31, 27, 4502, 1938, 1867, 1878, 6603, 33, 4501, 697, 1484, 566, 6736, 3868, 6791, 1423, 1852, 1360, 4017, 4504, 5475, 6618, 4573, 1244, 1305, 6792, 6819, 3738, 6822, 2] */
|
|
function _fun53451(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:6, offset: 0x0134b5bc, size: 747 bytes, params: 8, frame: 26
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const StyleSheet = value.StyleSheet;
|
|
const env0_4 = value.View;
|
|
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
|
|
const guildRoleStore = importDefault(1938) /* metro dependency 1938: GuildRoleStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const guildOnboardingPromptsStore = importDefault(6603) /* metro dependency 6603: GuildOnboardingPromptsStore */;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {screen: {'flex': 1, 'position': 'relative'}, container: {'backgroundColor': 'rgba(0, 0, 0, 0.5)',
|
|
'paddingHorizontal': 24, 'display': 'flex', 'justifyContent': 'center', 'flexGrow': 1}};
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object2.containerWithoutSplash = {backgroundColor: BACKGROUND_BASE_LOWEST};
|
|
object2.backgroundImage = {'position': 'absolute', 'width': '100%', 'height': '100%'};
|
|
object2.title = {};
|
|
object2.subtitle = {marginTop: 16};
|
|
const object3 = {'marginTop': 24, 'padding': 16, 'paddingBottom': 32};
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object3.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object2.card = object3;
|
|
object2.username = {marginTop: 16};
|
|
object2.rolesHeader = {marginTop: 8};
|
|
object2.roles = {'marginTop': 12, 'display': 'flex', 'flexDirection': 'row', 'flexWrap': 'wrap'};
|
|
object2.role = {marginRight: 8};
|
|
const object5 = {'paddingHorizontal': 8, 'height': 28, 'borderRadius': null, 'display': 'flex',
|
|
'justifyContent': 'center'};
|
|
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object5.borderWidth = StyleSheet.hairlineWidth;
|
|
let BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object5.borderColor = BORDER_SUBTLE;
|
|
object2.roleOverflow = object5;
|
|
const object6 = {'marginTop': 24, 'borderColor': null, 'borderWidth': 2, 'borderRadius': null, 'padding': 12,
|
|
'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center'};
|
|
BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object6.borderColor = BORDER_SUBTLE;
|
|
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object2.animation = object6;
|
|
object2.wave = {transform: [{translateX: 24}, {rotate: '5deg'}]};
|
|
object2.animationText = {'flexGrow': 1, 'marginLeft': 8};
|
|
const env0_12 = Reflect.apply(createStyles, value, [object2]);
|
|
object2 = {code: "function GuildOnboardingCompletedTsx1(){const{withSequence,withTiming,withDelay,ANIMATION_DURATION,Easing,useReducedMotion}=this.__closure;const opacity=withSequence(withTiming(0,{duration:0}),withDelay(ANIMATION_DURATION,withTiming(0.5,{duration:ANIMATION_DURATION})),withTiming(1,{duration:ANIMATION_DURATION,easing:Easing.out(Easing.ease)}));const scale=withSequence(withTiming(1,{duration:0}),withDelay(ANIMATION_DURATION,withTiming(1.5,{duration:ANIMATION_DURATION,easing:Easing.out(Easing.ease)})),withTiming(1,{duration:useReducedMotion?1:ANIMATION_DURATION,easing:Easing.out(Easing.ease)}));const rawRotation=withSequence(withTiming('0deg',{duration:0}),withDelay(ANIMATION_DURATION,withTiming('-2deg',{duration:ANIMATION_DURATION})),withTiming('-5deg',{duration:ANIMATION_DURATION}));return{opacity:opacity,transform:[{rotate:rawRotation},{scale:scale}]};}"};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_onboarding/native/GuildOnboardingCompleted.tsx');
|
|
exports.default = GuildOnboardingCompleted;
|
|
}
|
|
|
|
function GuildOnboardingCompleted({guildId, prompts, completeOnboarding, onClose}) { // fn#53452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:2290, offset: 0x0134b8a7, size: 2256 bytes, params: 2, frame: 49
|
|
var object7;
|
|
var r18;
|
|
var defaultImport;
|
|
var getGuildSplashURL;
|
|
var object4;
|
|
const styles = useStyles();
|
|
const env0_3 = styles;
|
|
const value3 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return GuildStore.getGuild(guildId);
|
|
});
|
|
const value4 = (importDefault(6736) /* metro dependency 6736: useGuildRoleMemberCounts */)(guildId);
|
|
const nativeModule = require(3868) /* metro dependency 3868: native */;
|
|
const useThemeContext = nativeModule.useThemeContext;
|
|
object7 = {backgroundColor: (require(6791) /* metro dependency 6791: useProfileThemeValuesNative */).useProfileThemeValues(Reflect.apply(useThemeContext,
|
|
nativeModule, []).theme)?.rolePillBackgroundColor};
|
|
if (guild != null) {
|
|
defaultImport = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
|
|
getGuildSplashURL = defaultImport.getGuildSplashURL;
|
|
object4 = {};
|
|
object4.id = guild.id;
|
|
object4.splash = guild.splash;
|
|
object4.size = 400 * (importDefault(1852) /* metro dependency 1852: getDevicePixelRatioNative */)();
|
|
r18 = Reflect.apply(getGuildSplashURL, defaultImport, [object4]);
|
|
} else {
|
|
r18 = null;
|
|
}
|
|
const env0_7 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([GuildOnboardingPromptsStore],
|
|
function() {
|
|
return GuildOnboardingPromptsStore.getOnboardingResponses(guildId);
|
|
}, [guildId]);
|
|
const value11 = prompts.map(function(a0) {
|
|
return a0.options;
|
|
}).flat().filter(_fun53457);
|
|
const binding = env0_3;
|
|
const {numSharedRoleMembers, allSelectedRoleIds} = binding.useMemo(_fun53458, [value4, value11]);
|
|
const value13 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([GuildRoleStore],
|
|
function() {
|
|
return GuildRoleStore.getManyRoles(guildId, allSelectedRoleIds);
|
|
}, [allSelectedRoleIds, guildId]);
|
|
binding.useLayoutEffect(_fun53462, [value3]);
|
|
binding.useEffect(function() {
|
|
global.setTimeout(_fun53465, 3600);
|
|
}, [completeOnboarding, onClose]);
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
|
|
const closure = GuildOnboardingCompletedB;
|
|
const object5 = {};
|
|
object5.withSequence = reanimatedRexportModule.withSequence;
|
|
object5.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
|
|
object5.withDelay = reanimatedRexportModule.withDelay;
|
|
object5.ANIMATION_DURATION = 400;
|
|
const Easing = reanimatedRexportModule.Easing;
|
|
object5.Easing = Easing;
|
|
object5.useReducedMotion = useReducedMotion;
|
|
closure.__closure = object5;
|
|
closure.__workletHash = 8282245217026;
|
|
closure.__initData = env0_13;
|
|
const value14 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
|
|
if (currentUser == null) {
|
|
return null;
|
|
}
|
|
if (guild == null) {
|
|
return null;
|
|
}
|
|
const value15 = value13.length - 3;
|
|
const r6 = r18 != null ? ((Component) => <Component source={{uri: r18}} style={styles.backgroundImage} />)(importDefault(5475) /* metro dependency 5475: FastImage */) : null;
|
|
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
|
|
const items10 = [styles.container];
|
|
items10[1] = r18 == null ? styles.containerWithoutSplash : null;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const value17 = 'always-white';
|
|
const r13 = r18 == null ? 'mobile-text-heading-primary' : value17;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const PFWIYe = (require(1244) /* metro dependency 1244: indexNative */).t.PFWIYe;
|
|
const items11 = [<Text style={styles.title} accessibilityRole="header" variant="heading-xxl/extrabold" color={r13}>{Reflect.apply(string,
|
|
intl, [PFWIYe])}</Text>];
|
|
items11[1] = <Text style={styles.subtitle} accessibilityRole="header" variant="text-md/medium" color={r18 == null ? 'text-muted' : value17}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.og4NNr)}</Text>;
|
|
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
|
|
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
|
|
const XXLARGE = AvatarSizes.XXLARGE;
|
|
const items12 = [<Avatar size={XXLARGE} user={currentUser} guildId={guildId} animate={false} />];
|
|
const object6 = {'style': null, 'variant': 'heading-xl/semibold', 'color': 'mobile-text-heading-primary'};
|
|
let username = styles.username;
|
|
object6.style = username;
|
|
username = currentUser.username;
|
|
items12[1] = <Text {...object6}>{username}</Text>;
|
|
items12[2] = numSharedRoleMembers > 0 ? <Text style={styles.rolesHeader} variant="text-sm/normal" color="text-muted">{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.l1Jc1n,
|
|
{numSharedRoleMembers: numSharedRoleMembers})}</Text> : null;
|
|
items12[3] = <View style={styles.roles}>{value13.slice(0,
|
|
3).map(_fun53468)}{value15 > 0 ? <View style={[styles.roleOverflow,
|
|
object7]}><Text variant="heading-deprecated-12/semibold" color="mobile-text-heading-primary">{'+' + value15}</Text></View> : null}</View>;
|
|
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
|
|
const items15 = [styles.animation, value14];
|
|
const GuildIcon = importDefault(6819) /* metro dependency 6819: GuildIcon */;
|
|
const GuildIconSizes = (require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes;
|
|
const LARGE = GuildIconSizes.LARGE;
|
|
const items16 = [<GuildIcon guild={guild} size={LARGE} />];
|
|
const format = intl.format;
|
|
const FXREhf = (require(1244) /* metro dependency 1244: indexNative */).t.FXREhf;
|
|
items16[1] = <View style={styles.animationText}><Text variant="text-sm/medium" color="mobile-text-heading-primary">{Reflect.apply(format,
|
|
intl, [FXREhf,
|
|
{guildName: guild.name}])}</Text><Text variant="text-xs/normal" color="text-muted">{'' + (importDefault(3738) /* metro dependency 3738 */)().format('LL')}</Text></View>;
|
|
items16[2] = ((Component) => <Component source={importDefault(6822) /* metro dependency 6822 */} style={styles.wave} />)(importDefault(5475) /* metro dependency 5475: FastImage */);
|
|
items12[4] = <View2 style={items15}>{items16}</View2>;
|
|
items11[2] = <View style={styles.card}>{items12}</View>;
|
|
return (
|
|
<View style={styles.screen}>
|
|
{r6}
|
|
<SafeAreaPaddingView bottom style={items10}>
|
|
<View>
|
|
{items11}
|
|
</View>
|
|
</SafeAreaPaddingView>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun53457({id}) { // fn#53457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:2882, offset: 0x0134c1bf, size: 27 bytes, params: 2, frame: 11
|
|
return env0_7.includes(id);
|
|
}
|
|
|
|
function _fun53458() { // fn#53458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:2917, offset: 0x0134c1da, size: 174 bytes, params: 1, frame: 18
|
|
var r2;
|
|
var Math;
|
|
var max;
|
|
var value6;
|
|
var items2;
|
|
const value3 = env0_8.map(function(a0) {
|
|
return a0.roleIds;
|
|
}).flat();
|
|
const value5 = value3.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
|
|
let value = 0;
|
|
if (env0_6 != null) {
|
|
if (value5.length > value) {
|
|
Math = global.Math;
|
|
max = Math.max;
|
|
value6 = value5.map(_fun53460);
|
|
items2 = [];
|
|
arraySpread(items2, value6, value, value);
|
|
value = apply(max, items2, Math, value);
|
|
r2 = value;
|
|
} else {
|
|
r2 = value;
|
|
}
|
|
} else {
|
|
r2 = value;
|
|
}
|
|
return {numSharedRoleMembers: r2, allSelectedRoleIds: value5};
|
|
}
|
|
|
|
function _fun53462() { // fn#53462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:3266, offset: 0x0134c2c6, size: 36 bytes, params: 1, frame: 12
|
|
env0_4.setOptions({headerLeft: function() {
|
|
return null;
|
|
}});
|
|
}
|
|
|
|
function _fun53464() { // fn#53464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:3327, offset: 0x0134c2ea, size: 31 bytes, params: 1, frame: 13
|
|
global.setTimeout(function() {
|
|
completeOnboarding();
|
|
onClose();
|
|
}, 3600);
|
|
}
|
|
|
|
function GuildOnboardingCompletedB() { // fn#53467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:3472, owner: GuildOnboardingCompleted.B, offset: 0x0134c32f, size: 649 bytes, params: 1, frame: 31
|
|
var object2;
|
|
let value = environment.__proto__;
|
|
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
let withSequence = reanimatedRexportModule.withSequence;
|
|
const timingModule = require(4504) /* metro dependency 4504: timing */;
|
|
let withTiming = timingModule.withTiming;
|
|
const value2 = Reflect.apply(withTiming, timingModule, [0, {duration: 0}]);
|
|
const moduleValue3 = reanimatedRexportModule;
|
|
let withDelay = moduleValue3.withDelay;
|
|
const moduleValue4 = timingModule;
|
|
withTiming = moduleValue4.withTiming;
|
|
const value3 = 400;
|
|
const value4 = Reflect.apply(withDelay, moduleValue3, [value3, Reflect.apply(withTiming, moduleValue4, [0.5,
|
|
{duration: value3}])]);
|
|
const moduleValue5 = timingModule;
|
|
withTiming = moduleValue5.withTiming;
|
|
object2 = {duration: value3};
|
|
const Easing = reanimatedRexportModule.Easing;
|
|
let out = Easing.out;
|
|
const Easing2 = reanimatedRexportModule.Easing;
|
|
object2.easing = Reflect.apply(out, Easing, [Easing2.ease]);
|
|
const value5 = 1;
|
|
const value6 = Reflect.apply(withSequence, reanimatedRexportModule, [value2, value4, Reflect.apply(withTiming,
|
|
moduleValue5, [value5, object2])]);
|
|
const moduleValue6 = reanimatedRexportModule;
|
|
withSequence = moduleValue6.withSequence;
|
|
const value7 = timingModule.withTiming(value5, {duration: 0});
|
|
const moduleValue8 = reanimatedRexportModule;
|
|
withDelay = moduleValue8.withDelay;
|
|
const moduleValue9 = timingModule;
|
|
withTiming = moduleValue9.withTiming;
|
|
object2 = {duration: value3};
|
|
out = Easing.out;
|
|
const Easing3 = reanimatedRexportModule.Easing;
|
|
object2.easing = Reflect.apply(out, Easing, [Easing3.ease]);
|
|
const value8 = Reflect.apply(withDelay, moduleValue8, [value3, Reflect.apply(withTiming, moduleValue9, [1.5,
|
|
object2])]);
|
|
const moduleValue10 = timingModule;
|
|
withTiming = moduleValue10.withTiming;
|
|
object2 = {};
|
|
object2.duration = useReducedMotion ? value5 : value3;
|
|
out = Easing.out;
|
|
const Easing4 = reanimatedRexportModule.Easing;
|
|
object2.easing = Reflect.apply(out, Easing, [Easing4.ease]);
|
|
value = Reflect.apply(withSequence, moduleValue6, [value7, value8, Reflect.apply(withTiming, moduleValue10, [value5,
|
|
object2])]);
|
|
object2 = {opacity: value6};
|
|
const moduleValue11 = reanimatedRexportModule;
|
|
withSequence = moduleValue11.withSequence;
|
|
const value10 = timingModule.withTiming('0deg', {duration: 0});
|
|
const moduleValue13 = reanimatedRexportModule;
|
|
withDelay = moduleValue13.withDelay;
|
|
const moduleValue14 = timingModule;
|
|
const value11 = Reflect.apply(withDelay, moduleValue13, [value3, moduleValue14.withTiming('-2deg',
|
|
{duration: value3})]);
|
|
const moduleValue15 = timingModule;
|
|
object2.transform = [{rotate: Reflect.apply(withSequence, moduleValue11, [value10, value11,
|
|
moduleValue15.withTiming('-5deg', {duration: value3})])}, {scale: value}];
|
|
return object2;
|
|
}
|
|
|
|
function _fun53468(a0) { // fn#53468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:5492, offset: 0x0134c5b8, size: 112 bytes, params: 2, frame: 19
|
|
const viewBindingProps = {style: styles.role};
|
|
const RoleItem = (require(6792) /* metro dependency 6792: UserProfileRolesCard */).RoleItem;
|
|
return (
|
|
<View {...viewBindingProps} key={a0.id}>
|
|
<RoleItem
|
|
role={a0}
|
|
guildId={guild.id}
|
|
disableInteraction
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun53460(a0) { // fn#53460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:3054, offset: 0x0134c288, size: 30 bytes, params: 2, frame: 3
|
|
const value = environment.__proto__;
|
|
return env1_6[a0] ?? 0;
|
|
}
|
|
|