Files
discord-decomp/sources/modules/auth/register.tsx
T
2026-07-28 01:06:53 +03:00

871 lines
38 KiB
TypeScript

/* Metro module 14315; source: modules/auth/register.tsx; dependencies: [5, 14316, 1226, 661, 1229, 3738, 683, 5046, 480, 4132, 9486, 694, 14317, 14318, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import AnalyticsUtils from '../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
import Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */
import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import APIError from '../../errors/APIError.tsx'; /* Metro dependency 4132 */
import TrackedHTTPUtils from '../../utils/TrackedHTTPUtils.tsx'; /* Metro dependency 5046 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as AnalyticsUtilsModule from '../../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as SharedCaptchaUtilsModule from '../captcha/SharedCaptchaUtils.tsx'; /* Metro dependency 9486 */
import * as ParentalConsentStoreModule from '../parent_tools/ParentalConsentStore.tsx'; /* Metro dependency 14316 */
function _fun108353(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14512:6, offset: 0x0231dd8c, size: 292 bytes, params: 8, frame: 20
const env0_0 = require;
const registerFull2 = registerFull;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
ParentalConsentStoreModule;
let value = ConstantsModule;
const env0_6 = value.AnalyticEvents;
const env0_7 = value.AnalyticsSections;
const env0_8 = value.Endpoints;
value = require(1229) /* metro dependency 1229: AgeGateConstants */;
const env0_9 = value.AgeGateAnalyticAction;
const env0_10 = value.AgeGateSource;
(FileImportTrackerModule).fileFinishedImporting('modules/auth/register.tsx');
exports.default = function(a0) {
var r6;
var r5;
var r4;
var value;
var property = a0.invite;
r5 = property !== undefined ? property : null;
property = a0.giftCodeSKUId;
r4 = property !== undefined ? property : null;
value = Object.create(null);
value.invite = 0;
value.giftCodeSKUId = 0;
var value2 = copyDataProperties({}, a0, value, r6);
var registerFullBinding = registerFull;
var object = {};
copyDataProperties(object, value2, value);
object['invite'] = r5;
object['giftCodeSKUId'] = r4;
return registerFullBinding(object);
};
exports.scorePassword = function() {
return _scorePassword.apply(this, arguments);
};
exports.registerPhone = function() {
return _registerPhone.apply(this, arguments);
};
exports.registerFull = registerFull2;
function _scorePassword() { // fn#108354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14512:247, offset: 0x0231deb0, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun108356).apply(this, arguments);
function* _fun108356(a0) { // fn#108356, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14512:298, offset: 0x0231deed, size: 198 bytes, params: 2, frame: 17
var binding;
var binding2;
var property;
var value3;
var post;
var object;
var SCORE_PASSWORD;
var object2;
var object3;
var value4;
var NetworkActionNames;
var PASSWORD_VALIDATE;
var value5;
var value6;
var value7;
var body;
var error;
var prototype;
var value8;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
try {
binding = env2_1;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
binding2 = env2_3;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
property = binding2[7];
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
value3 = binding(property);
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
post = value3.post;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
object = {};
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
binding = env2_8;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
SCORE_PASSWORD = binding.SCORE_PASSWORD;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
object.url = SCORE_PASSWORD;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
object2 = {};
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
object2.password = a0;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
object.body = object2;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
object3 = {};
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
binding = env2_0;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
property = binding2[8];
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
value4 = binding(property);
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
NetworkActionNames = value4.NetworkActionNames;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
PASSWORD_VALIDATE = NetworkActionNames.PASSWORD_VALIDATE;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
object3.event = PASSWORD_VALIDATE;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
object.trackedActionData = object3;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
object.rejectWithError = false;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
try {
value5 = Reflect.apply(post, value3, [object]);
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
yield value5;
try {
value6 = undefined;
value7 = false;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
if (value7) {
return value6;
}
try {
body = value6.body;
} catch (error) {
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value8 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value8;
throw value;
}
return body;
}
}
function _registerPhone() { // fn#108357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14512:537, offset: 0x0231dfb3, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun108359).apply(this, arguments);
async function _fun108359({phone}) { // fn#108359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14512:588, offset: 0x0231dff9, size: 251 bytes, params: 2, frame: 19
var binding;
var binding2;
var property;
var value4;
var post;
var object;
var REGISTER_PHONE;
var object2;
var object3;
var value5;
var NetworkActionNames;
var USER_REGISTER_PHONE;
var value6;
var value7;
var value8;
var error;
var CaptchaCancelError;
var prototype;
var value9;
if (false) {
return undefined;
}
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
try {
binding = env2_1;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
binding2 = env2_3;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
property = binding2[7];
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
value4 = binding(property);
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
post = value4.post;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object = {};
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
binding = env2_8;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
REGISTER_PHONE = binding.REGISTER_PHONE;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object.url = REGISTER_PHONE;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object2 = {};
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object2.phone = phone;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object.body = object2;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object3 = {};
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
binding = env2_0;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
property = binding2[8];
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
value5 = binding(property);
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
NetworkActionNames = value5.NetworkActionNames;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
USER_REGISTER_PHONE = NetworkActionNames.USER_REGISTER_PHONE;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object3.event = USER_REGISTER_PHONE;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object.trackedActionData = object3;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
object.rejectWithError = false;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
try {
value6 = Reflect.apply(post, value4, [object]);
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
await value6;
try {
value7 = undefined;
value8 = false;
} catch (error) {
binding = env2_0;
CaptchaCancelError = binding(env2_3[10]).CaptchaCancelError;
if (error instanceof CaptchaCancelError) {
throw error;
}
binding = env2_1;
value = binding(env2_3[9]);
prototype = value.prototype;
value9 = Object.create(prototype, {constructor: {value: value}});
value = new value();
value = value instanceof Object ? value : value9;
throw value;
}
return value8 ? value7 : value7;
}
}
function registerFull({email, phoneToken, username, globalName, consent, password, guildTemplateCode, birthday, invite, giftCodeSKUId, promoEmailConsent, usedUsernameSuggestion}) { // fn#108360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14512:880, offset: 0x0231e0f4, size: 717 bytes, params: 2, frame: 33
var r20;
var defaultImport2;
var REGISTER;
var defaultImport3;
var track;
var AGE_GATE_ACTION;
var value8;
var defaultImport4;
const value = undefined;
invite = invite === value ? null : invite;
giftCodeSKUId = giftCodeSKUId === value ? null : giftCodeSKUId;
promoEmailConsent = promoEmailConsent === value ? null : promoEmailConsent;
usedUsernameSuggestion = usedUsernameSuggestion === value ? null : usedUsernameSuggestion;
(Dispatcher).dispatch({type: 'REGISTER'});
if (birthday != null) {
defaultImport2 = importDefault(14317) /* metro dependency 14317: trackAgeGateSubmitted */;
REGISTER = AnalyticsSections.REGISTER;
defaultImport2(birthday, REGISTER);
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport3.track;
AGE_GATE_ACTION = AnalyticEvents.AGE_GATE_ACTION;
REGISTER = AgeGateSource.REGISTER;
Reflect.apply(track, defaultImport3, [AGE_GATE_ACTION, {source: REGISTER,
action: AgeGateAnalyticAction.AGE_GATE_SUBMITTED}]);
value8 = (importDefault(3738) /* metro dependency 3738 */)().diff(birthday, 'years');
if (!(value8 < 13)) {
r20 = value8 >= 13 && value8 <= 17 ? '13-17' : value8 >= 18 && value8 <= 22 ? '18-22' : '23+';
defaultImport4 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport4.track(AnalyticEvents.USER_AGE_SUBMITTED, {age_bucket: r20});
}
}
const defaultImport5 = TrackedHTTPUtils;
const post = defaultImport5.post;
object = {};
REGISTER = Endpoints.REGISTER;
object.url = REGISTER;
const object2 = {};
object2.fingerprint = AuthenticationStore.getFingerprint();
object2.email = email;
object2.username = username;
object2.global_name = globalName;
object2.password = password;
object2.invite = invite;
object2.consent = consent;
object2.phone_token = phoneToken;
object2.date_of_birth = birthday == null ? value : birthday.format('YYYY-MM-DD');
object2.gift_code_sku_id = giftCodeSKUId;
object2.guild_template_code = guildTemplateCode;
object2.promotional_email_opt_in = promoEmailConsent == null ? value : promoEmailConsent.checked;
object.body = object2;
const NetworkActionNames = (AnalyticsUtilsModule).NetworkActionNames;
const USER_REGISTER = NetworkActionNames.USER_REGISTER;
object.trackedActionData = {event: USER_REGISTER, properties: {invite_code: invite,
used_username_suggestion: usedUsernameSuggestion,
promotional_email_opt_in: promoEmailConsent == null ? value : promoEmailConsent.checked,
promotional_email_pre_checked: promoEmailConsent == null ? value : promoEmailConsent.preChecked,
was_unique_username: true}};
object.rejectWithError = false;
return Reflect.apply(post, defaultImport5, [object]).then(_fun108361, _fun108362);
function _fun108361(a0) { // fn#108361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14512:1991, offset: 0x0231e3c1, size: 184 bytes, params: 2, frame: 19
(Dispatcher).dispatch({type: 'REGISTER_SUCCESS',
token: a0.body.token});
(Dispatcher).dispatch({type: 'GUARDIAN_CONNECT_REQUIRED',
shouldShowGuardianConnect: a0.body.show_guardian_connect === true});
const defaultImport3 = AnalyticsUtils;
const track = defaultImport3.track;
const AGE_GATE_ACTION = AnalyticEvents.AGE_GATE_ACTION;
const REGISTER = AgeGateSource.REGISTER;
const AGE_GATE_SUCCESS = AgeGateAnalyticAction.AGE_GATE_SUCCESS;
Reflect.apply(track, defaultImport3, [AGE_GATE_ACTION, {source: REGISTER, action: AGE_GATE_SUCCESS}]);
}
function _fun108362(a0) { // fn#108362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14512:2255, offset: 0x0231e479, size: 482 bytes, params: 2, frame: 18
var moduleValue;
const CaptchaCancelError = (SharedCaptchaUtilsModule).CaptchaCancelError;
if (a0 instanceof CaptchaCancelError) {
throw a0;
}
const value3 = new (APIError)(a0);
if (value3.getFieldErrors('date_of_birth') != null) {
moduleValue = importAll(14318) /* metro dependency 14318: AgeGateActionCreators */;
moduleValue.preventUnderageRegistration(AgeGateSource.REGISTER);
}
const defaultImport2 = AnalyticsUtils;
const track = defaultImport2.track;
const REGISTER_SUBMIT_ERRORED = AnalyticEvents.REGISTER_SUBMIT_ERRORED;
const object = {is_unique_username_registration: true};
object.email_error_reason = value3.getFirstFieldErrorMessage('email');
object.phone_error_reason = value3.getFirstFieldErrorMessage('phone_token');
object.password_error_reason = value3.getFirstFieldErrorMessage('password');
object.username_error_reason = value3.getFirstFieldErrorMessage('username');
object.global_name_error_reason = value3.getFirstFieldErrorMessage('global_name');
object.date_of_birth_error_reason = value3.getFirstFieldErrorMessage('date_of_birth');
object.promotional_email_opt_in_error_reason = value3.getFirstFieldErrorMessage('promotional_email_opt_in');
object.fingerprint_error_reason = value3.getFirstFieldErrorMessage('fingerprint');
object.invite_error_reason = value3.getFirstFieldErrorMessage('invite');
object.gift_code_sku_id_error_reason = value3.getFirstFieldErrorMessage('gift_code_sku_id');
object.guild_template_code_error_reason = value3.getFirstFieldErrorMessage('guild_template_code');
object.consent_error_reason = value3.getFirstFieldErrorMessage('consent');
object.generic_error_reason = value3.getAnyErrorMessage();
Reflect.apply(track, defaultImport2, [REGISTER_SUBMIT_ERRORED, object]);
throw value3;
}
}
}
global.__d(_fun108353, 14315, [5, 14316, 1226, 661, 1229, 3738, 683, 5046, 480, 4132, 9486, 694, 14317, 14318,
2]) /* metro module 14315, dependencies: [5, 14316, 1226, 661, 1229, 3738, 683, 5046, 480, 4132, 9486, 694, 14317, 14318, 2] */;