676 lines
22 KiB
TypeScript
676 lines
22 KiB
TypeScript
/* Metro module 14222; source: modules/mfa/native/screens/SmsScreen.tsx; dependencies: [5, 57, 31, 27, 661, 33, 8973, 14215, 1244, 507, 14219, 14214, 7981, 4578, 14217, 2] */
|
|
function _fun107551(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#107551, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14419:6, offset: 0x02300618, size: 226 bytes, params: 8, frame: 19
|
|
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 env0_7 = (require(661) /* metro dependency 661: Constants */).Endpoints;
|
|
const value = require(33) /* metro dependency 33 */;
|
|
const env0_8 = value.jsx;
|
|
const env0_9 = value.jsxs;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/mfa/native/screens/SmsScreen.tsx');
|
|
exports.default = SmsScreen;
|
|
}
|
|
|
|
function SmsScreen({mfaChallenge, finish}) { // fn#107552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14419:281, offset: 0x023006fa, size: 972 bytes, params: 2, frame: 35
|
|
const value3 = (importDefault(14215) /* metro dependency 14215: MfaScreenUtils */).useScreenStyles((importDefault(8973) /* metro dependency 8973: useWideAuthView */)());
|
|
const binding = env0_5;
|
|
let useState = binding.useState;
|
|
const value4 = Reflect.apply(useState, binding, [null]);
|
|
const binding2 = env0_4;
|
|
const value5 = binding2(value4, 2);
|
|
const property = value5[0];
|
|
const env0_2 = value5[1];
|
|
useState = binding.useState;
|
|
const value6 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property2 = value6[0];
|
|
const env0_3 = value6[1];
|
|
useState = binding.useState;
|
|
const value7 = binding2(Reflect.apply(useState, binding, ['']), 2);
|
|
const property3 = value7[0];
|
|
var env0_5 = value7[1];
|
|
useState = binding.useState;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const LQdCQE = (require(1244) /* metro dependency 1244: indexNative */).t.LQdCQE;
|
|
const value8 = binding2(Reflect.apply(useState, binding, [Reflect.apply(string, intl, [LQdCQE])]), 2);
|
|
const property4 = value8[0];
|
|
const env0_6 = value8[1];
|
|
useState = binding.useState;
|
|
const value9 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property5 = value9[0];
|
|
const env0_7 = value9[1];
|
|
binding.useEffect(_fun107553, [mfaChallenge.ticket]);
|
|
const value10 = _fun107556();
|
|
const value11 = _fun107560();
|
|
const MfaOptionScreen = importDefault(14214) /* metro dependency 14214: MfaOptionScreen */;
|
|
const mfaOptionScreenProps = {headerText: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.o4JNrO),
|
|
subtitle: property4};
|
|
const inputContainer = value3.inputContainer;
|
|
const TextInput = (require(7981) /* metro dependency 7981: TextInputNative */).TextInput;
|
|
const object = {'autoFocus': true, 'autoCapitalize': 'characters', 'maxLength': null, 'autoComplete': 'sms-otp',
|
|
'textContentType': 'oneTimeCode', 'keyboardType': 'number-pad'};
|
|
const SMS_CODE_LENGTH = (require(14219) /* metro dependency 14219: MFA */).SMS_CODE_LENGTH;
|
|
object.maxLength = SMS_CODE_LENGTH;
|
|
object.onChange = value10;
|
|
object.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/sHnXc']);
|
|
string = intl.string;
|
|
const HZPBOd = (require(1244) /* metro dependency 1244: indexNative */).t.HZPBOd;
|
|
object.accessibilityLabel = Reflect.apply(string, intl, [HZPBOd]);
|
|
object.placeholder = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.tARzgo);
|
|
object.errorMessage = property;
|
|
const textInput = <TextInput {...object} />;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
string = intl.string;
|
|
const WbaP3r = (require(1244) /* metro dependency 1244: indexNative */).t.WbaP3r;
|
|
mfaOptionScreenProps.input = <View style={inputContainer}>{textInput}<Button text={Reflect.apply(string, intl,
|
|
[WbaP3r])} variant="secondary" size="sm" onPress={value11} /></View>;
|
|
const defaultImport3 = importDefault(14217) /* metro dependency 14217: button */;
|
|
const defaultImport3Props = {variant: 'primary',
|
|
text: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.geKm7t),
|
|
loading: property2 || property5, onPress: onPress_107564};
|
|
let r8 = property2 || property5;
|
|
r8 = !r8 ? property3.length !== (require(14219) /* metro dependency 14219: MFA */).SMS_CODE_LENGTH : r8;
|
|
defaultImport3Props.disabled = r8;
|
|
mfaOptionScreenProps.submit = ((Component) => <Component {...defaultImport3Props} />)(defaultImport3);
|
|
mfaOptionScreenProps.screenProps = {mfaChallenge: mfaChallenge, finish: finish};
|
|
mfaOptionScreenProps.mfaMethod = 'sms';
|
|
return <MfaOptionScreen {...mfaOptionScreenProps} />;
|
|
}
|
|
|
|
function _fun107553() { // fn#107553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14419:624, offset: 0x02300ac6, size: 144 bytes, params: 1, frame: 15
|
|
env0_2(null);
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const post = HTTP.post;
|
|
const LOGIN_SMS_SEND = Endpoints.LOGIN_SMS_SEND;
|
|
let value = Reflect.apply(post, HTTP, [{url: LOGIN_SMS_SEND, body: {ticket: mfaChallenge.ticket},
|
|
oldFormErrors: true, rejectWithError: false}]);
|
|
value = value.then(_fun107554);
|
|
value.catch(_fun107555);
|
|
}
|
|
|
|
function _fun107556() { // fn#107556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14419:949, offset: 0x02300bf0, size: 36 bytes, params: 1, frame: 12
|
|
const env0_0 = env1_3(_fun107558);
|
|
return _fun107559;
|
|
}
|
|
|
|
function _fun107560() { // fn#107560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14419:1225, offset: 0x02300cf6, size: 36 bytes, params: 1, frame: 12
|
|
const env0_0 = env1_3(_fun107562);
|
|
return _fun107563;
|
|
}
|
|
|
|
function SmsScreenOnPress() { // fn#107564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14419:2380, owner: SmsScreen.onPress, offset: 0x02300eab, size: 20 bytes, params: 1, frame: 11
|
|
env0_8(env0_4);
|
|
}
|
|
|
|
function _fun107554({body}) { // fn#107554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14419:745, offset: 0x02300b56, size: 96 bytes, params: 2, frame: 16
|
|
const binding = env1_6;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
binding(intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['8r6h7+'],
|
|
{phoneNumber: body.phone}));
|
|
}
|
|
|
|
function _fun107555(a0) { // fn#107555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14419:845, offset: 0x02300bb6, size: 58 bytes, params: 2, frame: 16
|
|
const binding = env1_2;
|
|
const body = a0.body;
|
|
const value2 = undefined;
|
|
let message = body == null ? value2 : body.message;
|
|
message = message ?? a0.message;
|
|
binding(message);
|
|
env1_6(value2);
|
|
return value2;
|
|
}
|
|
|
|
function* _fun107558(a0) { // fn#107558, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14419:969, offset: 0x02300c1f, size: 215 bytes, params: 2, frame: 20
|
|
var message;
|
|
var r3;
|
|
var object2;
|
|
var defaultImport;
|
|
var value5;
|
|
var value6;
|
|
var error;
|
|
var body;
|
|
let value = undefined;
|
|
if (true) {
|
|
value = undefined;
|
|
env2_5(a0);
|
|
var length = a0.length;
|
|
var SMS_CODE_LENGTH = env3_0(env3_2[10]).SMS_CODE_LENGTH;
|
|
if (length === SMS_CODE_LENGTH) {
|
|
dependencyMap(null);
|
|
env2_3(true);
|
|
reducibleJoin4: while (true) {
|
|
reduciblePort20: while (true) {
|
|
exceptionLanding15: while (true) {
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding15;
|
|
}
|
|
break reducibleJoin4;
|
|
}
|
|
body = error.body;
|
|
reducibleJoin17: while (true) {
|
|
if (body == null) {
|
|
message = value;
|
|
break reducibleJoin17;
|
|
}
|
|
message = body.message;
|
|
break reducibleJoin17;
|
|
}
|
|
reducibleJoin19: while (true) {
|
|
if (message != null) {
|
|
r3 = message;
|
|
break reducibleJoin19;
|
|
}
|
|
message = error.message;
|
|
r3 = message;
|
|
break reducibleJoin19;
|
|
}
|
|
dependencyMap(r3);
|
|
break reduciblePort20;
|
|
}
|
|
env2_3(false);
|
|
return value;
|
|
}
|
|
try {
|
|
object2 = {};
|
|
} catch (error) {
|
|
break exceptionLanding15;
|
|
}
|
|
try {
|
|
object2.mfaType = 'sms';
|
|
} catch (error) {
|
|
break exceptionLanding15;
|
|
}
|
|
try {
|
|
object2.data = a0;
|
|
} catch (error) {
|
|
break exceptionLanding15;
|
|
}
|
|
try {
|
|
defaultImport = importDefault(object2);
|
|
} catch (error) {
|
|
break exceptionLanding15;
|
|
}
|
|
yield defaultImport;
|
|
try {
|
|
value5 = undefined;
|
|
value6 = false;
|
|
} catch (error) {
|
|
break exceptionLanding15;
|
|
}
|
|
if (value6) {
|
|
return value5;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding15;
|
|
}
|
|
try {
|
|
Endpoints(true);
|
|
} catch (error) {
|
|
break exceptionLanding15;
|
|
}
|
|
env2_3(false);
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function* _fun107562() { // fn#107562, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14419:1245, offset: 0x02300d25, size: 390 bytes, params: 1, frame: 24
|
|
var message;
|
|
var r1;
|
|
var value;
|
|
var value2;
|
|
var value3;
|
|
var value4;
|
|
var binding;
|
|
var binding2;
|
|
var intl;
|
|
var string;
|
|
var t;
|
|
var LQdCQE;
|
|
var binding3;
|
|
var property;
|
|
var value5;
|
|
var HTTP;
|
|
var post;
|
|
var object3;
|
|
var LOGIN_SMS_SEND;
|
|
var object4;
|
|
var ticket;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
var binding4;
|
|
var value9;
|
|
var formatToPlainString;
|
|
var value10;
|
|
var body;
|
|
var phone;
|
|
var value11;
|
|
var error;
|
|
var value12;
|
|
var value13;
|
|
exceptionLanding61: while (true) {
|
|
value = undefined;
|
|
value2 = false;
|
|
if (value2) {
|
|
return value;
|
|
}
|
|
value = undefined;
|
|
value3 = environment.__proto__.__proto__;
|
|
dependencyMap(null);
|
|
env2_3(true);
|
|
value4 = environment.__proto__.__proto__.__proto__;
|
|
binding = env3_0;
|
|
binding2 = env3_2;
|
|
intl = binding(binding2[8]).intl;
|
|
string = intl.string;
|
|
t = binding(binding2[8]).t;
|
|
LQdCQE = t.LQdCQE;
|
|
View(Reflect.apply(string, intl, [LQdCQE]));
|
|
reducibleJoin3: while (true) {
|
|
reduciblePort60: while (true) {
|
|
exceptionLanding44: while (true) {
|
|
try {
|
|
try {
|
|
binding = env3_0;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
break reducibleJoin3;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
message = error.message;
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
value12 = message != null;
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
if (value12) {
|
|
r1 = message;
|
|
} else {
|
|
try {
|
|
body = error.body;
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
value13 = body == null;
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
reducibleJoin55: while (true) {
|
|
if (value13) {
|
|
message = value;
|
|
break reducibleJoin55;
|
|
}
|
|
try {
|
|
message = body.message;
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
break reducibleJoin55;
|
|
}
|
|
r1 = message;
|
|
}
|
|
try {
|
|
dependencyMap(r1);
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
View(value);
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
break reduciblePort60;
|
|
}
|
|
env2_3(false);
|
|
return value;
|
|
}
|
|
try {
|
|
try {
|
|
binding3 = env3_2;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
property = binding3[9];
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
value5 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
HTTP = value5.HTTP;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
post = HTTP.post;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
object3 = {};
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
binding = env3_7;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
LOGIN_SMS_SEND = binding.LOGIN_SMS_SEND;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
object3.url = LOGIN_SMS_SEND;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
object4 = {};
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
ticket = require.ticket;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
object4.ticket = ticket;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
object3.body = object4;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
object3.oldFormErrors = true;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
object3.rejectWithError = false;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
value6 = Reflect.apply(post, HTTP, [object3]);
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
yield value6;
|
|
try {
|
|
try {
|
|
value7 = undefined;
|
|
value8 = false;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
if (value8) {
|
|
env2_3(false);
|
|
return value7;
|
|
}
|
|
try {
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
binding = env3_0;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
binding4 = env3_2;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
property = binding4[8];
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
value9 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
intl = value9.intl;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
property = binding4[8];
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
value10 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
t = value10.t;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
property = t['8r6h7+'];
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
object3 = {};
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
body = value7.body;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
phone = body.phone;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
object3.phoneNumber = phone;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
value11 = Reflect.apply(formatToPlainString, intl, [property, object3]);
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
try {
|
|
try {
|
|
View(value11);
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding61;
|
|
}
|
|
env2_3(false);
|
|
return value;
|
|
}
|
|
env2_3(false);
|
|
throw error;
|
|
}
|
|
|