decord/source/modules/age_assurance/AgeVerificationStore.tsx

209 lines
5.2 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 7567
2026-07-27 11:26:19 +00:00
// Function ID: 60645
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-25 08:10:48 +00:00
// Dependencies: [6, 7, 15, 17, 18, 1850, 587, 566, 686, 2]
2026-07-20 16:05:17 +00:00
2026-07-25 08:10:48 +00:00
// Module 7567 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import Storage from "Storage";
import initialize from "initialize";
import _possibleConstructorReturn from "_possibleConstructorReturn";
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
const require = arg1;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
function getStorageKey() {
2026-07-23 10:11:24 +00:00
currentUser = currentUser.getCurrentUser();
2026-07-20 16:05:17 +00:00
let id;
if (null != currentUser) {
id = currentUser.id;
}
let combined = null;
if (null != id) {
const _HermesInternal = HermesInternal;
combined = "AgeVerificationStore_" + id;
}
return combined;
}
function resetToDefaults() {
2026-07-23 10:11:24 +00:00
const unchecked = "unchecked";
let c12 = null;
2026-07-20 16:05:17 +00:00
}
function persist() {
const tmp = getStorageKey();
if (null != tmp) {
2026-07-23 10:11:24 +00:00
const Storage = require(587) /* Storage */.Storage;
const obj = { reactiveCheckStatus: unchecked, reactiveCheckMissAt: c12 };
2026-07-20 16:05:17 +00:00
const result = Storage.set(tmp, obj);
}
}
function loadFromStorage() {
const tmp = getStorageKey();
if (null != tmp) {
2026-07-23 10:11:24 +00:00
const Storage = require(587) /* Storage */.Storage;
2026-07-20 16:05:17 +00:00
const value = Storage.get(tmp);
if (null != value) {
if ("object" === typeof value) {
const reactiveCheckStatus = value.reactiveCheckStatus;
let str2 = "unchecked";
if (null != reactiveCheckStatus) {
str2 = reactiveCheckStatus;
}
const reactiveCheckMissAt = value.reactiveCheckMissAt;
let tmp9 = null;
if (null != reactiveCheckMissAt) {
tmp9 = reactiveCheckMissAt;
}
let tmp10 = "miss" === str2 && null != tmp9;
if (tmp10) {
const _Date = Date;
2026-07-23 10:11:24 +00:00
tmp10 = Date.now() - tmp9 >= c8;
2026-07-20 16:05:17 +00:00
}
if (tmp10) {
resetToDefaults();
} else {
2026-07-23 10:11:24 +00:00
let c12 = tmp9;
2026-07-20 16:05:17 +00:00
}
}
}
resetToDefaults();
} else {
resetToDefaults();
}
}
function isMissWithinTTL() {
2026-07-23 10:11:24 +00:00
let tmp = "miss" === unchecked;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = null != c12;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
const _Date = Date;
2026-07-23 10:11:24 +00:00
tmp = Date.now() - c12 < c8;
2026-07-20 16:05:17 +00:00
}
return tmp;
}
2026-07-23 10:11:24 +00:00
let c8 = 86400000;
let c9 = null;
let c10 = false;
let unchecked = "unchecked";
let c12 = null;
let tmp2 = ((Store) => {
2026-07-20 16:05:17 +00:00
class AgeVerificationStore {
constructor() {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_2(this, AgeVerificationStore);
obj = outer1_5(AgeVerificationStore);
tmp2 = outer1_4;
if (outer1_13()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_5;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_5(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
return tmp2(self, constructResult);
}
}
callback2(AgeVerificationStore, Store);
let obj = {
key: "initialize",
value() {
2026-07-23 10:11:24 +00:00
this.waitFor(outer1_7);
2026-07-20 16:05:17 +00:00
}
};
const items = [obj, , , , , , ];
obj = {
key: "loading",
get() {
2026-07-23 10:11:24 +00:00
return outer1_10;
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
obj = {
key: "methods",
get() {
2026-07-23 10:11:24 +00:00
return outer1_9;
2026-07-20 16:05:17 +00:00
}
};
items[2] = obj;
items[3] = {
key: "getReactiveCheckStatus",
value() {
2026-07-23 10:11:24 +00:00
return outer1_11;
2026-07-20 16:05:17 +00:00
}
};
items[4] = {
key: "getReactiveCheckMiss",
value() {
2026-07-23 10:11:24 +00:00
return outer1_18();
2026-07-20 16:05:17 +00:00
}
};
items[5] = {
key: "getReactiveCheckPassed",
value() {
2026-07-23 10:11:24 +00:00
return "passed" === outer1_11;
2026-07-20 16:05:17 +00:00
}
};
items[6] = {
key: "shouldCallReactiveCheck",
value() {
2026-07-23 10:11:24 +00:00
let tmp = "passed" !== outer1_11;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
let tmp3 = "suppress" !== outer1_11;
2026-07-20 16:05:17 +00:00
if (tmp3) {
2026-07-23 10:11:24 +00:00
tmp3 = !outer1_18();
2026-07-20 16:05:17 +00:00
}
tmp = tmp3;
}
return tmp;
}
};
return callback(AgeVerificationStore, items);
2026-07-23 10:11:24 +00:00
})(require("initialize").Store);
2026-07-20 16:05:17 +00:00
tmp2.displayName = "AgeVerificationStore";
2026-07-23 10:11:24 +00:00
tmp2 = new tmp2(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
AGE_VERIFICATION_METHODS_LOAD_START: function handleAgeVerificationMethodsLoadStart() {
2026-07-23 10:11:24 +00:00
let c10 = true;
2026-07-20 16:05:17 +00:00
},
AGE_VERIFICATION_METHODS_LOAD_SUCCESS: function handleAgeVerificationMethodsLoadSuccess(methods) {
methods = methods.methods;
2026-07-23 10:11:24 +00:00
let c10 = false;
2026-07-20 16:05:17 +00:00
},
AGE_VERIFICATION_METHODS_LOAD_FAILURE: function handleAgeVerificationMethodsLoadFailure() {
2026-07-23 10:11:24 +00:00
let c10 = false;
2026-07-20 16:05:17 +00:00
},
CONNECTION_OPEN: function handleConnectionOpen() {
loadFromStorage();
},
AGE_VERIFICATION_CHECK_RESULT_SET: function handleReactiveCheckResultSet(status) {
status = status.status;
let timestamp = null;
if ("miss" === status) {
const _Date = Date;
timestamp = Date.now();
}
persist();
},
AGE_VERIFICATION_RESET: function handleAgeVerificationReset() {
2026-07-23 10:11:24 +00:00
const suppress = "suppress";
let c12 = null;
2026-07-20 16:05:17 +00:00
persist();
}
});
2026-07-23 10:11:24 +00:00
let result = require("_possibleConstructorReturn").fileFinishedImporting("modules/age_assurance/AgeVerificationStore.tsx");
2026-07-20 16:05:17 +00:00
export default tmp2;