2026-10-12 16:32:48 +00:00
|
|
|
// Module ID: 5727
|
|
|
|
|
// Function ID: 5728
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: SharedCaptchaUtils
|
2026-10-12 16:32:48 +00:00
|
|
|
// Dependencies: [5728, 5735, 2]
|
2026-09-18 19:45:33 +00:00
|
|
|
// Exports: emitCaptchaDistributionMetric, extractCaptchaPropsFromResponse
|
|
|
|
|
|
2026-10-12 16:32:48 +00:00
|
|
|
// Module 5727 (SharedCaptchaUtils)
|
|
|
|
|
import CaptchaConstants from "CaptchaConstants" /* 5735 */;
|
|
|
|
|
import CaptchaStore from "CaptchaStore" /* 5728 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
|
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let _window;
|
|
|
|
|
let c2;
|
|
|
|
|
let map;
|
|
|
|
|
({ incrementCaptchaServeVolume: _window, flushCaptchaServeVolume: map, isCaptchaStoreVolumeEmpty: c2 } = CaptchaStore);
|
2026-09-18 19:45:33 +00:00
|
|
|
let closure_3 = CaptchaConstants.CAPTCHA_SERVE_VOLUME_DISTRIBUTION_AGGREGATION_WINDOW_MS;
|
2026-10-01 14:13:23 +00:00
|
|
|
class CaptchaCancelError extends Error {
|
|
|
|
|
constructor() {
|
|
|
|
|
const tmp2 = new tmp("Captcha cancelled", new.target);
|
|
|
|
|
return tmp2;
|
|
|
|
|
}
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
const result = size.fileFinishedImporting("modules/captcha/SharedCaptchaUtils.tsx");
|
|
|
|
|
|
|
|
|
|
export const CaptchaError = { CANCEL: "cancel", ERROR: "error", EXPIRED: "expired" };
|
|
|
|
|
export const extractCaptchaPropsFromResponse = function extractCaptchaPropsFromResponse(body) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let flag;
|
|
|
|
|
let obj2;
|
|
|
|
|
const obj = { captchaService: body.captcha_service, sitekey: body.captcha_sitekey, captchaSessionId: body.captcha_session_id, options: obj2 };
|
|
|
|
|
obj2 = { rqdata: body.captcha_rqdata, rqtoken: body.captcha_rqtoken, serveInvisible: flag, userflow: body.user_flow };
|
|
|
|
|
flag = body.should_serve_invisible;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (flag == null) {
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
|
|
|
|
return obj;
|
|
|
|
|
};
|
2026-10-02 13:37:24 +00:00
|
|
|
export const emitCaptchaDistributionMetric = function emitCaptchaDistributionMetric(userflow) {
|
2026-09-18 19:45:33 +00:00
|
|
|
if (React2()) {
|
|
|
|
|
const _setTimeout = setTimeout;
|
|
|
|
|
const timerId = setTimeout(() => closure_1_1(), closure_3);
|
|
|
|
|
}
|
2026-10-02 13:37:24 +00:00
|
|
|
React(userflow);
|
2026-09-18 19:45:33 +00:00
|
|
|
};
|
2026-10-01 14:13:23 +00:00
|
|
|
export { CaptchaCancelError };
|