decord/source/modules/age_assurance/AgeVerificationStore.tsx

205 lines
5.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 5431
// Function ID: 5432
2026-07-29 08:29:29 +00:00
// Name: initialize
2026-08-11 06:20:06 +00:00
// Dependencies: [1922, 595, 589, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 5431 (initialize)
import initializeDefault from "initialize" /* 589 */;
import Storage2 from "Storage" /* 595 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import closure_2 from "mergeGuildAvatar" /* 1922 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
let c3 = 86400000;
let c4 = null;
let c5 = null;
2026-08-11 06:20:06 +00:00
let c6 = null;
let c7 = false;
2026-07-29 08:29:29 +00:00
let unchecked = "unchecked";
2026-08-11 06:20:06 +00:00
let c9 = null;
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class AgeVerificationStore extends Store {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = AgeVerificationStore.prototype;
prototype["initialize"] = function initialize() {
2026-08-24 06:08:38 +00:00
this.waitFor(closure_2);
2026-07-29 08:29:29 +00:00
};
Object.defineProperty(prototype, "loading", {
get: function loading() {
2026-08-11 06:20:06 +00:00
return c7;
2026-07-29 08:29:29 +00:00
},
set: undefined
});
Object.defineProperty(prototype, "methods", {
get: function methods(arg0) {
return c4;
},
set: undefined
});
Object.defineProperty(prototype, "methodsV2", {
get: function methodsV2() {
return c5;
},
set: undefined
});
2026-08-11 06:20:06 +00:00
Object.defineProperty(prototype, "methodsV2FooterMessage", {
get: function methodsV2FooterMessage() {
return c6;
},
set: undefined
});
2026-07-29 08:29:29 +00:00
prototype["getReactiveCheckStatus"] = function getReactiveCheckStatus() {
return unchecked;
};
prototype["getReactiveCheckMiss"] = function getReactiveCheckMiss() {
2026-07-23 10:11:24 +00:00
let tmp = "miss" === unchecked;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-08-11 06:20:06 +00:00
tmp = null != c9;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
const _Date = Date;
2026-08-11 06:20:06 +00:00
tmp = Date.now() - c9 < c3;
2026-07-20 16:05:17 +00:00
}
return tmp;
2026-07-29 08:29:29 +00:00
};
prototype["getReactiveCheckPassed"] = function getReactiveCheckPassed() {
return "passed" === unchecked;
};
prototype["shouldCallReactiveCheck"] = function shouldCallReactiveCheck() {
let tmp2 = "passed" !== unchecked;
if (tmp2) {
let tmp3 = "suppress" !== tmp;
if (tmp3) {
let tmp4 = "miss" === tmp;
if (tmp4) {
2026-08-11 06:20:06 +00:00
tmp4 = null != c9;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
const _Date = Date;
2026-08-11 06:20:06 +00:00
tmp4 = Date.now() - c9 < c3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp3 = !tmp4;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = tmp3;
}
return tmp2;
};
AgeVerificationStore.displayName = "AgeVerificationStore";
2026-08-24 06:08:38 +00:00
const ageVerificationStore = new AgeVerificationStore(dispatcherDefault, {
2026-07-20 16:05:17 +00:00
AGE_VERIFICATION_METHODS_LOAD_START: function handleAgeVerificationMethodsLoadStart() {
2026-08-24 06:08:38 +00:00
c7 = true;
2026-07-20 16:05:17 +00:00
},
AGE_VERIFICATION_METHODS_LOAD_SUCCESS: function handleAgeVerificationMethodsLoadSuccess(methods) {
methods = methods.methods;
2026-08-24 06:08:38 +00:00
c7 = false;
2026-07-20 16:05:17 +00:00
},
AGE_VERIFICATION_METHODS_LOAD_FAILURE: function handleAgeVerificationMethodsLoadFailure() {
2026-08-24 06:08:38 +00:00
c7 = false;
2026-07-29 08:29:29 +00:00
},
2026-08-11 06:20:06 +00:00
AGE_VERIFICATION_METHODS_V2_LOAD_SUCCESS: function handleAgeVerificationMethodsV2LoadSuccess(arg0) {
({ methods: c5, footerMessage: c6 } = arg0);
2026-07-29 08:29:29 +00:00
},
INITIATE_AGE_VERIFICATION: function invalidateAgeVerificationMethodsV2() {
2026-08-24 06:08:38 +00:00
c5 = null;
c6 = null;
2026-07-20 16:05:17 +00:00
},
CONNECTION_OPEN: function handleConnectionOpen() {
2026-07-29 08:29:29 +00:00
const currentUser = authStore.getCurrentUser();
let id;
if (currentUser != null) {
id = currentUser.id;
}
let combined = null;
if (null != id) {
const _HermesInternal = HermesInternal;
combined = "AgeVerificationStore_" + id;
}
if (null != combined) {
2026-08-24 06:08:38 +00:00
const Storage = Storage2.Storage;
2026-07-29 08:29:29 +00:00
const value = Storage.get(combined);
if (null != value) {
2026-08-04 21:03:28 +00:00
if (typeof value === "object") {
2026-07-29 08:29:29 +00:00
let str4 = value.reactiveCheckStatus;
if (str4 == null) {
str4 = "unchecked";
}
let reactiveCheckMissAt = value.reactiveCheckMissAt;
if (reactiveCheckMissAt == null) {
reactiveCheckMissAt = null;
}
let tmp9 = "miss" === str4 && null != reactiveCheckMissAt;
if (tmp9) {
const _Date = Date;
tmp9 = Date.now() - reactiveCheckMissAt >= c3;
}
if (tmp9) {
2026-08-24 06:08:38 +00:00
unchecked = "unchecked";
c9 = null;
2026-07-29 08:29:29 +00:00
} else {
unchecked = str4;
2026-08-11 06:20:06 +00:00
c9 = reactiveCheckMissAt;
2026-07-29 08:29:29 +00:00
}
}
}
unchecked = "unchecked";
2026-08-11 06:20:06 +00:00
c9 = null;
2026-07-29 08:29:29 +00:00
} else {
unchecked = "unchecked";
2026-08-11 06:20:06 +00:00
c9 = null;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
c5 = null;
c6 = null;
2026-07-20 16:05:17 +00:00
},
AGE_VERIFICATION_CHECK_RESULT_SET: function handleReactiveCheckResultSet(status) {
status = status.status;
let timestamp = null;
if ("miss" === status) {
const _Date = Date;
timestamp = Date.now();
}
2026-07-29 08:29:29 +00:00
const currentUser = authStore.getCurrentUser();
let id;
if (currentUser != null) {
id = currentUser.id;
}
let combined = null;
if (null != id) {
const _HermesInternal = HermesInternal;
combined = "AgeVerificationStore_" + id;
}
if (null != combined) {
2026-08-24 06:08:38 +00:00
const Storage = Storage2.Storage;
2026-07-29 08:29:29 +00:00
const obj = { reactiveCheckStatus: null, reactiveCheckMissAt: null };
obj[0] = status;
obj[1] = timestamp;
const result = Storage.set(combined, obj);
}
2026-07-20 16:05:17 +00:00
},
AGE_VERIFICATION_RESET: function handleAgeVerificationReset() {
2026-07-23 10:11:24 +00:00
const suppress = "suppress";
2026-08-24 06:08:38 +00:00
c9 = null;
2026-07-29 08:29:29 +00:00
const currentUser = authStore.getCurrentUser();
let id;
if (currentUser != null) {
id = currentUser.id;
}
let combined = null;
if (null != id) {
const _HermesInternal = HermesInternal;
combined = "AgeVerificationStore_" + id;
}
if (null != combined) {
2026-08-24 06:08:38 +00:00
const Storage = Storage2.Storage;
2026-07-29 08:29:29 +00:00
const obj = { reactiveCheckStatus: null, reactiveCheckMissAt: null };
obj[0] = suppress;
2026-08-11 06:20:06 +00:00
obj[1] = c9;
2026-07-29 08:29:29 +00:00
const result = Storage.set(combined, obj);
}
2026-08-24 06:08:38 +00:00
c5 = null;
c6 = null;
2026-07-20 16:05:17 +00:00
}
});
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/age_assurance/AgeVerificationStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default ageVerificationStore;