159 lines
9.9 KiB
TypeScript
159 lines
9.9 KiB
TypeScript
/* Metro module 13249; source: modules/webauthn/native/PasskeyUpsellManager.tsx; dependencies: [6, 7, 15, 17, 18, 1226, 1878, 13243, 661, 8980, 3968, 1365, 4007, 5084, 13250, 4860, 2] */
|
|
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 AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import AutomaticLifecycleManager from '../../../lib/AutomaticLifecycleManager.tsx'; /* Metro dependency 4860 */
|
|
import WebAuthnStore from '../WebAuthnStore.tsx'; /* Metro dependency 13243 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as Dismissible_contentModule from '../../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/dismissible_content.tsx'; /* Metro dependency 1365 */
|
|
|
|
function _fun101042(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13439:6, offset: 0x022060a7, size: 310 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = AutomaticLifecycleManager;
|
|
value = _fun101046(value);
|
|
value = new value();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/webauthn/native/PasskeyUpsellManager.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_101043() { // fn#101043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13439:200, offset: 0x022061dd, 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_101043_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun101046(a0) { // fn#101046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13439:413, offset: 0x0220623f, size: 149 bytes, params: 2, frame: 16
|
|
const PasskeyUpsellManager2 = PasskeyUpsellManager;
|
|
Inherits(PasskeyUpsellManager2, a0);
|
|
return CreateClass(PasskeyUpsellManager2, [{key: 'handlePasskeyUpsellShow', value: value_101048},
|
|
{key: 'handleLoginSuccess', value: function() {
|
|
env1_13 = true;
|
|
}}, {key: 'handleLogout', value: function() {
|
|
env1_12 = false;
|
|
env1_13 = false;
|
|
}}, {key: 'markDismissed', value: value_101051}]);
|
|
function PasskeyUpsellManager(a0) { // fn#101047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13439:425, offset: 0x022062d4, size: 277 bytes, params: 2, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_3;
|
|
binding(this, PasskeyUpsellManager);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_6(PasskeyUpsellManager);
|
|
binding = env1_5;
|
|
if (_isNativeReflectConstruct_101043()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_6(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.actions = {POST_CONNECTION_OPEN: value.handlePasskeyUpsellShow, LOGIN_RESET: value.handleLogout,
|
|
LOGIN_SUCCESS: value.handleLoginSuccess, LOGOUT: value.handleLogout};
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
const value6 = map.set(AuthenticationStore, value.handlePasskeyUpsellShow);
|
|
const value7 = value6.set(UserStore, value.handlePasskeyUpsellShow);
|
|
value.stores = value7.set(WebAuthnStore, value.handlePasskeyUpsellShow);
|
|
return value;
|
|
}
|
|
|
|
function value_101048() { // fn#101048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13439:1028, offset: 0x022063e9, size: 352 bytes, params: 1, frame: 15
|
|
var authenticationStoreBinding;
|
|
var moduleValue;
|
|
var webAuthnStoreBinding;
|
|
var moduleValue2;
|
|
var currentUser;
|
|
const value = environment.__proto__;
|
|
if (env1_13) {
|
|
if ((require(8980) /* metro dependency 8980: MFAUtils */).hasWebAuthn) {
|
|
if (AuthenticationStore.getLoginStatus() === LoginStates.NONE) {
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
if (authenticationStoreBinding.attemptedPasswordLogin()) {
|
|
moduleValue = require(3968) /* metro dependency 3968: DismissibleContentUnsafeUtils */;
|
|
if (!moduleValue.UNSAFE_isDismissibleContentDismissed((require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.PASSWORDLESS_UPSELL)) {
|
|
if (Reflect.apply(WebAuthnStore.hasFetchedCredentials, webAuthnStoreBinding, [])) {
|
|
if (!WebAuthnStore.hasCredentials) {
|
|
moduleValue2 = require(4007) /* metro dependency 4007: NavigationRouteUtilsNative */;
|
|
if (!moduleValue2.isModalOpen()) {
|
|
currentUser = UserStore.getCurrentUser();
|
|
if (currentUser !== undefined && currentUser.verified) {
|
|
webAuthnStoreBinding = WebAuthnStore;
|
|
if (webAuthnStoreBinding.hasFetchedCredentials()) {
|
|
(importDefault(13250) /* metro dependency 13250: PasskeyUpsellActionCreators */).openPasskeyUpsell();
|
|
} else if (!env1_12) {
|
|
(require(5084) /* metro dependency 5084: WebAuthnActionCreators */).fetchWebAuthnCredentials();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
moduleValue2 = require(4007) /* metro dependency 4007: NavigationRouteUtilsNative */;
|
|
if (!moduleValue2.isModalOpen()) {
|
|
currentUser = UserStore.getCurrentUser();
|
|
if (currentUser !== undefined && currentUser.verified) {
|
|
webAuthnStoreBinding = WebAuthnStore;
|
|
if (webAuthnStoreBinding.hasFetchedCredentials()) {
|
|
(importDefault(13250) /* metro dependency 13250: PasskeyUpsellActionCreators */).openPasskeyUpsell();
|
|
} else if (!env1_12) {
|
|
(require(5084) /* metro dependency 5084: WebAuthnActionCreators */).fetchWebAuthnCredentials();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_101051(a0) { // fn#101051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13439:1573, offset: 0x02206567, size: 80 bytes, params: 2, frame: 15
|
|
let value = environment.__proto__;
|
|
value = require(3968) /* metro dependency 3968: DismissibleContentUnsafeUtils */;
|
|
const UNSAFE_markDismissibleContentAsDismissed = value.UNSAFE_markDismissibleContentAsDismissed;
|
|
const DismissibleContent = (Dismissible_contentModule).DismissibleContent;
|
|
const PASSWORDLESS_UPSELL = DismissibleContent.PASSWORDLESS_UPSELL;
|
|
return Reflect.apply(UNSAFE_markDismissibleContentAsDismissed, value, [PASSWORDLESS_UPSELL, {dismissAction: a0,
|
|
forceTrack: true}]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun101042, 13249, [6, 7, 15, 17, 18, 1226, 1878, 13243, 661, 8980, 3968, 1365, 4007, 5084, 13250, 4860,
|
|
2]) /* metro module 13249, dependencies: [6, 7, 15, 17, 18, 1226, 1878, 13243, 661, 8980, 3968, 1365, 4007, 5084, 13250, 4860, 2] */;
|