This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+73
View File
@@ -0,0 +1,73 @@
// Metro module 5646 (f5647).
import { NativeModules } from "react-native";
import Logger from "../debug/Logger";
import { encodeUserIdForWebAuthn } from "./WebAuthnUtils";
let c3486_4 = new Logger("SignalHelpers.native");
const WEBAUTHN_ORIGIN = window.GLOBAL_ENV.WEBAUTHN_ORIGIN;
class SignalHelpers {
constructor() {
return {
__proto__: new.target.prototype
};
}
static async signalAllAcceptedCredentials(credentials, c14975_1) {
L11: {
if (NativeModules.DCDSecurityKeyManager.signalAllAcceptedCredentials !== void 0) {
const encodedId = encodeUserIdForWebAuthn(c14975_1);
const allAcceptedCredentialIds = credentials.map((credential) => credential.cred_id).filter((item) => item !== "");
c3486_4.info("signalAllAcceptedCredentials", {
rpId: WEBAUTHN_ORIGIN,
encodedId,
allAcceptedCredentialIds,
credentials
});
await NativeModules.DCDSecurityKeyManager.signalAllAcceptedCredentials(WEBAUTHN_ORIGIN, encodedId, allAcceptedCredentialIds).catch(c3486_4.warn);
break L11;
}
return void 0;
}
}
static async signalCurrentUserDetails(c14976_0) {
let username, email;
L15: {
if (NativeModules.DCDSecurityKeyManager.signalCurrentUserDetails !== void 0) {
const encodedId = encodeUserIdForWebAuthn(c14976_0.id);
const email2 = c14976_0.email;
email = email2;
if (email2 == null) {
email = c14976_0.global_name;
}
username = email;
if (email == null) {
username = c14976_0.username;
}
const name = username;
const username2 = c14976_0.username;
c3486_4.info("signalCurrentUserDetails", {
rpId: WEBAUTHN_ORIGIN,
encodedId,
name,
displayName: username2
});
await NativeModules.DCDSecurityKeyManager.signalCurrentUserDetails(WEBAUTHN_ORIGIN, encodedId, name, username2).catch(c3486_4.warn);
break L15;
}
return void 0;
}
}
static async signalUnknownCredential(c14977_0) {
L14: {
if (NativeModules.DCDSecurityKeyManager.signalUnknownCredential !== void 0) {
const credentialId = typeof c14977_0 === "string" ? JSON.parse(c14977_0).id : c14977_0.cred_id;
c3486_4.info("signalUnknownCredential", {
rpId: WEBAUTHN_ORIGIN,
credentialId
});
await NativeModules.DCDSecurityKeyManager.signalUnknownCredential(WEBAUTHN_ORIGIN, credentialId).catch(c3486_4.warn);
break L14;
}
return void 0;
}
}
}
export default SignalHelpers;
+129
View File
@@ -0,0 +1,129 @@
// Metro module 5645 (f5646).
import { Endpoints } from "../../Constants";
import { HTTP } from "../../_bundle/sendRequest";
import Dispatcher from "../../Dispatcher";
import TrackedHTTPUtils from "../../utils/TrackedHTTPUtils";
import { NetworkActionNames } from "../../_bundle/Module663";
export async function fetchWebAuthnConditionalChallenge() {
let c29540_0 = (await HTTP.post({
url: Endpoints.WEBAUTHN_CONDITIONAL_UI_CHALLENGE,
headers: {
authorization: ""
},
rejectWithError: true
})).body;
return {
challenge: c29540_0.challenge,
ticket: c29540_0.ticket
};
}
export async function fetchWebAuthnPasswordlessChallenge() {
let c29541_0 = (await HTTP.post({
url: Endpoints.WEBAUTHN_PASSWORDLESS_CHALLENGE,
rejectWithError: true
})).body;
return {
challenge: c29541_0.challenge,
ticket: c29541_0.ticket
};
}
export function fetchWebAuthnCredentials() {
HTTP.get({
url: Endpoints.MFA_WEBAUTHN_CREDENTIALS,
rejectWithError: true
}).then((result) => {
if (result.body != null) {
Dispatcher.dispatch({
type: "MFA_WEBAUTHN_CREDENTIALS_LOADED",
credentials: result.body.map((item) => ({
...item,
last_used: item.last_used != null ? new Date(item.last_used) : null
}))
});
}
});
}
export async function deleteWebAuthnCredential(c25523_0) {
const credential2 = c25523_0;
return await HTTP.del({
url: Endpoints.MFA_WEBAUTHN_CREDENTIAL(credential2.id),
rejectWithError: true
}).then(() => {
Dispatcher.dispatch({
type: "AUTHENTICATOR_DELETE",
credential: credential2
});
});
}
export async function editWebAuthnCredential(c25524_0, name) {
let c25524_3;
let c29543_1, c29543_2, c29543_3;
c25524_3 = void 0;
c29543_1 = void 0;
c29543_2 = void 0;
c29543_3 = void 0;
let c29543_0 = await HTTP.patch({
url: Endpoints.MFA_WEBAUTHN_CREDENTIAL(c25524_0),
body: {
name
},
rejectWithError: false
});
if (c29543_0.body != null) {
c29543_1 = c29543_0.body;
c29543_2 = c29543_1.last_used == null ? null : new Date(c29543_1.last_used);
c29543_3 = {
...c29543_1,
last_used: c29543_2
};
Dispatcher.dispatch({
type: "AUTHENTICATOR_UPDATE",
credential: c29543_3
});
}
}
export async function startRegisterWebAuthnCredential() {
let c29544_0 = (await HTTP.post({
url: Endpoints.MFA_WEBAUTHN_CREDENTIALS,
body: {},
rejectWithError: false
})).body;
return {
ticket: c29544_0.ticket,
challenge: c29544_0.challenge
};
}
export async function finishRegisterWebAuthnCredential(name2, ticket, credential) {
let c25526_4;
c25526_4 = void 0;
let c29545_0 = await TrackedHTTPUtils.post({
url: Endpoints.MFA_WEBAUTHN_CREDENTIALS,
body: {
name: name2,
ticket,
credential
},
trackedActionData: {
event: NetworkActionNames.WEBAUTHN_REGISTER
},
rejectWithError: true
});
Dispatcher.dispatch({
type: "AUTHENTICATOR_CREATE",
credential: c29545_0.body
});
Dispatcher.dispatch({
type: "MFA_ENABLE_SUCCESS",
codes: c29545_0.body.backup_codes
});
}
export function triggerWebAuthnRegister() {
Dispatcher.dispatch({
type: "WEBAUTHN_TRIGGER_REGISTER"
});
}
export function clearWebAuthnRegisterTrigger() {
Dispatcher.dispatch({
type: "WEBAUTHN_CLEAR_REGISTER_TRIGGER"
});
}
+10
View File
@@ -0,0 +1,10 @@
// Metro module 13752 (f13753).
const r8 = {
MODAL_UPSELL: "MODAL_UPSELL",
INIT: "INIT",
EDIT: "EDIT",
REGISTER: "REGISTER",
NAME: "NAME",
SUCCESS: "SUCCESS"
};
export { r8 as WebAuthnScreens };
@@ -0,0 +1,22 @@
// Metro module 16666 (f16667).
import AuthenticationStore from "../../stores/AuthenticationStore";
import AutomaticLifecycleManager from "../../lib/AutomaticLifecycleManager";
import SignalHelpers_native from "./SignalHelpers.native";
class WebAuthnSignalManager extends AutomaticLifecycleManager {
actions = {
AUTHENTICATOR_DELETE: this.handleAuthenticatorDelete,
MFA_WEBAUTHN_CREDENTIALS_LOADED: this.handleWebAuthnCredentialsLoaded,
CURRENT_USER_UPDATE: this.handleCurrentUserUpdate
};
async handleAuthenticatorDelete({ credential }) {
await SignalHelpers_native.signalUnknownCredential(credential);
}
async handleWebAuthnCredentialsLoaded({ credentials }) {
await SignalHelpers_native.signalAllAcceptedCredentials(credentials, AuthenticationStore.getId());
}
async handleCurrentUserUpdate({ user }) {
await SignalHelpers_native.signalCurrentUserDetails(user);
}
}
const webAuthnSignalManager = new WebAuthnSignalManager();
export default webAuthnSignalManager;
+84
View File
@@ -0,0 +1,84 @@
// Metro module 13751 (f13752).
import { AuthenticatorType } from "../../flow/Server";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c9565_2 = false;
const credentials = [];
let c9565_4 = false;
class WebAuthnStore extends Module589.Store {
static displayName = "WebAuthnStore";
hasFetchedCredentials() {
return c9565_2;
}
get hasCredentials() {
return credentials.length > 0;
}
getCredentials() {
return credentials;
}
hasPendingRegisterTrigger() {
return c9565_4;
}
}
const webAuthnStore = new WebAuthnStore(Dispatcher, {
LOGOUT: function handleReset() {
credentials = [];
c9565_2 = false;
c9565_4 = false;
},
MFA_WEBAUTHN_CREDENTIALS_LOADED: function handleWebAuthnCredentialsLoaded({ credentials: credentials2 }) {
let r0 = false;
if (credentials !== credentials2) {
credentials = credentials2;
r0 = true;
}
if (!c9565_2) {
c9565_2 = true;
r0 = true;
}
return r0;
},
AUTHENTICATOR_CREATE: function handleAuthenticatorCreate({ credential }) {
let r2;
if (credential.type === AuthenticatorType.WEBAUTHN) {
let r23 = credentials.find((a0) => a0.id === credential.id) === void 0;
if (r23) {
credentials = [...credentials, credential];
r23 = void 0;
}
r2 = r23;
} else {
credential.type;
r2 = false;
}
return r2;
},
AUTHENTICATOR_UPDATE: function handleAuthenticatorUpdate({ credential: credential2 }) {
if (credential2.type !== AuthenticatorType.WEBAUTHN) {
credential2.type;
return false;
}
credentials = credentials.map((credential) => credential.id === credential2.id ? credential2 : credential);
},
AUTHENTICATOR_DELETE: function handleAuthenticatorDelete({ credential: credential3 }) {
if (credential3.type !== AuthenticatorType.WEBAUTHN) {
credential3.type;
return false;
}
credentials = credentials.filter((credential) => credential.id !== credential3.id);
},
WEBAUTHN_TRIGGER_REGISTER: function handleTriggerRegister() {
if (c9565_4) {
return false;
}
c9565_4 = true;
},
WEBAUTHN_CLEAR_REGISTER_TRIGGER: function handleClearRegisterTrigger() {
if (c9565_4) {
c9565_4 = false;
return void 0;
}
return false;
}
});
export default webAuthnStore;
+3
View File
@@ -0,0 +1,3 @@
// Metro module 9198 (f9199).
class IgnorableWebAuthnError extends Error {}
export { IgnorableWebAuthnError };
+11
View File
@@ -0,0 +1,11 @@
// Metro module 5647 (f5648).
export function encodeUserIdForWebAuthn(a0) {
const uint8Array = new Uint8Array(16);
const dataView = new DataView(uint8Array.buffer);
dataView.setUint32(0, 821232635);
dataView.setUint16(4, 35878);
dataView.setUint16(6, 20307);
dataView.setBigUint64(8, BigInt(a0));
const r34 = String;
return btoa(r34.fromCharCode.apply(r34, [...uint8Array])).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
}
@@ -0,0 +1,226 @@
// Metro module 9197 (f9198).
import { NativeModules } from "react-native";
import Logger from "../../debug/Logger";
import { startRegisterWebAuthnCredential } from "../WebAuthnActionCreators";
import * as _PlatformUtils from "../../../utils/PlatformUtils";
import { IgnorableWebAuthnError } from "../WebAuthnTypes";
import { captureWebAuthnException } from "../../../utils/MFAUtils";
import { isMetaQuest } from "../../device/MetaQuestUtils.android";
function $mk82101($env) {
return (a0) => {
const r3 = $env[0];
if (r3 === void 0) {
throw a0;
}
const r7 = $env.$parent;
const r6 = r7[0];
const r8 = r7[1];
r3(r6(r8[4]).intl.string(r6(r8[4]).t.xSCvBf));
throw a0;
};
}
function $mk82102($env) {
return () => (0, $env[1])(false);
}
function $mk82103($env) {
return (a0) => {
const r5 = JSON.parse(a0);
r5.publicKey.authenticatorSelection.residentKey = "required";
return (0, $env[0])(JSON.stringify(r5));
};
}
let c6039_4;
let $mk82100 = function() {
return function promptForRegisterCredential() {
return env6039[5].apply(this, arguments);
};
};
let env6039 = {};
env6039[5] = function _promptForRegisterCredential() {
const r8 = async function(c26391_0) {
let r10 = c26391_0;
if (r10 === void 0) {
r10 = NativeModules.DCDSecurityKeyManager.register;
}
let c30060_0 = r10;
await void 0;
let c30060_1 = await startRegisterWebAuthnCredential();
let c30060_2 = c30060_1.ticket;
let c30060_3 = c30060_1.challenge;
const value = {};
value.ticket = c30060_2;
value.credential = await (0, c30060_0)(c30060_3);
return value;
};
env6039[5] = r8;
return r8.apply(this, arguments);
};
c6039_4 = new Logger("WebAuthnUtils");
const r27 = {};
Object.defineProperty(r27, "hasAndroidPasskeySupport", {
get: function() {
return _PlatformUtils.isAndroid() && NativeModules.DCDSecurityKeyManager?.registerPasskey != null;
},
set: void 0,
enumerable: true,
configurable: true
});
Object.defineProperty(r27, "shouldDisplayAndroidFidoSelector", {
get: function() {
return _PlatformUtils.isAndroid() && !isMetaQuest();
},
set: void 0,
enumerable: true,
configurable: true
});
r27.getPasskeyAuthenticator = function getPasskeyAuthenticator() {
let authenticate = NativeModules.DCDSecurityKeyManager.authenticate;
if (_PlatformUtils.isAndroid() && NativeModules.DCDSecurityKeyManager?.authenticatePasskey != null) {
authenticate = NativeModules.DCDSecurityKeyManager.authenticatePasskey;
}
return async function(...c26392_0) {
let r63;
let c26392_3;
let c26392_4 = 0;
let c30061_0, c30061_1;
try {
c30061_0 = c26392_0;
await void 0;
c26392_4 = 1;
r63 = await authenticate.apply(void 0, [...c30061_0]);
c26392_4 = 0;
} catch ($e) {
const r30 = $e;
let r7 = r30;
c26392_3 = r30;
if (c26392_4 !== 0) {
while (true) {
try {
const r82 = c26392_3;
c26392_4 = 0;
c30061_1 = r82;
const code = c30061_1.code;
if (code !== "AbortError" && code !== "NotAllowedError") {
captureWebAuthnException(c30061_1);
c6039_4.error(c30061_1);
throw c30061_1;
}
c6039_4.warn(c30061_1);
throw new IgnorableWebAuthnError();
} catch (r79) {
r7 = r79;
c26392_3 = r79;
if (c26392_4 === 0) {
break;
}
}
}
}
throw r7;
}
return r63;
};
};
r27.registerAndroidCredentialManagerPasskey = function registerAndroidCredentialManagerPasskey(a0) {
let env17064;
let env17065;
const registerPasskey2 = NativeModules.DCDSecurityKeyManager.registerPasskey;
const r4 = env17064 = {};
env17064[0] = registerPasskey2;
const r11 = env17065 = {
$parent: env6039
};
env17065[0] = void 0;
env17065[1] = void 0;
const { onRegisterSuccess, setError } = a0;
env17065[0] = setError;
const setRegistering = a0.setRegistering;
env17065[1] = setRegistering;
if (setError !== void 0) {
setError("");
}
const r14 = $mk82103(r4);
setRegistering(true);
return $mk82100()(r14).then(onRegisterSuccess).catch($mk82101(r11)).finally($mk82102(r11));
};
r27.registerAndroidDevicePasskey = function registerAndroidDevicePasskey(a0) {
let env17067;
let env17068;
const register = NativeModules.DCDSecurityKeyManager.register;
const r4 = env17067 = {};
env17067[0] = register;
const r11 = env17068 = {
$parent: env6039
};
env17068[0] = void 0;
env17068[1] = void 0;
const { onRegisterSuccess, setError } = a0;
env17068[0] = setError;
const setRegistering = a0.setRegistering;
env17068[1] = setRegistering;
if (setError !== void 0) {
setError("");
}
const r14 = $mk82103(r4);
setRegistering(true);
return $mk82100()(r14).then(onRegisterSuccess).catch($mk82101(r11)).finally($mk82102(r11));
};
r27.registerPasskey = function registerPasskey(a0) {
let r29;
let env17069;
const isAndroid = _PlatformUtils.isAndroid();
const DCDSecurityKeyManager = NativeModules.DCDSecurityKeyManager;
const r16 = env17069 = {
$parent: env6039
};
if (isAndroid) {
let env17070;
const registerPasskey2 = DCDSecurityKeyManager.registerPasskey;
const r31 = env17070 = {};
env17070[0] = registerPasskey2;
env17069[0] = void 0;
env17069[1] = void 0;
const { onRegisterSuccess: onRegisterSuccess2, setError: setError2 } = a0;
env17069[0] = setError2;
const setRegistering2 = a0.setRegistering;
env17069[1] = setRegistering2;
if (setError2 !== void 0) {
setError2("");
}
const r37 = $mk82103(r31);
setRegistering2(true);
r29 = $mk82100()(r37).then(onRegisterSuccess2).catch($mk82101(r16)).finally($mk82102(r16));
} else {
const register = DCDSecurityKeyManager.register;
env17069[0] = void 0;
env17069[1] = void 0;
const { onRegisterSuccess, setError } = a0;
env17069[0] = setError;
const setRegistering = a0.setRegistering;
env17069[1] = setRegistering;
if (setError !== void 0) {
setError("");
}
setRegistering(true);
r29 = $mk82100()(register).then(onRegisterSuccess).catch($mk82101(r16)).finally($mk82102(r16));
}
return r29;
};
r27.registerSecurityKey = function registerSecurityKey(a0, r4 = NativeModules.DCDSecurityKeyManager.register) {
let env17063;
const r10 = env17063 = {
$parent: env6039
};
env17063[0] = void 0;
env17063[1] = void 0;
const { onRegisterSuccess, setError } = a0;
env17063[0] = setError;
const setRegistering = a0.setRegistering;
env17063[1] = setRegistering;
if (setError !== void 0) {
setError("");
}
setRegistering(true);
return $mk82100()(r4).then(onRegisterSuccess).catch($mk82101(r10)).finally($mk82102(r10));
};
export default r27;
@@ -0,0 +1,31 @@
// Metro module 13758 (f13759).
import { UNSAFE_isDismissibleContentDismissed } from "../../dismissible_content/DismissibleContentUnsafeUtils";
import { DismissibleContent } from "../../../_bundle/Module1358";
import { requestMarkDismissibleContentAsShown } from "../../dismissible_content/DismissibleContentUtils";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
let c9570_3 = "PASSKEY_UPSELL_KEY";
const r14 = {
openPasskeyUpsell: function openPasskeyUpsell() {
if (!UNSAFE_isDismissibleContentDismissed(DismissibleContent.PASSWORDLESS_UPSELL)) {
requestMarkDismissibleContentAsShown(DismissibleContent.PASSWORDLESS_UPSELL);
this.openPasskeyUpsellPromoSheet();
}
},
openPasskeyUpsellModal: () => {
ModalActionCreators.pushLazy(import("./PasskeyUpsellFullModal"), void 0, c9570_3);
},
closePasskeyUpsellModal: () => {
ModalActionCreators.popWithKey(c9570_3);
},
openPasskeyUpsellPromoSheet: () => {
ActionSheetActionCreators.openLazy(import("./PasskeyUpsellPromoSheet"), c9570_3);
},
closePasskeyUpsellPromoSheet: () => {
ActionSheetActionCreators.hideActionSheet(c9570_3);
},
openPasskeyUpsellPromoModal: (a0) => {
ModalActionCreators.pushLazy(import("./PasskeyUpsellPromoModal"), a0, c9570_3);
}
};
export default r14;
@@ -0,0 +1,9 @@
// Metro module 13759 (f13760).
import { WebAuthnScreens } from "../WebAuthnConstants";
import { getScreens } from "./WebAuthnScreens";
import { Modal } from "../../../design/components/Modal/native/Modal.native";
export default function PasskeyUpsellFullModal() {
return <Modal screens={getScreens({
isModal: true
})} initialRouteName={WebAuthnScreens.MODAL_UPSELL} />;
};
@@ -0,0 +1,58 @@
// Metro module 13757 (f13758).
import AuthenticationStore from "../../../stores/AuthenticationStore";
import UserStore from "../../../stores/UserStore";
import WebAuthnStore from "../WebAuthnStore";
import { LoginStates } from "../../../Constants";
import AutomaticLifecycleManager from "../../../lib/AutomaticLifecycleManager";
import { hasWebAuthn } from "../../../utils/MFAUtils";
import { UNSAFE_isDismissibleContentDismissed, UNSAFE_markDismissibleContentAsDismissed } from "../../dismissible_content/DismissibleContentUnsafeUtils";
import { DismissibleContent } from "../../../_bundle/Module1358";
import { isModalOpen } from "../../main_tabs_v2/helpers/NavigationRouteUtils.native";
import { fetchWebAuthnCredentials } from "../WebAuthnActionCreators";
import PasskeyUpsellActionCreators from "./PasskeyUpsellActionCreators";
let c9569_7 = false;
let c9569_8 = false;
class PasskeyUpsellManager extends AutomaticLifecycleManager {
actions = {
POST_CONNECTION_OPEN: this.handlePasskeyUpsellShow,
LOGIN_RESET: this.handleLogout,
LOGIN_SUCCESS: this.handleLoginSuccess,
LOGOUT: this.handleLogout
};
stores = new Map().set(AuthenticationStore, this.handlePasskeyUpsellShow).set(UserStore, this.handlePasskeyUpsellShow).set(WebAuthnStore, this.handlePasskeyUpsellShow);
handlePasskeyUpsellShow() {
L15: {
if (c9569_8 && hasWebAuthn && AuthenticationStore.getLoginStatus() === LoginStates.NONE && AuthenticationStore.attemptedPasswordLogin() && !UNSAFE_isDismissibleContentDismissed(DismissibleContent.PASSWORDLESS_UPSELL)) {
if (WebAuthnStore.hasFetchedCredentials() && WebAuthnStore.hasCredentials) {
break L15;
}
if (!isModalOpen()) {
const currentUser = UserStore.getCurrentUser();
if (currentUser !== void 0 && currentUser.verified) {
if (WebAuthnStore.hasFetchedCredentials()) {
PasskeyUpsellActionCreators.openPasskeyUpsell();
} else if (!c9569_7) {
c9569_7 = true;
fetchWebAuthnCredentials();
}
}
}
}
}
}
handleLoginSuccess() {
c9569_8 = true;
}
handleLogout() {
c9569_7 = false;
c9569_8 = false;
}
markDismissed(a0) {
return UNSAFE_markDismissibleContentAsDismissed(DismissibleContent.PASSWORDLESS_UPSELL, {
dismissAction: a0,
forceTrack: true
});
}
}
const passkeyUpsellManager = new PasskeyUpsellManager();
export default passkeyUpsellManager;
@@ -0,0 +1,16 @@
// Metro module 13762 (f13763).
import { WebAuthnScreens } from "../WebAuthnConstants";
import { getScreens } from "./WebAuthnScreens";
import { intl, t } from "../../../intl/index.native";
import { Modal } from "../../../design/components/Modal/native/Modal.native";
export default function PasskeyUpsellPromoModal(props) {
return <Modal screens={getScreens({
isModal: true
})} initialRouteStack={[{
name: WebAuthnScreens.NAME,
params: {
...props,
name: intl.string(t["8H5RmH"])
}
}]} />;
};
@@ -0,0 +1,41 @@
// Metro module 13760 (f13761).
import { useState } from "react";
import { Image as Image2 } from "react-native";
import { ContentDismissActionType } from "../../dismissible_content/DismissibleContentConstants";
import * as _Module13761 from "../../../_bundle/Module13761";
import PasskeyUpsellActionCreators from "./PasskeyUpsellActionCreators";
import { PromoSheet } from "../../../design/components/Sheet/native/PromoSheet.native";
import { intl, t } from "../../../intl/index.native";
import { isIOS } from "../../../utils/PlatformUtils";
import PasskeyUpsellManager from "./PasskeyUpsellManager";
import { ButtonGroup } from "../../../design/components/ButtonGroup/native/ButtonGroup.native";
import { Button } from "../../../design/components/Button/native/Button.native";
import NativeCeremonies from "./NativeCeremonies";
export default function PasswordlessUpsellPromoSheet() {
const onRegisterSuccess2 = function onRegisterSuccess(a0) {
PasskeyUpsellActionCreators.closePasskeyUpsellPromoSheet();
PasskeyUpsellActionCreators.openPasskeyUpsellPromoModal(a0);
};
const illustration = <Image2 source={_Module13761} style={{
height: 190,
width: 220,
resizeMode: "contain"
}} />;
const [, setState] = useState("");
const [loading, setState2] = useState(false);
return <PromoSheet illustration={illustration} title={intl.string(t.CjleBl)} description={isIOS() ? intl.string(t["7yxR9t"]) : intl.string(t.d6uxJy)} onDismiss={() => PasskeyUpsellManager.markDismissed(ContentDismissActionType.USER_DISMISS)} actions={<ButtonGroup>
<Button size="lg" onPress={function onPress() {
PasskeyUpsellManager.markDismissed(ContentDismissActionType.TAKE_ACTION);
NativeCeremonies.registerPasskey({
setRegistering: setState2,
setError: setState,
onRegisterSuccess: onRegisterSuccess2
});
}} text={loading ? intl.string(t.wePEBF) : intl.string(t.NIFmCJ)} loading={loading} disabled={loading} />
<Button size="lg" variant="secondary" onPress={function onPress() {
PasskeyUpsellManager.markDismissed(ContentDismissActionType.USER_DISMISS);
PasskeyUpsellActionCreators.closePasskeyUpsellPromoSheet();
}} text={loading ? intl.string(t.wePEBF) : intl.string(t["7J6/nG"])} disabled={loading} />
</ButtonGroup>} />;
};
export const PASSWORDLESS_UPSELL_MODAL_KEY = "PASSWORDLESS_UPSELL_MODAL_KEY";
@@ -0,0 +1,20 @@
// Metro module 13754 (f13755).
import { useLayoutEffect } from "react";
import { WebAuthnScreens } from "../WebAuthnConstants";
import { getScreens } from "./WebAuthnScreens";
import { Navigator } from "../../../design/components/Navigator/native/Navigator.native";
export default function UserSettingsWebAuthn(props) {
const { navigation, initialRouteName = WebAuthnScreens.INIT, showNav = false } = props;
const headerShown = showNav;
const screens = getScreens({
isModal: false
});
useLayoutEffect(() => {
navigation.setOptions({
headerShown
});
});
return <Navigator screens={screens} initialRouteName={initialRouteName} initialRouteStack={[{
name: initialRouteName
}]} useContainer={false} />;
};
@@ -0,0 +1,81 @@
// Metro module 13764 (f13765).
import { Image as Image2, View } from "react-native";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import { BottomSheet } from "../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetTitleHeader } from "../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { intl, t } from "../../../intl/index.native";
import { ActionSheetCloseButton } from "../../../design/components/Sheet/native/ActionSheetCloseButton.native";
import Module13765 from "../../../_bundle/Module13765";
import { Text } from "../../../design/components/Text/native/Text";
import { Button } from "../../../design/components/Button/native/Button.native";
import { deleteWebAuthnCredential } from "../WebAuthnActionCreators";
import ToastActionCreators from "../../toast/native/ToastActionCreators";
import Module9690 from "../../../_bundle/Module9690";
import { CircleCheckIcon } from "../../../design/components/Icon/native/redesign/generated/CircleCheckIcon";
import Module8346 from "../../../_bundle/Module8346";
import { WarningIcon } from "../../../design/components/Icon/native/redesign/generated/WarningIcon";
const useStyles = createStyles({
content: {
alignItems: "center"
},
subtitle: {
textAlign: "center",
marginTop: Module712.space.PX_16
},
sheetContent: {
paddingHorizontal: Module712.space.PX_16,
paddingBottom: Module712.space.PX_16
},
sheetBody: {
gap: Module712.space.PX_16,
paddingBottom: Module712.space.PX_16
}
});
export default function WebAuthnDeleteActionSheet(props) {
const { credential, deleting, setDeleting } = props;
const handleClose = function handleClose() {
ActionSheetActionCreators.hideActionSheet();
};
const styles = useStyles();
return <BottomSheet contentStyles={styles.sheetContent} bodyStyles={styles.sheetBody}>
<BottomSheetTitleHeader title={intl.formatToPlainString(t.mI3CoL, {
keyName: credential.name
})} trailing={<ActionSheetCloseButton onPress={handleClose} />} />
<View style={styles.content}>
<Image2 source={Module13765} />
<Text variant="heading-md/normal" style={styles.subtitle}>
{intl.string(t.IfTbc1)}
</Text>
</View>
<View>
<Button text={intl.string(t["lqK//z"])} onPress={handleClose} variant="primary" grow />
</View>
<View>
<Button text={intl.string(t.zYOk0f)} onPress={function onPress() {
setDeleting(true);
ActionSheetActionCreators.hideActionSheet();
deleteWebAuthnCredential(credential).then(() => {
ToastActionCreators.open({
key: "WEBAUTHN_CREDENTIAL_DELETE_SUCCESS_TOAST_KEY",
content: intl.string(t.ZnkeXs),
icon: Module9690,
IconComponent: CircleCheckIcon,
iconColor: "status-positive"
});
}).catch((error) => {
ToastActionCreators.open({
key: "WEBAUTHN_CREDENTIAL_DELETE_ERROR_TOAST_KEY",
content: error.message,
icon: Module8346,
IconComponent: WarningIcon,
iconColor: "icon-feedback-critical"
});
}).finally(() => {
setDeleting(false);
});
}} variant="destructive" disabled={deleting} loading={deleting} grow />
</View>
</BottomSheet>;
};
@@ -0,0 +1,41 @@
// Metro module 13755 (f13756).
import { WebAuthnScreens } from "../WebAuthnConstants";
import PasskeyUpsellView from "./nav_steps/PasskeyUpsellView";
import { intl, t } from "../../../intl/index.native";
import PasskeyInitStep from "./nav_steps/PasskeyInitStep";
import { getHeaderCloseButton } from "../../../design/components/Navigator/native/NavigatorHeader.native";
import PasskeyUpsellActionCreators from "./PasskeyUpsellActionCreators";
import WebAuthnEditStep from "./nav_steps/WebAuthnEditStep";
import WebAuthnRegisterStep from "./nav_steps/WebAuthnRegisterStep";
import WebAuthnNameStep from "./nav_steps/WebAuthnNameStep";
import WebAuthnSuccessStep from "./nav_steps/WebAuthnSuccessStep";
export function getScreens({ isModal }) {
const r14 = {};
r14[WebAuthnScreens.MODAL_UPSELL] = {
title: "",
render: () => <PasskeyUpsellView />
};
r14[WebAuthnScreens.INIT] = {
title: intl.string(t["0N1s81"]),
render: () => <PasskeyInitStep />,
headerLeft: isModal ? getHeaderCloseButton(PasskeyUpsellActionCreators.closePasskeyUpsellModal) : void 0
};
r14[WebAuthnScreens.EDIT] = {
render: (a0) => <WebAuthnEditStep {...a0} />,
title: intl.string(t.UBBwwF)
};
r14[WebAuthnScreens.REGISTER] = {
render: () => <WebAuthnRegisterStep />,
title: intl.string(t.vrOCCk)
};
r14[WebAuthnScreens.NAME] = {
render: (a0) => <WebAuthnNameStep {...a0} />,
title: intl.string(t["cY/IOu"]),
headerLeft: isModal ? getHeaderCloseButton(PasskeyUpsellActionCreators.closePasskeyUpsellModal) : void 0
};
r14[WebAuthnScreens.SUCCESS] = {
render: () => <WebAuthnSuccessStep />,
title: intl.string(t["7wPZln"])
};
return r14;
}
@@ -0,0 +1,125 @@
// Metro module 13763 (f13764).
import { useState, useEffect, useLayoutEffect } from "react";
import { Image as Image2, View } from "react-native";
import WebAuthnStore from "../../WebAuthnStore";
import { WebAuthnScreens } from "../../WebAuthnConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useStateFromStoresObject } from "../../../../_bundle/Module589";
import Module13753 from "../../../../_bundle/Module13753";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { ButtonGroup } from "../../../../design/components/ButtonGroup/native/ButtonGroup.native";
import { IconButton } from "../../../../design/components/Button/native/IconButton.native";
import { TrashIcon } from "../../../../design/components/Icon/native/redesign/generated/TrashIcon";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { PencilIcon } from "../../../../design/components/Icon/native/redesign/generated/PencilIcon";
import { TableRowGroup } from "../../../../design/components/TableRow/native/TableRowGroup.native";
import { TableRow } from "../../../../design/components/TableRow/native/TableRow.native";
import { formatDate } from "../../../auth_sessions/AuthSessionsUtils";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { fetchWebAuthnCredentials } from "../../WebAuthnActionCreators";
import { hasWebAuthn } from "../../../../utils/MFAUtils";
import { HeaderActionButton } from "../../../../design/components/Navigator/native/HeaderActionButton.native";
import { Form } from "../../../../design/void/Form/native/index";
import { HermesBuiltin } from "../../../../_hermes/prelude";
let useStyles;
const CredentialList = function CredentialList(props) {
let styles, state, setState;
const navigation = props.navigation;
styles = void 0;
state = void 0;
setState = void 0;
const credentials = useStateFromStoresObject([WebAuthnStore], () => ({
credentials: WebAuthnStore.getCredentials()
})).credentials;
styles = useStyles();
[state, setState] = useState(false);
if (credentials.length === 0) {
return <View style={styles.upsellContainer}>
<Image2 source={Module13753} style={styles.keychainImage} />
<Text variant="text-md/normal" style={styles.upsellText}>
{intl.string(t.FSNwFW)}
</Text>
</View>;
}
return <TableRowGroup title={intl.string(t["4RIqrQ"])} hasIcons={false}>
{credentials.map((a0) => {
const credential = a0;
return <TableRow key={a0.id} label={a0.name} trailing={<ButtonGroup style={styles.iconButtonGroup}>
<IconButton variant="secondary" icon={<TrashIcon color={Module712.colors.TEXT_FEEDBACK_CRITICAL} />} accessibilityLabel={intl.string(t.N86XcP)} size="sm" disabled={state} loading={state} onPress={() => ActionSheetActionCreators.openLazy(import("../WebAuthnDeleteActionSheet"), "WEBAUTHN_DELETE_SHEET_KEY", {
credential,
deleting: state,
setDeleting: setState
})} />
<IconButton variant="secondary" icon={<PencilIcon />} accessibilityLabel={intl.string(t.bt75uw)} size="sm" disabled={state} loading={state} onPress={() => {
navigation.push(WebAuthnScreens.EDIT, {
credential
});
}} />
</ButtonGroup>} subLabel={a0.last_used != null ? intl.format(t["7JgxF5"], {
lastUsed: formatDate(a0.last_used)
}) : null} />;
})}
</TableRowGroup>;
};
useStyles = createStyles({
container: {
flex: 1,
flexDirection: "column",
alignItems: "stretch",
justifyContent: "space-between",
marginLeft: Module712.space.PX_16,
marginRight: Module712.space.PX_16,
marginTop: Module712.space.PX_8
},
upsellContainer: {
marginTop: Module712.space.PX_16,
alignItems: "center"
},
upsellText: {
color: Module712.colors.TEXT_SUBTLE,
marginTop: Module712.space.PX_16,
textAlign: "center"
},
iconButtonGroup: {
flexDirection: "row",
paddingVertical: Module712.space.PX_8
},
keychainImage: {
height: 125,
width: 161
}
});
export default function PasskeyInitStep(props) {
if (props == null) {
HermesBuiltin.throwTypeError("Cannot destructure 'undefined' or 'null'.");
throw new Error("unreachable");
}
const navigation2 = useNavigation();
const styles2 = useStyles();
const hasFetchedCredentials = useStateFromStoresObject([WebAuthnStore], () => ({
hasFetchedCredentials: WebAuthnStore.hasFetchedCredentials()
})).hasFetchedCredentials;
useEffect(() => {
if (!hasFetchedCredentials) {
fetchWebAuthnCredentials();
}
}, [hasFetchedCredentials]);
useLayoutEffect(() => {
navigation2.setOptions({
headerRight: () => {
if (hasWebAuthn) {
return <HeaderActionButton text={intl.string(t.OYkgVk)} onPress={() => {
navigation2.push(WebAuthnScreens.REGISTER);
}} foregroundRipple />;
}
}
});
}, [navigation2]);
return <Form>
<View style={styles2.container}>
<CredentialList navigation={navigation2} />
</View>
</Form>;
};
@@ -0,0 +1,131 @@
// Metro module 13756 (f13757).
import { useState, useLayoutEffect } from "react";
import { Image as Image2, ScrollView, View } from "react-native";
import { WebAuthnScreens } from "../../WebAuthnConstants";
import { HelpdeskArticles } from "../../../../Constants";
import { ContentDismissActionType } from "../../../dismissible_content/DismissibleContentConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { intl, t } from "../../../../intl/index.native";
import PasskeyUpsellManager from "../PasskeyUpsellManager";
import PasskeyUpsellActionCreators from "../PasskeyUpsellActionCreators";
import { getHeaderCloseButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
import HelpdeskUtils from "../../../../utils/HelpdeskUtils";
import { SafeAreaPaddingView } from "../../../../components_native/common/SafeAreaView";
import Module13761 from "../../../../_bundle/Module13761";
import { Text } from "../../../../design/components/Text/native/Text";
import { isIOS } from "../../../../utils/PlatformUtils";
import { Button } from "../../../../design/components/Button/native/Button.native";
import NativeCeremonies from "../NativeCeremonies";
const useStyles = createStyles({
container: {
flex: 1,
flexDirection: "column",
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW
},
scrollViewContainer: {
flexGrow: 1,
justifyContent: "space-between",
paddingHorizontal: Module712.space.PX_16
},
headerContainer: {
alignItems: "center",
justifyContent: "center",
gap: Module712.space.PX_16
},
headerImage: {
height: 190,
width: 220,
resizeMode: "contain"
},
headerText: {
textAlign: "center"
},
circleIcon: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST,
width: Module712.space.PX_32,
height: Module712.space.PX_32,
borderRadius: Module712.radii.round
},
listContainer: {
gap: Module712.space.PX_24,
marginLeft: Module712.space.PX_8,
marginRight: Module712.space.PX_8
},
row: {
flexDirection: "row",
gap: Module712.space.PX_8,
alignItems: "center"
},
text: {
flex: 1
},
buttonContainer: {
gap: Module712.space.PX_16,
alignItems: "center"
}
});
export default function PasskeyUpsellView() {
let navigation, onCancel2;
const onRegisterSuccess2 = function onRegisterSuccess(a0) {
navigation.push(WebAuthnScreens.NAME, {
...a0,
name: intl.string(t["8H5RmH"])
});
};
onCancel2 = function onCancel() {
PasskeyUpsellManager.markDismissed(ContentDismissActionType.USER_DISMISS);
PasskeyUpsellActionCreators.closePasskeyUpsellModal();
};
navigation = useNavigation();
const styles = useStyles();
const [, setState] = useState("");
const [disabled, setState2] = useState(false);
useLayoutEffect(() => {
navigation.setOptions({
headerLeft: getHeaderCloseButton(onCancel2)
});
}, [navigation]);
const articleURL = HelpdeskUtils.getArticleURL(HelpdeskArticles.SETTING_UP_TWO_FACTOR);
const r98 = [<View style={styles.headerContainer}>
<Image2 source={Module13761} style={styles.headerImage} />
<Text accessibilityRole="header" variant="heading-xl/bold" color="mobile-text-heading-primary" style={styles.headerText}>
{intl.string(t.CjleBl)}
</Text>
<Text variant="heading-md/normal" color="text-default" style={styles.headerText}>
{isIOS() ? intl.string(t["7yxR9t"]) : intl.string(t.d6uxJy)}
</Text>
</View>, , ,];
const r122 = [<View style={styles.row}>
<View style={styles.circleIcon} />
<Text variant="heading-md/normal" color="text-default" style={styles.text}>
{intl.string(t.HtqVkj)}
</Text>
</View>, <View style={styles.row}>
<View style={styles.circleIcon} />
<Text variant="heading-md/normal" color="text-default" style={styles.text}>
{isIOS() ? intl.string(t.U409I8) : intl.string(t.uYfqlo)}
</Text>
</View>];
r98[1] = <View style={styles.listContainer}>{r122}</View>;
r98[2] = <View style={styles.buttonContainer}>
<Text variant="text-sm/semibold" color="text-brand">
{intl.format(t.OeGXVv, {
learnMoreLink: articleURL
})}
</Text>
<Button text={disabled ? intl.string(t.wePEBF) : intl.string(t.NIFmCJ)} onPress={function onPress() {
PasskeyUpsellManager.markDismissed(ContentDismissActionType.TAKE_ACTION);
NativeCeremonies.registerPasskey({
setRegistering: setState2,
setError: setState,
onRegisterSuccess: onRegisterSuccess2
});
}} size="lg" disabled={disabled} loading={disabled} grow />
<Button text={disabled ? intl.string(t.wePEBF) : intl.string(t["7J6/nG"])} onPress={onCancel2} size="lg" variant="secondary" grow />
</View>;
return <SafeAreaPaddingView bottom style={styles.container}>
<ScrollView contentContainerStyle={styles.scrollViewContainer}>{r98}</ScrollView>
</SafeAreaPaddingView>;
};
@@ -0,0 +1,59 @@
// Metro module 13768 (f13769).
import { useState, useLayoutEffect } from "react";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { getHeaderBackButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
import { Form, FormInput, FormDivider } from "../../../../design/void/Form/native/index";
import { intl, t } from "../../../../intl/index.native";
import { ClearButtonVisibility } from "../../../../design/void/native";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { editWebAuthnCredential } from "../../WebAuthnActionCreators";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import Module9690 from "../../../../_bundle/Module9690";
import { CircleCheckIcon } from "../../../../design/components/Icon/native/redesign/generated/CircleCheckIcon";
const useStyles = createStyles({
inputField: {
marginBottom: Module712.space.PX_16
},
form: {
paddingHorizontal: Module712.space.PX_16
}
});
export default function EditCredentialModal(props) {
const credential = props.credential;
const styles = useStyles();
const navigation = useNavigation();
const [disabled, setState] = useState(false);
const [state, onChange] = useState("");
const [error, setState2] = useState(null);
useLayoutEffect(() => {
navigation.setOptions({
headerLeft: getHeaderBackButton(() => {
navigation.pop();
})
});
}, [navigation]);
return <Form style={styles.form}>
<FormInput showTopContainer={false} value={state} onChange={onChange} style={styles.inputField} error={error} title={intl.string(t["Jzd+z/"])} placeholder={credential.name} disabled={disabled} clearButtonVisibility={ClearButtonVisibility.WITH_CONTENT} autoFocus showBorder required large />
<FormDivider />
<Button onPress={function onPress() {
setState(true);
setState2(null);
editWebAuthnCredential(credential.id, state).then(() => {
ToastActionCreators.open({
key: "WEBAUTHN_CREDENTIAL_EDIT_SUCCESS_TOAST_KEY",
content: intl.string(t.IV13mH),
icon: Module9690,
IconComponent: CircleCheckIcon,
iconColor: "status-positive"
});
navigation.popToTop();
}).catch((error) => {
setState2(error.body.message);
}).finally(() => {
setState(false);
});
}} disabled={disabled || state === ""} loading={disabled} size="lg" text={intl.string(t["7asiR3"])} grow />
</Form>;
};
@@ -0,0 +1,113 @@
// Metro module 13772 (f13773).
import _slicedToArray from "../../../../_bundle/_slicedToArray";
import { useState } from "react";
import { View } from "react-native";
import { WebAuthnScreens } from "../../WebAuthnConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { finishRegisterWebAuthnCredential } from "../../WebAuthnActionCreators";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import { intl, t } from "../../../../intl/index.native";
import Module9690 from "../../../../_bundle/Module9690";
import { CircleCheckIcon } from "../../../../design/components/Icon/native/redesign/generated/CircleCheckIcon";
import { Form, FormInput, FormDivider } from "../../../../design/void/Form/native/index";
import { ClearButtonVisibility } from "../../../../design/void/native";
import { Button } from "../../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
margin: {
margin: 16
}
});
export default function WebAuthnNameStep(props) {
let navigation, setState, setState2, state;
const { ticket, credential } = props;
let name = props.name;
navigation = void 0;
setState = void 0;
setState2 = void 0;
state = void 0;
let _onPress2 = function _onPress() {
const r9 = async () => {
let c30666_2;
let c30666_3 = 0;
try {
c30666_3 = 2;
setState(true);
await finishRegisterWebAuthnCredential(state, ticket, credential);
c30666_3 = 0;
(0, setState)(false);
ToastActionCreators.open({
key: "WEBAUTHN_CREDENTIAL_REGISTER_SUCCESS_TOAST_KEY",
content: intl.string(t.j3d5qI),
icon: Module9690,
IconComponent: CircleCheckIcon,
iconColor: "status-success"
});
navigation.push(WebAuthnScreens.SUCCESS, {});
} catch ($e) {
const r33 = $e;
let r7 = r33;
c30666_2 = r33;
let r34 = c30666_3;
if (r34 !== 0) {
while (true) {
if (r34 !== 1) {
try {
const r100 = c30666_2;
c30666_3 = 1;
(0, setState2)(r100.body.message);
c30666_3 = 0;
(0, setState)(false);
} catch (r98) {
r7 = r98;
c30666_2 = r98;
r34 = c30666_3;
if (r34 === 0) {
break;
}
continue;
}
return void 0;
}
try {
const r115 = c30666_2;
c30666_3 = 0;
(0, setState)(false);
throw r115;
} catch (r113) {
r7 = r113;
c30666_2 = r113;
r34 = c30666_3;
if (r34 === 0) {
break;
}
}
}
}
throw r7;
}
};
_onPress2 = r9;
return r9.apply(this, arguments);
};
const styles = useStyles();
navigation = useNavigation();
let disabled;
[disabled, setState] = useState(false);
let error;
[error, setState2] = useState(null);
if (name == null) {
name = "";
}
const r38 = _slicedToArray(useState(name), 2);
state = r38[0];
return <Form>
<FormInput showTopContainer={false} value={state} onChange={r38[1]} style={styles.margin} error={error} title={intl.string(t["Jzd+z/"])} placeholder={intl.string(t["I/sJtJ"])} disabled={disabled} clearButtonVisibility={ClearButtonVisibility.WITH_CONTENT} autoFocus showBorder required large />
<FormDivider />
<View style={styles.margin}>
<Button onPress={function onPress() {
return _onPress2.apply(this, arguments);
}} text={intl.string(t["5dyZ1S"])} disabled={state === ""} size="lg" />
</View>
</Form>;
};
@@ -0,0 +1,96 @@
// Metro module 13769 (f13770).
import { useState, useCallback, useMemo } from "react";
import { View } from "react-native";
import { WebAuthnScreens } from "../../WebAuthnConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import NativeCeremonies from "../NativeCeremonies";
import { intl, t } from "../../../../intl/index.native";
import { RadioGroup } from "../../../../design/void/native";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { isAndroid } from "../../../../utils/PlatformUtils";
import { SafeAreaPaddingView } from "../../../../components_native/common/SafeAreaView";
import { KeyImage } from "../../../mfa/native/components/KeyImage";
import { Text } from "../../../../design/components/Text/native/Text";
import { ButtonGroup } from "../../../../design/components/ButtonGroup/native/ButtonGroup.native";
import { Button } from "../../../../design/components/Button/native/Button.native";
let useStyles, c9579_10, c9579_11;
const AndroidPasskeyRadioGroup = function AndroidPasskeyRadioGroup(props) {
const { authenticatorSelection, onChange: onChange2, registering } = props;
return <RadioGroup style={useStyles().radioItem} options={[{
value: c9579_10.PASSKEY_CREDENTIAL_MANAGER,
name: intl.string(t.JQbo8L)
}, {
value: c9579_10.PASSKEY_DEVICE,
name: intl.string(t.GjBNMg)
}, {
value: c9579_10.OTHER_AND_ANDROID_NONDISCOVERABLE,
name: intl.string(t["OhC77+"])
}]} onChange={(event) => onChange2(event.value)} value={authenticatorSelection} disabled={registering} size={RadioGroup.Sizes.LARGE} withSpacing />;
};
useStyles = createStyles({
flexContainer: {
flex: 1,
flexDirection: "column",
alignItems: "stretch",
justifyContent: "space-between",
marginLeft: 16,
marginRight: 16,
marginTop: 16
},
centerFlex: {
display: "flex",
alignItems: "center"
},
margin: {
marginTop: 16,
textAlign: "center"
},
radioItem: {
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
borderRadius: Module712.radii.md
}
});
c9579_10 = {
PASSKEY_CREDENTIAL_MANAGER: 0,
0: "PASSKEY_CREDENTIAL_MANAGER",
PASSKEY_DEVICE: 1,
1: "PASSKEY_DEVICE",
OTHER_AND_ANDROID_NONDISCOVERABLE: 2,
2: "OTHER_AND_ANDROID_NONDISCOVERABLE"
};
const r52 = {};
r52[c9579_10.PASSKEY_CREDENTIAL_MANAGER] = NativeCeremonies.registerPasskey;
r52[c9579_10.PASSKEY_DEVICE] = NativeCeremonies.registerAndroidDevicePasskey;
r52[c9579_10.OTHER_AND_ANDROID_NONDISCOVERABLE] = NativeCeremonies.registerSecurityKey;
c9579_11 = r52;
export default function WebAuthnRegisterStep() {
let memo, memo2;
const navigation = useNavigation();
const styles = useStyles();
const [registering, setState] = useState(false);
const [state2, setState2] = useState("");
const [state, onChange3] = useState(isAndroid() ? c9579_10.PASSKEY_CREDENTIAL_MANAGER : c9579_10.OTHER_AND_ANDROID_NONDISCOVERABLE);
const callback = useCallback((a0) => {
navigation.push(WebAuthnScreens.NAME, a0);
}, [navigation]);
memo = useMemo(() => c9579_11[state], [state]);
memo2 = useMemo(() => ({
onRegisterSuccess: callback,
setError: setState2,
setRegistering: setState
}), [callback, setState2, setState]);
return <SafeAreaPaddingView bottom left right style={styles.flexContainer}>
<View style={styles.centerFlex}>
<KeyImage />
<Text style={styles.margin} variant="text-md/normal">
{registering ? intl.string(t.aVMiX3) : intl.string(t.Lh5vTW)}
</Text>
{state2 != null && <Text variant="text-md/normal" color="text-feedback-critical">{state2}</Text>}
</View>
{NativeCeremonies.shouldDisplayAndroidFidoSelector && <AndroidPasskeyRadioGroup authenticatorSelection={state} registering={registering} onChange={onChange3} />}
<ButtonGroup>
<Button text={registering ? intl.string(t.wePEBF) : intl.string(t.oibaQa)} disabled={registering} loading={registering} onPress={() => memo(memo2)} size="lg" />
</ButtonGroup>
</SafeAreaPaddingView>;
};
@@ -0,0 +1,19 @@
// Metro module 13773 (f13774).
import { useLayoutEffect } from "react";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { getHeaderCloseButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
import PasskeyUpsellActionCreators from "../PasskeyUpsellActionCreators";
import UserSettingsAccountBackupCodes from "../../../user_settings/account/native/UserSettingsAccountBackupCodes";
import { intl, t } from "../../../../intl/index.native";
export default function WebAuthnSuccessStep() {
const navigation = useNavigation();
useLayoutEffect(() => {
navigation.setOptions({
headerLeft: getHeaderCloseButton(() => {
navigation.popToTop();
PasskeyUpsellActionCreators.closePasskeyUpsellModal();
})
});
}, [navigation]);
return <UserSettingsAccountBackupCodes onGenerate={null} headerLabel={intl.format(t.iVTs6i, {})} />;
};