Files
discord-decomp/sources/modules/captcha/CaptchaStore.tsx
T
2026-07-28 01:06:53 +03:00

119 lines
6.1 KiB
TypeScript

/* Metro module 9487; source: modules/captcha/CaptchaStore.tsx; dependencies: [57, 629, 690, 4826, 4831, 2] */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as Module00629Module from '../../by-id/module-00629.js'; /* Metro dependency 629 */
import * as ReactBatchUpdatesNativeModule from '../../external/discord_common/js/shared/utils/ReactBatchUpdates.native.tsx'; /* Metro dependency 690 */
function _fun74068(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74068, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9673:6, offset: 0x01d7f98d, size: 185 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = Module00629Module;
value = value.create(function() {
return {captchaServeVolume: {}};
});
(FileImportTrackerModule).fileFinishedImporting('modules/captcha/CaptchaStore.tsx');
exports.useCaptchaStore = value;
exports.isCaptchaStoreVolumeEmpty = isCaptchaStoreVolumeEmpty;
exports.incrementCaptchaServeVolume = incrementCaptchaServeVolume;
exports.flushCaptchaServeVolume = flushCaptchaServeVolume;
function isCaptchaStoreVolumeEmpty() { // fn#74070, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9673:270, offset: 0x01d7fa51, size: 54 bytes, params: 1, frame: 12
const Object = global.Object;
const keys = Object.keys;
const binding = env0_4;
const getState = binding.getState;
return Reflect.apply(keys, Object, [Reflect.apply(getState, binding, []).captchaServeVolume]).length === 0;
}
function incrementCaptchaServeVolume(a0) { // fn#74071, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9673:401, offset: 0x01d7fa87, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(ReactBatchUpdatesNativeModule).batchUpdates(_fun74072);
function _fun74072() { // fn#74072, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9673:463, offset: 0x01d7fabd, size: 31 bytes, params: 1, frame: 11
env1_4.setState(_fun74073);
function _fun74073(a0) { // fn#74073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9673:480, offset: 0x01d7fadc, size: 107 bytes, params: 2, frame: 17
var r0;
var binding;
var captchaServeVolume;
var value3;
var object;
var object2;
const value = a0;
if (env1_0 == null) {
r0 = value;
} else {
binding = env1_0;
captchaServeVolume = value.captchaServeVolume;
value3 = binding in captchaServeVolume;
object = {};
object2 = {};
captchaServeVolume = value.captchaServeVolume;
copyDataProperties(object2, captchaServeVolume, undefined);
binding = env1_0;
if (value3) {
object2[binding] = value.captchaServeVolume[binding] + 1;
object.captchaServeVolume = object2;
r0 = object;
} else {
object2[binding] = 1;
object.captchaServeVolume = object2;
r0 = object;
}
}
return r0;
}
}
}
function flushCaptchaServeVolume() { // fn#74074, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9673:681, offset: 0x01d7fb47, size: 246 bytes, params: 1, frame: 29
var r4;
var property;
var value4;
var property2;
var defaultImport;
var distribution;
var MetricEvents;
var CAPTCHA_SERVE_VOLUME_DISTRIBUTION;
var value5;
var value6;
const Object = global.Object;
const entries = Object.entries;
const binding = env0_4;
const getState = binding.getState;
const value2 = Reflect.apply(entries, Object, [Reflect.apply(getState, binding, []).captchaServeVolume]);
let length = value2.length;
const value3 = 0;
if (value3 < length) {
for (r4 = value3; true; r4 = value6) {
property = value2[r4];
value4 = Module00057(property, 2);
property = value4[value3];
property2 = value4[1];
defaultImport = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
distribution = defaultImport.distribution;
MetricEvents = (require(4831) /* metro dependency 4831: MetricEvents */).MetricEvents;
CAPTCHA_SERVE_VOLUME_DISTRIBUTION = MetricEvents.CAPTCHA_SERVE_VOLUME_DISTRIBUTION;
value5 = 'user_flow:' + property;
Reflect.apply(distribution, defaultImport, [{name: CAPTCHA_SERVE_VOLUME_DISTRIBUTION, tags: [value5]},
property2,
true]);
value6 = typeof r4 === 'bigint' ? r4 + 1n : +r4 + 1;
length = value2.length;
if (!(value6 < length)) {
break;
}
}
}
(ReactBatchUpdatesNativeModule).batchUpdates(_fun74075);
function _fun74075() { // fn#74075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9673:963, offset: 0x01d7fc3d, size: 29 bytes, params: 1, frame: 12
return env1_4.setState({captchaServeVolume: {}});
}
}
}
global.__d(_fun74068, 9487, [57, 629, 690, 4826, 4831,
2]) /* metro module 9487, dependencies: [57, 629, 690, 4826, 4831, 2] */;