166 lines
11 KiB
TypeScript
166 lines
11 KiB
TypeScript
/* Metro module 14340; source: modules/auth/native/components/RegisterAgeGate.tsx; dependencies: [57, 31, 27, 5078, 14304, 14305, 661, 33, 4501, 697, 3738, 14341, 3868, 1484, 14302, 566, 8986, 14320, 14303, 44, 9001, 1244, 7682, 8554, 14342, 4578, 8970, 9068, 4002, 2] */
|
|
function _fun108525(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14537:6, offset: 0x02323f5e, size: 545 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(27) /* metro dependency 27 */).View;
|
|
const consentStore = importDefault(5078) /* metro dependency 5078: ConsentStore */;
|
|
let value = require(14304) /* metro dependency 14304: RegistrationUIStore */;
|
|
const env0_7 = value.updateRegistrationOptions;
|
|
const env0_8 = value.useRegistrationUIStore;
|
|
value = require(14305) /* metro dependency 14305: RegistrationConstants */;
|
|
const env0_9 = value.RegisterTransitionSteps;
|
|
const env0_10 = value.RegistrationTransitionActionTypes;
|
|
const env0_11 = (require(661) /* metro dependency 661: Constants */).AuthStates;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_12 = value.jsx;
|
|
const env0_13 = value.jsxs;
|
|
const env0_14 = value.Fragment;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
|
|
const env0_15 = Reflect.apply(createStyles, value, [{inputGroup: {'marginTop': 24, 'marginBottom': 24},
|
|
flexGrow: {flexGrow: 1}, button: {'flexGrow': 0, 'marginBottom': 4, 'marginTop': 16, 'flexDirection': 'column'},
|
|
datePickerButton: {color: INTERACTIVE_TEXT_DEFAULT}, page: {flex: 1}}]);
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value.utc();
|
|
const env0_17 = value.toDate();
|
|
const env0_18 = value.clone().endOf('year').toDate();
|
|
value = value.clone();
|
|
value = value.subtract(100, 'years');
|
|
const env0_19 = value.toDate();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/auth/native/components/RegisterAgeGate.tsx');
|
|
exports.default = RegisterAgeGate;
|
|
}
|
|
|
|
function RegisterAgeGate() { // fn#108526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14537:788, offset: 0x0232417f, size: 1593 bytes, params: 1, frame: 42
|
|
const value2 = undefined;
|
|
const styles = useStyles();
|
|
const nativeModule = require(3868) /* metro dependency 3868: native */;
|
|
const useThemeContext = nativeModule.useThemeContext;
|
|
const theme = Reflect.apply(useThemeContext, nativeModule, []).theme;
|
|
const env0_0 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const binding = env0_4;
|
|
const useContext = binding.useContext;
|
|
const TrackRegistrationContext = (require(14302) /* metro dependency 14302: Auth */).TrackRegistrationContext;
|
|
const value3 = Reflect.apply(useContext, binding, [TrackRegistrationContext]);
|
|
let useState = binding.useState;
|
|
let getState = useRegistrationUIStore.getState;
|
|
const birthday = Reflect.apply(getState, useRegistrationUIStore, []).registrationOptions.birthday;
|
|
const value4 = null;
|
|
const value5 = Reflect.apply(useState, binding,
|
|
[value4 != birthday && (importDefault(14341) /* metro dependency 14341: isDateValidDateOfBirth */)(birthday) ? birthday : value4]);
|
|
const binding2 = env0_3;
|
|
const value6 = binding2(value5, 2);
|
|
const property = value6[0];
|
|
var env0_3 = value6[1];
|
|
useState = binding.useState;
|
|
getState = useRegistrationUIStore.getState;
|
|
const consent = Reflect.apply(getState, useRegistrationUIStore, []).registrationOptions.consent;
|
|
const value8 = binding2(Reflect.apply(useState, binding, [value4 != consent && consent]), 2);
|
|
const property2 = value8[0];
|
|
var env0_4 = property2;
|
|
const env0_5 = value8[1];
|
|
const value9 = binding.useMemo(_fun108527, [property]);
|
|
useState = binding.useState;
|
|
const value10 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property3 = value10[0];
|
|
const env0_6 = value10[1];
|
|
const value11 = useRegistrationUIStore(function(a0) {
|
|
return a0.submitting;
|
|
});
|
|
const authenticationConsentRequired = (require(566) /* metro dependency 566: flux */).useStateFromStores([ConsentStore],
|
|
function() {
|
|
return ConsentStore.getAuthenticationConsentRequired();
|
|
});
|
|
const value12 = useRegistrationUIStore(function(a0) {
|
|
return a0.errors;
|
|
});
|
|
const value13 = (importDefault(8986) /* metro dependency 8986: getError */)('consent', value12);
|
|
const r22 = value4 != value13 ? value13 : value12.message;
|
|
const defaultImport2 = importDefault(14320) /* metro dependency 14320: useAuthFlowBackHandler */;
|
|
const registrationStepsUtilsModule = require(14303) /* metro dependency 14303: RegistrationStepsUtils */;
|
|
const getPreviousRegistrationTransitionStep = registrationStepsUtilsModule.getPreviousRegistrationTransitionStep;
|
|
const AGE_GATE = AuthStates.AGE_GATE;
|
|
defaultImport2(Reflect.apply(getPreviousRegistrationTransitionStep, registrationStepsUtilsModule, [AGE_GATE]));
|
|
env0_4.useEffect(_fun108531, [value3]);
|
|
const value14 = (importDefault(14341) /* metro dependency 14341: isDateValidDateOfBirth */)(property);
|
|
const jsxRuntimeEnv0_14Binding = jsxRuntimeEnv0_14;
|
|
const AuthFormView = importDefault(9001) /* metro dependency 9001: AuthFormView */;
|
|
const object = {};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const NgL2GX = (require(1244) /* metro dependency 1244: indexNative */).t.NgL2GX;
|
|
object.headerText = Reflect.apply(string, intl, [NgL2GX]);
|
|
object.contentStyle = styles.flexGrow;
|
|
const Input = (require(7682) /* metro dependency 7682: InputNative */).Input;
|
|
const inputProps = {label: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.xNpFJ6),
|
|
errorMessage: value14 ? value4 : value4 != property ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.udnqh6) : value4};
|
|
const InputButton = (require(8554) /* metro dependency 8554: native */).InputButton;
|
|
const items2 = [<View style={styles.inputGroup}><Input {...inputProps}><InputButton value={value4 == property ? value2 : property.format('L')} text={env0_16.format('L')} onPress={onPress_108532} accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.xNpFJ6)} accessibilityHint={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['hZaF/O'])} /></Input></View>];
|
|
const PrivacyHint = importDefault(14342) /* metro dependency 14342: PrivacyHint */;
|
|
const Boolean = global.Boolean;
|
|
items2[1] = <PrivacyHint consentRequired={Boolean(authenticationConsentRequired)} consent={property2} onToggleConsent={onToggleConsent} />;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
items2[2] = <View style={styles.button}><Button size="lg" loading={value11} disabled={!value14} onPress={onPress_108535} text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['825cFy'])} /></View>;
|
|
items2[3] = value4 != r22 ? r22 === '' ? value4 : ((Component) => <Component>{r22}</Component>)(importDefault(8970) /* metro dependency 8970: FreeFormErrorLabel */) : value4;
|
|
return (
|
|
<>
|
|
<View style={styles.page}>
|
|
<AuthFormView {...object}>
|
|
{items2}
|
|
</AuthFormView>
|
|
</View>
|
|
{((Component) => <Component modal open={property3} title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.xNpFJ6)} mode="date" theme={(require(4002) /* metro dependency 4002: shared */).isThemeLight(theme) ? 'light' : 'dark'} date={value4 != value9 ? value9 : env0_17} maximumDate={env0_18} minimumDate={env0_19} onConfirm={onConfirm} onDateChange={onDateChange} onCancel={onCancel} buttonColor={styles.datePickerButton.color} />)(importDefault(9068) /* metro dependency 9068 */)}
|
|
</>
|
|
);
|
|
}
|
|
|
|
function _fun108527() { // fn#108527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14537:1247, offset: 0x023247b8, size: 34 bytes, params: 1, frame: 10
|
|
return env0_2?.toDate();
|
|
}
|
|
|
|
function _fun108531() { // fn#108531, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14537:1571, offset: 0x023247ed, size: 51 bytes, params: 1, frame: 12
|
|
const binding = env0_1;
|
|
const AGE_GATE = RegisterTransitionSteps.AGE_GATE;
|
|
const VIEWED = RegistrationTransitionActionTypes.VIEWED;
|
|
binding({step: AGE_GATE, actionType: VIEWED});
|
|
}
|
|
|
|
function onToggleConsent() { // fn#108533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14537:2251, owner: RegisterAgeGate.onToggleConsent, offset: 0x02324820, size: 25 bytes, params: 1, frame: 11
|
|
return env0_5(function(a0) {
|
|
return !a0;
|
|
});
|
|
}
|
|
|
|
function RegisterAgeGateOnPress_108535() { // fn#108535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14537:2355, owner: RegisterAgeGate.onPress, offset: 0x02324839, size: 175 bytes, params: 1, frame: 17
|
|
const defaultImport = importDefault(44) /* metro dependency 44 */;
|
|
let binding = env0_2;
|
|
defaultImport(binding != null, 'birthday was not null');
|
|
updateRegistrationOptions({birthday: binding, consent: env0_4 || !authenticationConsentRequired});
|
|
binding = env0_1;
|
|
let AGE_GATE = RegisterTransitionSteps.AGE_GATE;
|
|
const SUBMITTED = RegistrationTransitionActionTypes.SUBMITTED;
|
|
binding({step: AGE_GATE, actionType: SUBMITTED});
|
|
const registrationStepsUtilsModule = require(14303) /* metro dependency 14303: RegistrationStepsUtils */;
|
|
const handleRegistrationSubmit = registrationStepsUtilsModule.handleRegistrationSubmit;
|
|
AGE_GATE = AuthStates.AGE_GATE;
|
|
Reflect.apply(handleRegistrationSubmit, registrationStepsUtilsModule, [AGE_GATE, env0_0, binding]);
|
|
}
|
|
|
|
function RegisterAgeGateOnConfirm(a0) { // fn#108536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14537:2842, owner: RegisterAgeGate.onConfirm, offset: 0x023248e8, size: 58 bytes, params: 2, frame: 13
|
|
env0_6(false);
|
|
const binding = env0_3;
|
|
const value = environment.__proto__;
|
|
binding((importDefault(3738) /* metro dependency 3738 */)(a0));
|
|
}
|
|
|
|
function onDateChange(a0) { // fn#108537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14537:2881, owner: RegisterAgeGate.onDateChange, offset: 0x02324922, size: 47 bytes, params: 2, frame: 12
|
|
const binding = env0_3;
|
|
const value = environment.__proto__;
|
|
binding((importDefault(3738) /* metro dependency 3738 */)(a0));
|
|
}
|
|
|