decord/source/modules/age_assurance/AgeVerificationStore.tsx

214 lines
5.8 KiB
TypeScript
Raw Normal View History

// Module ID: 8481
// Function ID: 8482
// Name: AgeVerificationStore
// Dependencies: [1371, 510, 504, 573, 2]
2026-07-20 16:05:17 +00:00
// Module 8481 (AgeVerificationStore)
import initializeDefault from "initialize" /* 504 */;
import Storage2 from "Storage" /* 510 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import UserStore from "UserStore" /* 1371 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-29 08:29:29 +00:00
let c3 = 86400000;
let methods = null;
2026-07-29 08:29:29 +00:00
let c5 = null;
2026-08-11 06:20:06 +00:00
let c6 = null;
2026-08-31 15:47:37 +00:00
let c7 = null;
let c8 = false;
let suppress = "unchecked";
2026-08-31 15:47:37 +00:00
let c10 = 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() {
this.waitFor(UserStore);
2026-07-29 08:29:29 +00:00
};
Object.defineProperty(prototype, "loading", {
get: function loading() {
2026-08-31 15:47:37 +00:00
return c8;
2026-07-29 08:29:29 +00:00
},
set: undefined
});
Object.defineProperty(prototype, "methods", {
get: function methods() {
return methods;
2026-07-29 08:29:29 +00:00
},
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-08-31 15:47:37 +00:00
Object.defineProperty(prototype, "methodsV2OutageBannerMessage", {
get: function methodsV2OutageBannerMessage() {
return c7;
},
set: undefined
});
2026-07-29 08:29:29 +00:00
prototype["getReactiveCheckStatus"] = function getReactiveCheckStatus() {
return suppress;
2026-07-29 08:29:29 +00:00
};
prototype["getReactiveCheckMiss"] = function getReactiveCheckMiss() {
let tmp = "miss" === suppress;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-08-31 15:47:37 +00:00
tmp = null != c10;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
const _Date = Date;
2026-08-31 15:47:37 +00:00
tmp = Date.now() - c10 < 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" === suppress;
2026-07-29 08:29:29 +00:00
};
prototype["shouldCallReactiveCheck"] = function shouldCallReactiveCheck() {
let tmp2 = "passed" !== suppress;
2026-07-29 08:29:29 +00:00
if (tmp2) {
let tmp3 = "suppress" !== tmp;
if (tmp3) {
let tmp4 = "miss" === tmp;
if (tmp4) {
2026-08-31 15:47:37 +00:00
tmp4 = null != c10;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
const _Date = Date;
2026-08-31 15:47:37 +00:00
tmp4 = Date.now() - c10 < 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";
const ageVerificationStore = new AgeVerificationStore(DispatcherDefault, {
2026-07-20 16:05:17 +00:00
AGE_VERIFICATION_METHODS_LOAD_START: function handleAgeVerificationMethodsLoadStart() {
2026-08-31 15:47:37 +00:00
c8 = true;
2026-07-20 16:05:17 +00:00
},
AGE_VERIFICATION_METHODS_LOAD_SUCCESS: function handleAgeVerificationMethodsLoadSuccess(methods) {
methods = methods.methods;
2026-08-31 15:47:37 +00:00
c8 = false;
2026-07-20 16:05:17 +00:00
},
AGE_VERIFICATION_METHODS_LOAD_FAILURE: function handleAgeVerificationMethodsLoadFailure() {
2026-08-31 15:47:37 +00:00
c8 = 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) {
2026-08-31 15:47:37 +00:00
({ methods: c5, footerMessage: c6, outageBannerMessage: c7 } = 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-08-31 15:47:37 +00:00
c7 = null;
2026-07-20 16:05:17 +00:00
},
CONNECTION_OPEN: function handleConnectionOpen() {
const currentUser = UserStore.getCurrentUser();
2026-07-29 08:29:29 +00:00
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;
value = Storage.get(combined);
2026-07-29 08:29:29 +00:00
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";
}
reactiveCheckMissAt = value.reactiveCheckMissAt;
2026-07-29 08:29:29 +00:00
if (reactiveCheckMissAt == null) {
reactiveCheckMissAt = null;
}
let tmp9 = "miss" === str4 && null != reactiveCheckMissAt;
if (tmp9) {
const _Date = Date;
tmp9 = Date.now() - reactiveCheckMissAt >= c3;
}
if (tmp9) {
suppress = "unchecked";
2026-08-31 15:47:37 +00:00
c10 = null;
2026-07-29 08:29:29 +00:00
} else {
suppress = str4;
2026-08-31 15:47:37 +00:00
c10 = reactiveCheckMissAt;
2026-07-29 08:29:29 +00:00
}
}
}
suppress = "unchecked";
2026-08-31 15:47:37 +00:00
c10 = null;
2026-07-29 08:29:29 +00:00
} else {
suppress = "unchecked";
2026-08-31 15:47:37 +00:00
c10 = null;
2026-07-29 08:29:29 +00:00
}
2026-08-24 06:08:38 +00:00
c5 = null;
c6 = null;
2026-08-31 15:47:37 +00:00
c7 = null;
2026-07-20 16:05:17 +00:00
},
AGE_VERIFICATION_CHECK_RESULT_SET: function handleReactiveCheckResultSet(status) {
status = status.status;
suppress = status;
2026-07-20 16:05:17 +00:00
let timestamp = null;
if ("miss" === status) {
const _Date = Date;
timestamp = Date.now();
}
reactiveCheckMissAt = timestamp;
const currentUser = UserStore.getCurrentUser();
2026-07-29 08:29:29 +00:00
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;
const obj = { reactiveCheckStatus: suppress, reactiveCheckMissAt };
2026-07-29 08:29:29 +00:00
const result = Storage.set(combined, obj);
}
2026-07-20 16:05:17 +00:00
},
AGE_VERIFICATION_RESET: function handleAgeVerificationReset() {
suppress = "suppress";
reactiveCheckMissAt = null;
const currentUser = UserStore.getCurrentUser();
2026-07-29 08:29:29 +00:00
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;
const obj = { reactiveCheckStatus: suppress, reactiveCheckMissAt };
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-08-31 15:47:37 +00:00
c7 = null;
2026-07-20 16:05:17 +00:00
}
});
const size = fn(2);
let result = size.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;