246 lines
13 KiB
TypeScript
246 lines
13 KiB
TypeScript
/* Metro module 14325; source: modules/auth/native/components/RegisterDisplayName.tsx; dependencies: [5, 57, 31, 27, 13285, 14304, 14305, 33, 4501, 697, 1244, 8973, 1484, 14302, 14320, 14303, 676, 14319, 14322, 13286, 5277, 8986, 9001, 7981, 4578, 5467, 2] */
|
|
function _fun108411(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14522:6, offset: 0x0231f937, size: 416 bytes, params: 8, frame: 23
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_4 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_5 = importAll(31) /* metro dependency 31 */;
|
|
const env0_6 = (require(27) /* metro dependency 27 */).View;
|
|
const uniqueUsernamesStore = importDefault(13285) /* metro dependency 13285: UniqueUsernamesStore */;
|
|
let value = require(14304) /* metro dependency 14304: RegistrationUIStore */;
|
|
const env0_8 = value.updateRegistrationOptions;
|
|
const env0_9 = value.useRegistrationUIStore;
|
|
value = require(14305) /* metro dependency 14305: RegistrationConstants */;
|
|
const env0_10 = value.RegisterTransitionSteps;
|
|
const env0_11 = value.RegistrationTransitionActionTypes;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_12 = value.jsx;
|
|
const env0_13 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object2.globalName = {marginTop: PX_24};
|
|
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object2.button = {marginTop: PX_24};
|
|
object2.page = {flex: 1};
|
|
const env0_14 = Reflect.apply(createStyles, value, [object2]);
|
|
const env0_15 = ['discord', 'hypesquad', 'snowsgiving', 'system message', 'system mesage', 'sustem mesage',
|
|
'sustem message'];
|
|
const env0_16 = ['everyone', 'here'];
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/auth/native/components/RegisterDisplayName.tsx');
|
|
exports.default = _default_108412;
|
|
}
|
|
|
|
function _default_108412() { // fn#108412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14522:580, offset: 0x0231fad7, size: 1226 bytes, params: 1, frame: 32
|
|
var object2;
|
|
var r12;
|
|
var r14;
|
|
var r0;
|
|
var binding4;
|
|
var length;
|
|
var property3;
|
|
var toLowerCase;
|
|
var value10;
|
|
var value11;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var string;
|
|
var t;
|
|
var WeJZyy;
|
|
var value12;
|
|
var value;
|
|
const value2 = undefined;
|
|
const styles = useStyles();
|
|
const value3 = (importDefault(8973) /* metro dependency 8973: useWideAuthView */)();
|
|
const value4 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const binding = env0_5;
|
|
let useState = binding.useState;
|
|
const value5 = Reflect.apply(useState, binding, [false]);
|
|
const binding2 = env0_4;
|
|
const value6 = binding2(value5, 2);
|
|
const value7 = 0;
|
|
const property = value6[value7];
|
|
const env0_1 = value6[1];
|
|
const value8 = useRegistrationUIStore(function(a0) {
|
|
return a0.errors;
|
|
});
|
|
useState = binding.useState;
|
|
const value9 = binding2(Reflect.apply(useState, binding, [_fun108414]), 2);
|
|
const property2 = value9[value7];
|
|
const env0_3 = value9[1];
|
|
const binding3 = env0_16;
|
|
let includes = binding3.includes;
|
|
if (Reflect.apply(includes, binding3, [property2])) {
|
|
r14 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.WeJZyy);
|
|
} else {
|
|
binding4 = env0_15;
|
|
length = binding4.length;
|
|
if (value7 < length) {
|
|
r12 = value7;
|
|
loopExit2: while (true) {
|
|
property3 = binding4[r12];
|
|
toLowerCase = property2.toLowerCase;
|
|
value10 = Reflect.apply(toLowerCase, property2, []);
|
|
includes = value10.includes;
|
|
if (Reflect.apply(includes, value10, [property3])) {
|
|
string = intl.string;
|
|
t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
WeJZyy = t.WeJZyy;
|
|
value12 = Reflect.apply(string, intl, [WeJZyy]);
|
|
r14 = value12;
|
|
break loopExit2;
|
|
}
|
|
value11 = typeof r12 === 'bigint' ? r12 + 1n : +r12 + 1;
|
|
length = binding4.length;
|
|
if (value11 < length) {
|
|
r12 = value11;
|
|
continue;
|
|
}
|
|
r14 = value2;
|
|
break loopExit2;
|
|
}
|
|
} else {
|
|
r14 = value2;
|
|
}
|
|
}
|
|
const useContext = binding.useContext;
|
|
const TrackRegistrationContext = (require(14302) /* metro dependency 14302: Auth */).TrackRegistrationContext;
|
|
const value14 = Reflect.apply(useContext, binding, [TrackRegistrationContext]);
|
|
const defaultImport = importDefault(14320) /* metro dependency 14320: useAuthFlowBackHandler */;
|
|
const registrationStepsUtilsModule = require(14303) /* metro dependency 14303: RegistrationStepsUtils */;
|
|
const getPreviousRegistrationTransitionStep = registrationStepsUtilsModule.getPreviousRegistrationTransitionStep;
|
|
const AuthStates = (require(676) /* metro dependency 676: ConstantsIOS */).AuthStates;
|
|
let REGISTER_DISPLAY_NAME = AuthStates.REGISTER_DISPLAY_NAME;
|
|
defaultImport(Reflect.apply(getPreviousRegistrationTransitionStep, registrationStepsUtilsModule,
|
|
[REGISTER_DISPLAY_NAME]));
|
|
const defaultImport2 = importDefault(14319) /* metro dependency 14319: useInitialRegistrationStep */;
|
|
REGISTER_DISPLAY_NAME = AuthStates.REGISTER_DISPLAY_NAME;
|
|
defaultImport2(REGISTER_DISPLAY_NAME);
|
|
binding.useEffect(_fun108415, [value14]);
|
|
const value15 = binding.useRef(null);
|
|
(importDefault(14322) /* metro dependency 14322: useFocusRefOnNavigation */)({inputRef: value15});
|
|
binding.useLayoutEffect(_fun108420, [binding.useCallback(_fun108416(), [value4, value14]), value4]);
|
|
r12 = (importDefault(8986) /* metro dependency 8986: getError */)('global_name', value8) ?? r14;
|
|
const AuthFormView = importDefault(9001) /* metro dependency 9001: AuthFormView */;
|
|
object2 = {};
|
|
string = intl.string;
|
|
const LYIh7j = (require(1244) /* metro dependency 1244: indexNative */).t.LYIh7j;
|
|
object2.headerText = Reflect.apply(string, intl, [LYIh7j]);
|
|
const TextInput = (require(7981) /* metro dependency 7981: TextInputNative */).TextInput;
|
|
const textInputProps = {ref: value15, value: property2, onChange: onChange_108423, returnKeyType: 'next',
|
|
onSubmitEditing: onSubmitEditing_108424, textContentType: 'nickname', errorMessage: r12,
|
|
label: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['9AjdkD'])};
|
|
r12 = r12 == null ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.fbKwSs) : value2;
|
|
textInputProps.description = r12;
|
|
textInputProps.isClearable = true;
|
|
const view = <View style={styles.globalName}><TextInput {...textInputProps} /></View>;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
string = intl.string;
|
|
const PDTjLN = (require(1244) /* metro dependency 1244: indexNative */).t.PDTjLN;
|
|
const authFormView = <AuthFormView {...object2}>{view}<View style={styles.button}><Button size="lg" loading={property} text={Reflect.apply(string,
|
|
intl,
|
|
[PDTjLN])} onPress={onPress_108425} disabled={r14 != null || property2.trim() === ''} /></View></AuthFormView>;
|
|
if (value3) {
|
|
r0 = authFormView;
|
|
} else {
|
|
value = importDefault(5467) /* metro dependency 5467: KeyboardAwareView */;
|
|
value = ((Component) => <Component style={styles.page}>{authFormView}</Component>)(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun108414() { // fn#108414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14522:710, offset: 0x0231ffa1, size: 47 bytes, params: 1, frame: 10
|
|
const value = environment.__proto__;
|
|
const getState = useRegistrationUIStore.getState;
|
|
return Reflect.apply(getState, useRegistrationUIStore, []).registrationOptions.globalName ?? '';
|
|
}
|
|
|
|
function _fun108415() { // fn#108415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14522:1226, offset: 0x0231ffd0, size: 51 bytes, params: 1, frame: 12
|
|
const binding = env0_4;
|
|
const ACCOUNT_DISPLAY_NAME = RegisterTransitionSteps.ACCOUNT_DISPLAY_NAME;
|
|
const VIEWED = RegistrationTransitionActionTypes.VIEWED;
|
|
binding({step: ACCOUNT_DISPLAY_NAME, actionType: VIEWED});
|
|
}
|
|
|
|
function _fun108416() { // fn#108416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14522:1355, offset: 0x02320003, size: 36 bytes, params: 1, frame: 12
|
|
const env0_0 = env1_3(_fun108418);
|
|
return _fun108419;
|
|
}
|
|
|
|
function _fun108420() { // fn#108420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14522:1807, offset: 0x02320151, size: 38 bytes, params: 1, frame: 12
|
|
const binding = env0_0;
|
|
binding.setOptions({headerRight: headerRight_108421});
|
|
}
|
|
|
|
function _default_108412OnChange(a0) { // fn#108423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14522:2153, owner: _default_108412.onChange, offset: 0x023201f6, size: 40 bytes, params: 2, frame: 12
|
|
const value = a0;
|
|
const binding = env0_3;
|
|
const value3 = value.trim();
|
|
const value4 = '';
|
|
binding(value4 === value3 ? value4 : value);
|
|
}
|
|
|
|
function _default_108412OnSubmitEditing() { // fn#108424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14522:2217, owner: _default_108412.onSubmitEditing, offset: 0x0232021e, size: 20 bytes, params: 1, frame: 11
|
|
return env0_5(env0_2);
|
|
}
|
|
|
|
function* _fun108418(a0) { // fn#108418, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14522:1375, offset: 0x02320032, size: 287 bytes, params: 2, frame: 19
|
|
var binding2;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
var binding = env3_8;
|
|
binding({globalName: a0});
|
|
binding = env3_9;
|
|
var getState = binding.getState;
|
|
var registrationOptions = Reflect.apply(getState, binding, []).registrationOptions;
|
|
binding = env2_4;
|
|
var ACCOUNT_DISPLAY_NAME = env3_10.ACCOUNT_DISPLAY_NAME;
|
|
var SUBMITTED = env3_11.SUBMITTED;
|
|
binding({step: ACCOUNT_DISPLAY_NAME, actionType: SUBMITTED});
|
|
var username = registrationOptions.username;
|
|
if (!(username != null && registrationOptions.username !== '')) {
|
|
importDefault(true);
|
|
binding = env3_7;
|
|
if (binding.wasRegistrationSuggestionFetched(a0)) {
|
|
importDefault(false);
|
|
binding = env3_0;
|
|
binding2 = env3_2;
|
|
value = binding(binding2[15]);
|
|
value.handleNextOrSubmitRegistration(binding(binding2[16]).AuthStates.REGISTER_DISPLAY_NAME, require,
|
|
env2_4);
|
|
return undefined;
|
|
}
|
|
binding = env3_1;
|
|
var value6 = binding(env3_2[19]);
|
|
yield value6.fetchSuggestionsRegistration(a0);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
importDefault(false);
|
|
}
|
|
binding = env3_0;
|
|
binding2 = env3_2;
|
|
value = binding(binding2[15]);
|
|
value.handleNextOrSubmitRegistration(binding(binding2[16]).AuthStates.REGISTER_DISPLAY_NAME, require, env2_4);
|
|
}
|
|
}
|
|
|
|
function headerRight_108421() { // fn#108421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14522:1838, offset: 0x02320177, size: 109 bytes, params: 1, frame: 18
|
|
const HeaderActionButton = (require(5277) /* metro dependency 5277: HeaderActionButtonNative */).HeaderActionButton;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
return (
|
|
<HeaderActionButton
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5Wxrcd'])}
|
|
onPress={onPress_108422}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function headerRight_108421OnPress() { // fn#108422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14522:1929, owner: headerRight_108421.onPress, offset: 0x023201e4, size: 18 bytes, params: 1, frame: 11
|
|
return env2_5(null);
|
|
}
|
|
|