decord/source/modules/auth/native/components/VerifyPhone.tsx
github-actions ecf26fc058 chore: update source for alpha 347.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
2026-09-16 07:03:15 +00:00

181 lines
5.9 KiB
TypeScript

// Module ID: 16104
// Function ID: 16105
// Name: components/VerifyPhone
// Dependencies: [5, 32, 19, 16076, 16077, 1074, 21, 16073, 16092, 5077, 7155, 1115, 7189, 16105, 7190, 2]
// Exports: default
// Module 16104 (components/VerifyPhone)
import RegistrationBailoutButtonDefault from "RegistrationBailoutButton" /* 16105 */;
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
const require = globalThis.__r;
const require = fn;
let closure_6 = fn(16076).doesRegistrationHaveIdentityType;
const RegistrationConstants = fn(16077);
({ authStateToRegisterTransitionStep: closure_7, RegisterTransitionSteps: closure_8, RegistrationTransitionActionTypes: closure_9 } = RegistrationConstants);
const Links = fn(1074).Links;
const jsx = fn(21).jsx;
const size = fn(2);
const result = size.fileFinishedImporting("modules/auth/native/components/VerifyPhone.tsx");
export default function VerifyPhone(phone) {
phone = phone.phone;
_require = phone;
const onPhoneTokenReceived = phone.onPhoneTokenReceived;
({ onClose: dependencyMap, onBail } = phone);
_slicedToArray = undefined;
noop = undefined;
c6 = undefined;
({ title, description, sourceState } = phone);
[obj.loading, _slicedToArray] = noop.useState(false);
[tmp3, c5] = _slicedToArray(noop.useState(null), 2);
let tmp2 = _slicedToArray(noop.useState(null), 2);
[tmp5, c6] = _slicedToArray(noop.useState(false), 2);
closure_7 = noop.useRef(false);
const context = noop.useContext(require("Auth").TrackRegistrationContext);
const tmp4 = _slicedToArray(noop.useState(false), 2);
onPhoneTokenReceived(16092)(closure_7(sourceState));
const items = [context];
const effect = noop.useEffect(() => {
if (_undefined()) {
const obj = { step: constants.PHONE_VERIFICATION, actionType: constants2.VIEWED };
context(obj);
}
}, items);
onPhoneTokenReceived(5077)(() => () => {
let tmpResult;
if (dependencyMap != null) {
tmpResult = tmp(ref.current);
}
return tmpResult;
});
onBail(function*(arg0) {
closure_2 = tmp3;
v0(true);
v0 = 1;
if (v3()) {
context({ step: context.PHONE_VERIFICATION, actionType: callback.SUBMITTED });
}
yield onPhoneTokenReceived(7155).verifyPhone(closure_0, closure_0, false);
if (1 === tmp7) {
v0 = 0;
closure_129_1 = closure_3;
v0(false);
if (v3()) {
context({ step: context.PHONE_VERIFICATION, actionType: callback.RESPONSE_ERROR, details: ["code"] });
}
const body = closure_129_1.body;
let message;
if (body != null) {
message = body.message;
}
if (!message) {
const intl = closure_0(1115).intl;
message = intl.format(closure_0(1115).t.aTVNes, { statusPageURL: constants.STATUS });
}
_undefined(message);
v3 = 3;
} else if (arg0 === 1) {
v3 = 3;
throw arg1;
} else if (arg0 !== 2) {
const token = arg1.token;
closure_1_7.current = true;
onPhoneTokenReceived(token);
v0 = 0;
}
v0 = 0;
return arg1;
});
const items1 = [phone, onPhoneTokenReceived, context];
const onCodeEntered = noop.useCallback(function() {
const self = this;
const apply = closure_0.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}, items1);
_require = onBail(function*(arg0, value) {
if (c3 === 2) {
c3 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw value;
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
c3 = 2;
if (0 === c2) {
if (arg0 === 1) {
c3 = 3;
throw value;
} else if (arg0 === 2) {
c3 = 3;
const obj3 = { value, done: true };
return obj3;
} else {
closure_1 = tmp4;
_undefined(true);
c2 = 1;
c3 = 1;
const obj4 = { value: onCodeEntered(closure_0), done: false };
return obj4;
}
} else if (arg0 === 1) {
c3 = 3;
throw value;
} else if (arg0 === 2) {
c3 = 3;
const obj = { value, done: true };
return obj;
} else {
_undefined(false);
c3 = 3;
return { value: "HermesInternal", done: null };
}
} catch (tmp12) {
c3 = tmp;
throw tmp12;
}
}
});
const items2 = [onCodeEntered];
const callback1 = noop.useCallback(function() {
const self = this;
const apply = closure_0.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}, items2);
onPhoneTokenReceived(7189)(callback1);
const items3 = [onBail];
const memo = noop.useMemo(() => {
let tmp2 = null;
if (null != onBail) {
const obj = { onBail: tmp };
tmp2 = jsx(RegistrationBailoutButtonDefault, { onBail: tmp });
}
return tmp2;
}, items3);
let obj = { title, description, error: tmp3, onCodeEntered, codeType: null, footer: null, disabled: null, loading: null, disableKeyboardAvoidingView: true };
const tmp7 = onPhoneTokenReceived(16092);
obj.codeType = require("CodeField").CodeType.NUMERIC;
obj.footer = memo;
obj.disabled = tmp5;
return jsx(onPhoneTokenReceived(7190), { title, description, error: tmp3, onCodeEntered, codeType: null, footer: null, disabled: null, loading: null, disableKeyboardAvoidingView: true });
};