168 lines
8.4 KiB
TypeScript
168 lines
8.4 KiB
TypeScript
/* Metro module 5261; source: modules/age_assurance/AgeVerificationStore.tsx; dependencies: [6, 7, 15, 17, 18, 1878, 587, 566, 694, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
|
|
function _fun46782(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5439:6, offset: 0x011aebf7, size: 422 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const resetToDefaults = function() {
|
|
env0_11 = 'unchecked';
|
|
env0_12 = null;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const Store = (Flux).Store;
|
|
let value = _fun46791(Store);
|
|
value.displayName = 'AgeVerificationStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{AGE_VERIFICATION_METHODS_LOAD_START: function() {
|
|
env0_10 = true;
|
|
}, AGE_VERIFICATION_METHODS_LOAD_SUCCESS: function(a0) {
|
|
env0_9 = a0.methods;
|
|
env0_10 = false;
|
|
}, AGE_VERIFICATION_METHODS_LOAD_FAILURE: function() {
|
|
env0_10 = false;
|
|
}, CONNECTION_OPEN: function() {
|
|
loadFromStorage();
|
|
}, AGE_VERIFICATION_CHECK_RESULT_SET: function({status}) {
|
|
env0_11 = status;
|
|
env0_12 = status !== 'miss' ? null : global.Date.now();
|
|
persist_46788();
|
|
}, AGE_VERIFICATION_RESET: function() {
|
|
env0_11 = 'suppress';
|
|
env0_12 = null;
|
|
persist_46788();
|
|
}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/age_assurance/AgeVerificationStore.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_46783() { // fn#46783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5439:158, offset: 0x011aed9d, size: 94 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_46783_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function getStorageKey() { // fn#46786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5439:396, offset: 0x011aedfb, size: 67 bytes, params: 1, frame: 12
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const value2 = null;
|
|
const id = value2 == currentUser ? undefined : currentUser.id;
|
|
return value2 == id ? value2 : 'AgeVerificationStore_' + id;
|
|
}
|
|
|
|
function persist_46788() { // fn#46788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5439:566, offset: 0x011aee55, size: 78 bytes, params: 1, frame: 16
|
|
var Storage;
|
|
const storageKey = getStorageKey();
|
|
if (storageKey != null) {
|
|
Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
Storage.set(storageKey, {reactiveCheckStatus: env0_11, reactiveCheckMissAt: env0_12});
|
|
}
|
|
}
|
|
|
|
function loadFromStorage() { // fn#46789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5439:685, offset: 0x011aeea3, size: 203 bytes, params: 1, frame: 15
|
|
var r3;
|
|
var r2;
|
|
var r4;
|
|
var value4;
|
|
var reactiveCheckStatus;
|
|
var reactiveCheckMissAt;
|
|
const storageKey = getStorageKey();
|
|
const value3 = null;
|
|
if (value3 != storageKey) {
|
|
value4 = (require(587) /* metro dependency 587: Storage */).Storage.get(storageKey);
|
|
if (value3 == value4) {
|
|
resetToDefaults();
|
|
} else if (typeof value4 === 'object') {
|
|
reactiveCheckStatus = value4.reactiveCheckStatus;
|
|
r3 = value3 != reactiveCheckStatus ? reactiveCheckStatus : 'unchecked';
|
|
reactiveCheckMissAt = value4.reactiveCheckMissAt;
|
|
r2 = value3 != reactiveCheckMissAt ? reactiveCheckMissAt : value3;
|
|
r4 = r3 === 'miss' && value3 != r2;
|
|
r4 = r4 && global.Date.now() - r2 >= env0_8;
|
|
if (r4) {
|
|
resetToDefaults();
|
|
}
|
|
} else {
|
|
resetToDefaults();
|
|
}
|
|
} else {
|
|
resetToDefaults();
|
|
}
|
|
}
|
|
|
|
function isMissWithinTTL() { // fn#46790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5439:1060, offset: 0x011aef6e, size: 66 bytes, params: 1, frame: 11
|
|
return env0_11 === 'miss' && env0_12 != null && global.Date.now() - env0_12 < env0_8;
|
|
}
|
|
|
|
function _fun46791(a0) { // fn#46791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5439:1135, offset: 0x011aefb0, size: 212 bytes, params: 2, frame: 16
|
|
const AgeVerificationStore2 = AgeVerificationStore;
|
|
Inherits(AgeVerificationStore2, a0);
|
|
return CreateClass(AgeVerificationStore2, [{key: 'initialize', value: function() {
|
|
this.waitFor(UserStore);
|
|
}}, {key: 'loading', get: get_46794}, {key: 'methods', get: get_46795}, {key: 'getReactiveCheckStatus',
|
|
value: value_46796}, {key: 'getReactiveCheckMiss', value: function() {
|
|
return isMissWithinTTL();
|
|
}}, {key: 'getReactiveCheckPassed', value: value_46798}, {key: 'shouldCallReactiveCheck', value: value_46799}]);
|
|
function AgeVerificationStore() { // fn#46792, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5439:1147, offset: 0x00ea76ec, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_2(this, AgeVerificationStore);
|
|
const value3 = env1_5(AgeVerificationStore);
|
|
return env1_4(this, _isNativeReflectConstruct_46783() ? global.Reflect.construct(value3, arguments,
|
|
env1_5(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function get_46794() { // fn#46794, offset: 0x00fbd9ec, size: 9 bytes, params: 1, frame: 1
|
|
return env1_10;
|
|
}
|
|
|
|
function get_46795() { // fn#46795, offset: 0x00e07a77, size: 9 bytes, params: 1, frame: 1
|
|
return env1_9;
|
|
}
|
|
|
|
function value_46796() { // fn#46796, offset: 0x00ef8482, size: 9 bytes, params: 1, frame: 1
|
|
return env1_11;
|
|
}
|
|
|
|
function value_46798() { // fn#46798, offset: 0x011af084, size: 19 bytes, params: 1, frame: 2
|
|
return env1_11 === 'passed';
|
|
}
|
|
|
|
function value_46799() { // fn#46799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5439:1811, offset: 0x011af097, size: 53 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return env1_11 !== 'passed' && (env1_11 !== 'suppress' && !isMissWithinTTL());
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun46782, 5261, [6, 7, 15, 17, 18, 1878, 587, 566, 694,
|
|
2]) /* metro module 5261, dependencies: [6, 7, 15, 17, 18, 1878, 587, 566, 694, 2] */;
|