157 lines
9.2 KiB
TypeScript
157 lines
9.2 KiB
TypeScript
/* Metro module 9017; source: modules/phone/native/FormPhoneOrEmail.tsx; dependencies: [31, 27, 33, 4501, 697, 5278, 1244, 4573, 8993, 8968, 8969, 8970, 2] */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import FreeFormTextInput from '../../../design/void/Form/native/FreeFormTextInput.tsx'; /* Metro dependency 8969 */
|
|
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as PhoneOrEmailUtilsModule from '../PhoneOrEmailUtils.tsx'; /* Metro dependency 8993 */
|
|
|
|
function _fun70160(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#70160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9202:6, offset: 0x01cf0cf6, size: 385 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
const INTERACTIVE_BACKGROUND_SELECTED = (Native).colors.INTERACTIVE_BACKGROUND_SELECTED;
|
|
const env0_7 = Reflect.apply(createStyles, CreateStylesModule, [{label: {marginBottom: 8}, input: {'flexGrow': 1,
|
|
'marginBottom': 8}, error: {marginBottom: 8}, hint: {marginBottom: 8},
|
|
selectorOuterContainer: {overflow: 'hidden'}, selectorContainer: {'flex': 1, 'flexDirection': 'row'},
|
|
selectorPressable: {justifyContent: 'center'}, selectorText: {alignSelf: 'center'},
|
|
separator: {'borderLeftWidth': 1, 'borderLeftColor': null, 'marginHorizontal': 12, 'marginVertical': -4,
|
|
borderLeftColor: INTERACTIVE_BACKGROUND_SELECTED}}]);
|
|
value = value.forwardRef(_fun70162);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/phone/native/FormPhoneOrEmail.tsx');
|
|
exports.default = value;
|
|
function CountryCodeSelector({show, alpha2, countryCode, onPress}) { // fn#70161, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9202:575, offset: 0x01cf0e77, size: 383 bytes, params: 2, frame: 29
|
|
var r0;
|
|
var PressableOpacity;
|
|
var intl;
|
|
const styles = useStyles();
|
|
const value3 = '';
|
|
const value4 = value3 + (alpha2 ?? value3) + ' ' + countryCode;
|
|
if (show) {
|
|
var viewBindingProps = {style: styles.selectorOuterContainer};
|
|
var viewBinding2Props = {style: styles.selectorContainer};
|
|
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
var pressableOpacityProps = {onPress: onPress, style: styles.selectorPressable,
|
|
androidRippleConfig: {borderless: true}, accessibilityRole: 'button', accessibilityLabel: value4};
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
pressableOpacityProps.accessibilityHint = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.GwAW3k);
|
|
r0 = (
|
|
<View {...viewBindingProps}>
|
|
<View {...viewBinding2Props}>
|
|
<PressableOpacity {...pressableOpacityProps}>
|
|
{((Text) => <Text style={styles.selectorText} variant="text-md/medium" color="mobile-text-heading-primary">{value4}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}
|
|
</PressableOpacity>
|
|
<View style={styles.separator} />
|
|
</View>
|
|
</View>
|
|
);
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun70162(a0, a1) { // fn#70162, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9202:1158, offset: 0x01cf0ff6, size: 734 bytes, params: 3, frame: 32
|
|
var r7;
|
|
const style = a0.style;
|
|
const textInputStyle = a0.textInputStyle;
|
|
const label = a0.label;
|
|
const error = a0.error;
|
|
let value = a0.value;
|
|
const hint = a0.hint;
|
|
const env0_0 = a0.onChangeText;
|
|
const env0_1 = a0.alpha2;
|
|
const countryCode = a0.countryCode;
|
|
const onPressCountrySelector = a0.onPressCountrySelector;
|
|
const forceMode = a0.forceMode;
|
|
const object = {'style': 0, 'textInputStyle': 0, 'label': 0, 'error': 0, 'value': 0, 'hint': 0, 'onChangeText': 0,
|
|
'alpha2': 0, 'countryCode': 0, 'onPressCountrySelector': 0, 'forceMode': 0};
|
|
const value2 = null;
|
|
silentSetPrototypeOf(object, value2, undefined);
|
|
const value3 = copyDataProperties({}, a0, object, undefined);
|
|
const handleChangeText2 = handleChangeText;
|
|
const styles = useStyles();
|
|
const env0_5 = (PhoneOrEmailUtilsModule).shouldShowCountryCodeSelector(forceMode,
|
|
value);
|
|
const binding = onPressCountrySelector;
|
|
const env0_7 = binding.useRef({handleChangeText: handleChangeText2, value: value});
|
|
binding.useEffect(_fun70164);
|
|
binding.useEffect(_fun70165, [countryCode]);
|
|
const items2 = [
|
|
value2 != label
|
|
? ((Component) => <Component style={styles.label}>{label}</Component>)(importDefault(8968) /* metro dependency 8968: FreeFormLabel */)
|
|
: value2,
|
|
];
|
|
const defaultImport2Props = {...value3};
|
|
defaultImport2Props['renderLeadingComponent'] = renderLeadingComponent;
|
|
defaultImport2Props['error'] = value2 != error;
|
|
defaultImport2Props['ref'] = a1;
|
|
defaultImport2Props['value'] = value;
|
|
defaultImport2Props['style'] = [styles.input, textInputStyle];
|
|
defaultImport2Props['onChangeText'] = handleChangeText2;
|
|
const PhoneOrEmailSelectorForceMode = (PhoneOrEmailUtilsModule).PhoneOrEmailSelectorForceMode;
|
|
let PHONE = PhoneOrEmailSelectorForceMode.PHONE;
|
|
defaultImport2Props['textContentType'] = forceMode !== PHONE ? 'emailAddress' : 'telephoneNumber';
|
|
PHONE = PhoneOrEmailSelectorForceMode.PHONE;
|
|
defaultImport2Props['keyboardType'] = forceMode !== PHONE ? 'email-address' : 'phone-pad';
|
|
defaultImport2Props['accessibilityLabel'] = label;
|
|
defaultImport2Props['accessibilityHint'] = hint;
|
|
items2[1] = <FreeFormTextInput {...defaultImport2Props} />;
|
|
if (value2 != error) {
|
|
value = importDefault(8970) /* metro dependency 8970: FreeFormErrorLabel */;
|
|
value = ((Component) => <Component style={styles.error}>{error}</Component>)(value);
|
|
r7 = value;
|
|
} else {
|
|
r7 = value2;
|
|
}
|
|
items2[2] = r7;
|
|
items2[3] = (
|
|
value2 != hint
|
|
? ((Text) => <Text style={styles.hint} variant="text-xs/medium" color="text-muted">{hint}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)
|
|
: value2
|
|
);
|
|
return (
|
|
<View style={style}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
function handleChangeText(a0) { // fn#70163, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9202:1363, offset: 0x01cf12d4, size: 80 bytes, params: 2, frame: 15
|
|
let value = environment.__proto__;
|
|
value = Reflect.apply((require(8993) /* metro dependency 8993: PhoneOrEmailUtils */).shouldShowCountryCodeSelector,
|
|
value, [forceMode, a0]);
|
|
if (onChangeText != null) {
|
|
onChangeText(a0, value ? countryCode : '');
|
|
}
|
|
}
|
|
|
|
function _fun70164() { // fn#70164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9202:1546, offset: 0x01cf1324, size: 21 bytes, params: 1, frame: 2
|
|
env0_7.current = JsxRuntimeModule.jsxs;
|
|
}
|
|
|
|
function _fun70165() { // fn#70165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9202:1579, offset: 0x01cf1339, size: 32 bytes, params: 1, frame: 11
|
|
const current = env0_7.current;
|
|
current.handleChangeText(current.value);
|
|
}
|
|
|
|
function renderLeadingComponent() { // fn#70166, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9202:1757, offset: 0x01cf1359, size: 61 bytes, params: 1, frame: 14
|
|
return (
|
|
<CountryCodeSelector
|
|
show={env0_5}
|
|
alpha2={alpha2}
|
|
countryCode={countryCode}
|
|
onPress={onPressCountrySelector}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun70160, 9017, [31, 27, 33, 4501, 697, 5278, 1244, 4573, 8993, 8968, 8969, 8970,
|
|
2]) /* metro module 9017, dependencies: [31, 27, 33, 4501, 697, 5278, 1244, 4573, 8993, 8968, 8969, 8970, 2] */;
|