decord/alpha/source/modules/captcha/CaptchaUtils.native.tsx

85 lines
2.8 KiB
TypeScript
Raw Normal View History

// Module ID: 17308
// Function ID: 17309
// Name: captcha/CaptchaUtils
// Dependencies: [4550, 5369, 504, 4809, 17309, 1981, 5361, 2]
2026-07-20 16:05:17 +00:00
// Module 17308 (captcha/CaptchaUtils)
import initialize from "initialize" /* 504 */;
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4809 */;
import SharedCaptchaUtils from "SharedCaptchaUtils" /* 5361 */;
import ActionSheetStore from "ActionSheetStore" /* 4550 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
require = fn;
const CAPTCHA_MODAL_KEY = fn(5369).CAPTCHA_MODAL_KEY;
const size = fn(2);
const result = size.fileFinishedImporting("modules/captcha/CaptchaUtils.native.tsx");
2026-07-20 16:05:17 +00:00
export default {
showCaptcha(options, arg1) {
_require = arg1;
2026-07-29 08:29:29 +00:00
let obj = arg2;
2026-07-20 16:05:17 +00:00
if (arg2 === undefined) {
obj = {};
}
({ sitekey, captchaService } = options);
const obj2 = ActionSheetActionCreatorsDefault;
const obj3 = {
2026-07-20 16:05:17 +00:00
sitekey,
captchaService,
onCaptchaVerify(captcha_key, captcha_rqtoken) {
return closure_0({ captcha_key, captcha_rqtoken });
2026-07-20 16:05:17 +00:00
},
close() {
return ActionSheetActionCreatorsDefault.hideActionSheet(CAPTCHA_MODAL_KEY);
2026-07-20 16:05:17 +00:00
}
};
const merged = Object.assign(obj);
const merged1 = Object.assign(options.options);
obj2.openLazy(require("asyncRequireImpl")(17309, dependencyMap.paths), CAPTCHA_MODAL_KEY, obj3);
2026-07-20 16:05:17 +00:00
},
showCaptchaAsync(nextResult1) {
if (arg1 === undefined) {
let obj = {};
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
c1 = undefined;
c2 = undefined;
c3 = undefined;
c4 = undefined;
({ sitekey: c1, captchaService: c2, captchaSessionId: c3, options: c4 } = nextResult1);
2026-07-20 16:05:17 +00:00
return new Promise((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
sitekey = arg1;
obj = sitekey(captchaService[3]);
const merged = Object.assign(closure_0);
const merged1 = Object.assign(c4);
obj.openLazy(obj(captchaService[5])(captchaService[4], captchaService.paths), c4, {
sitekey,
captchaService,
2026-07-20 16:05:17 +00:00
onCaptchaVerify(captcha_key, captcha_rqtoken) {
return closure_0({ captcha_key, captcha_rqtoken, captcha_session_id });
2026-07-20 16:05:17 +00:00
},
onReject(dependencyMap) {
if (dependencyMap === SharedCaptchaUtils.CaptchaError.CANCEL) {
const captchaCancelError = new SharedCaptchaUtils.CaptchaCancelError();
closure_1(captchaCancelError);
2026-07-20 16:05:17 +00:00
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
const error = new Error("Failed to display captcha for service " + c2 + ".");
closure_1(error);
2026-07-20 16:05:17 +00:00
}
},
close() {
return closure_1(captchaService[3]).hideActionSheet(closure_1_4);
2026-07-20 16:05:17 +00:00
}
}, "stack");
2026-07-20 16:05:17 +00:00
});
},
useIsCaptchaModalOpen() {
const items = [ActionSheetStore];
return initialize.useStateFromStores(items, () => key.getKey() === CAPTCHA_MODAL_KEY);
2026-07-20 16:05:17 +00:00
}
};