Files
2026-07-28 01:06:53 +03:00

225 lines
14 KiB
TypeScript

/* Metro module 14355; source: modules/auth/native/AuthManager.tsx; dependencies: [5, 6, 7, 15, 17, 18, 27, 11872, 661, 4661, 12022, 1375, 14356, 477, 11875, 9151, 12043, 12021, 6947, 694, 7148, 4561, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Dispatcher from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
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 PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as NativePermissionConstantsModule from '../../native_permissions/NativePermissionConstants.tsx'; /* Metro dependency 4661 */
import * as TransitionToGuildNativeModule from '../../routing/transitionToGuild.native.tsx'; /* Metro dependency 6947 */
import * as InstantInviteUtilsModule from '../../instant_invite/native/InstantInviteUtils.tsx'; /* Metro dependency 9151 */
import * as PushNotificationPermissionStoreModule from '../../../stores/native/PushNotificationPermissionStore.tsx'; /* Metro dependency 11872 */
import * as NUFActionCreatorsModule from '../../nuf/native/NUFActionCreators.tsx'; /* Metro dependency 12021 */
import * as NUFConstantsModule from '../../nuf/NUFConstants.tsx'; /* Metro dependency 12022 */
function _fun108634(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108634, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:6, offset: 0x02327e7d, size: 398 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_9 = value.NativeModules;
const env0_10 = value.Keyboard;
object = {REGISTER: 'register', LOGIN: 'login'};
value = importDefault(4561) /* metro dependency 4561: LifecycleManager */;
value = _fun108638(value);
value = new value();
(FileImportTrackerModule).fileFinishedImporting('modules/auth/native/AuthManager.tsx');
exports.default = value;
function _isNativeReflectConstruct_108635() { // fn#108635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:308, offset: 0x0232800b, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_108635_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun108638(a0) { // fn#108638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:583, offset: 0x0232806d, size: 97 bytes, params: 2, frame: 16
const AuthManager2 = AuthManager;
Inherits(AuthManager2, a0);
return CreateClass(AuthManager2, [{key: '_initialize', value: value_108652}, {key: '_terminate', value: value_108653}]);
function AuthManager(a0) { // fn#108639, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:595, offset: 0x023280ce, size: 240 bytes, params: 2, frame: 20
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_4;
binding(this, AuthManager);
const items2 = [];
arraySpread(items2, value, 0, items2);
value = env1_7(AuthManager);
binding = env1_6;
if (_isNativeReflectConstruct_108635()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items2, env1_7(this).constructor);
r0 = value;
} else {
value = value.apply(this, items2);
r0 = value;
}
value = binding(this, r0);
value.handleRegister = handleRegister;
value.handleLogin = handleLogin_108641;
value.handlePushNotificationOptIn = _fun108642();
value.handleRegisterWithConnection = handleRegisterWithConnection;
value.handleRegisterComplete = handleRegisterComplete;
value.handleLoginWithConnection = handleLoginWithConnection;
value.handleConnectionOpen = handleConnectionOpen_108650;
value.handleLogout = function() {
importDefault(dependencyMap[20]).deleteAllInteractions();
var DCDShortcutManager = NativeModules.DCDShortcutManager;
if (DCDShortcutManager != null) {
DCDShortcutManager.handleLogout();
}
};
return value;
function handleRegister() { // fn#108640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:831, owner: AuthManager.handleRegister, offset: 0x023281be, size: 21 bytes, params: 1, frame: 2
env2_16 = env2_15.REGISTER;
}
function AuthManagerHandleLogin() { // fn#108641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:864, owner: AuthManager.handleLogin, offset: 0x023281d3, size: 21 bytes, params: 1, frame: 2
env2_16 = env2_15.LOGIN;
}
function _fun108642() { // fn#108642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:910, offset: 0x023281e8, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_3(_fun108644);
return _fun108645;
function* _fun108644(a0) { // fn#108644, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:930, offset: 0x02328217, size: 162 bytes, params: 2, frame: 16
if (true) {
value = environment.__proto__.__proto__.__proto__.__proto__;
env4_10.dismiss();
if (env4_1(env4_2[11])()) {
a0();
} else {
var NativePermissionManager = env4_9.NativePermissionManager;
var getNotificationAuthorizationStatus = NativePermissionManager.getNotificationAuthorizationStatus;
yield Reflect.apply(getNotificationAuthorizationStatus, NativePermissionManager, []);
var value3 = undefined;
if (false) {
return value3;
}
var UNDETERMINED = env4_13.UNDETERMINED;
if (value3 === UNDETERMINED) {
env4_0(env4_2[12]).showPushNotificationPromptModal({onComplete: a0});
} else {
a0();
}
}
}
}
function _fun108645() { // fn#108645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:1131, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
function handleRegisterWithConnection() { // fn#108646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:1208, owner: AuthManager.handleRegisterWithConnection, offset: 0x023282b9, size: 98 bytes, params: 1, frame: 13
var moduleValue2;
if (PlatformUtilsModule.isIOS()) {
moduleValue2 = require(11875) /* metro dependency 11875: PushNotificationActionCreators */;
moduleValue2.setPushPermissionState(PermissionStateType.PROMPT_SEEN);
}
env0_0.handleRegisterComplete();
}
function handleRegisterComplete() { // fn#108647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:1331, owner: AuthManager.handleRegisterComplete, offset: 0x0232831b, size: 111 bytes, params: 1, frame: 13
var moduleValue2;
const value = environment.__proto__.__proto__;
if (!InstantInviteUtilsModule.hasDeferredInvite()) {
moduleValue2 = require(12043) /* metro dependency 12043: NUFActionCreators */;
moduleValue2.setNewUser(NewUserTypes.ORGANIC_REGISTERED);
}
(NUFActionCreatorsModule).startOnboarding();
}
function handleLoginWithConnection() { // fn#108648, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:1464, owner: AuthManager.handleLoginWithConnection, offset: 0x0232838a, size: 31 bytes, params: 1, frame: 11
env0_0.handlePushNotificationOptIn(_fun108649);
function _fun108649() { // fn#108649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:1500, offset: 0x023283a9, size: 80 bytes, params: 1, frame: 14
const value = environment.__proto__.__proto__.__proto__;
(TransitionToGuildNativeModule).transitionToGuild(ME);
(Dispatcher).dispatch({type: 'DEFERRED_INVITE_SHOW'});
}
}
function AuthManagerHandleConnectionOpen() { // fn#108650, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:1611, owner: AuthManager.handleConnectionOpen, offset: 0x023283f9, size: 180 bytes, params: 1, frame: 12
var DCDSKAdNetworkManager;
const binding = env2_16;
const REGISTER = env2_15.REGISTER;
if (REGISTER === binding) {
env0_0.handleRegisterWithConnection();
DCDSKAdNetworkManager = NativeModules.DCDSKAdNetworkManager;
if (DCDSKAdNetworkManager != null) {
DCDSKAdNetworkManager.updateConversionValue(1);
}
} else if (env2_15.LOGIN === binding) {
env0_0.handleLoginWithConnection();
DCDSKAdNetworkManager = NativeModules.DCDSKAdNetworkManager;
if (DCDSKAdNetworkManager != null) {
DCDSKAdNetworkManager.updateConversionValue(10);
}
} else {
(require(6947) /* metro dependency 6947: transitionToGuildNative */).transitionToGuild(ME);
}
}
}
function value_108652() { // fn#108652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:2084, offset: 0x023284ee, size: 145 bytes, params: 1, frame: 18
let value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('CONNECTION_OPEN', this.handleConnectionOpen);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('LOGIN_SUCCESS', this.handleLogin);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('REGISTER_SUCCESS', this.handleRegister);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('LOGOUT', this.handleLogout);
}
function value_108653() { // fn#108653, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14552:2344, offset: 0x0232857f, size: 145 bytes, params: 1, frame: 18
let value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('CONNECTION_OPEN', this.handleConnectionOpen);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('LOGIN_SUCCESS', this.handleLogin);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('REGISTER_SUCCESS', this.handleRegister);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('LOGOUT', this.handleLogout);
}
}
}
global.__d(_fun108634, 14355, [5, 6, 7, 15, 17, 18, 27, 11872, 661, 4661, 12022, 1375, 14356, 477, 11875, 9151,
12043, 12021, 6947, 694, 7148, 4561,
2]) /* metro module 14355, dependencies: [5, 6, 7, 15, 17, 18, 27, 11872, 661, 4661, 12022, 1375, 14356, 477, 11875, 9151, 12043, 12021, 6947, 694, 7148, 4561, 2] */;