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

82 lines
2.7 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 16626
// Function ID: 16627
// Dependencies: [4090, 10536, 589, 4347, 16627, 2009, 10534, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 16626
2026-08-24 06:08:38 +00:00
import initialize from "initialize" /* 589 */;
2026-08-25 06:04:03 +00:00
import ACTION_SHEET_HEIGHT_HALFDefault from "ACTION_SHEET_HEIGHT_HALF" /* 4347 */;
import closure_3 from "setContent" /* 4090 */;
import { CAPTCHA_MODAL_KEY } from "CAPTCHA_SERVE_VOLUME_DISTRIBUTION_AGGREGATION_WINDOW_MS" /* 10536 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
const result = require("set").fileFinishedImporting("modules/captcha/CaptchaUtils.native.tsx");
2026-07-20 16:05:17 +00:00
export default {
showCaptcha(options) {
2026-07-23 10:11:24 +00:00
const _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);
obj = {
sitekey,
captchaService,
onCaptchaVerify(captcha_key, captcha_rqtoken) {
2026-07-23 10:11:24 +00:00
return callback({ captcha_key, captcha_rqtoken });
2026-07-20 16:05:17 +00:00
},
close() {
2026-07-29 08:29:29 +00:00
return callback2(table[3]).hideActionSheet(closure_4);
2026-07-20 16:05:17 +00:00
}
};
2026-08-24 06:08:38 +00:00
const obj2 = ACTION_SHEET_HEIGHT_HALFDefault;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(obj);
const merged1 = Object.assign(options.options);
2026-08-25 06:04:03 +00:00
obj2.openLazy(_require(2009)(16627, dependencyMap.paths), CAPTCHA_MODAL_KEY, obj);
2026-07-20 16:05:17 +00:00
},
showCaptchaAsync(nextResult1) {
let obj = arg1;
if (arg1 === undefined) {
obj = {};
}
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;
closure_1 = arg1;
obj = _undefined(_undefined2[3]);
2026-07-20 16:05:17 +00:00
obj = {
2026-07-23 10:11:24 +00:00
sitekey: closure_1,
captchaService: _undefined2,
2026-07-20 16:05:17 +00:00
onCaptchaVerify(captcha_key, captcha_rqtoken) {
2026-08-24 06:08:38 +00:00
return callback({ captcha_key, captcha_rqtoken, captcha_session_id: closure_1_3 });
2026-07-20 16:05:17 +00:00
},
onReject(arg0) {
2026-08-25 06:04:03 +00:00
if (arg0 === obj(10534).CaptchaError.CANCEL) {
const captchaCancelError = new obj(10534).CaptchaCancelError();
2026-07-23 10:11:24 +00:00
callback2(captchaCancelError);
2026-07-20 16:05:17 +00:00
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
2026-08-24 06:08:38 +00:00
error = new Error("Failed to display captcha for service " + closure_1_2 + ".");
2026-07-23 10:11:24 +00:00
callback2(error);
2026-07-20 16:05:17 +00:00
}
},
close() {
2026-08-25 06:04:03 +00:00
return callback2(4347).hideActionSheet(closure_4);
2026-07-20 16:05:17 +00:00
}
};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(closure_0);
const merged1 = Object.assign(c4);
obj.openLazy(obj(_undefined2[5])(_undefined2[4], _undefined2.paths), c4, obj, "stack");
2026-07-20 16:05:17 +00:00
});
},
useIsCaptchaModalOpen() {
2026-08-24 06:08:38 +00:00
const items = [closure_3];
return initialize.useStateFromStores(items, () => key.getKey() === closure_4);
2026-07-20 16:05:17 +00:00
}
};