decord/source/modules/parent_tools/native/ParentalConsentWarningManager.tsx
github-actions 03cf168fbc chore: update source for alpha 347.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
2026-09-17 08:17:09 +00:00

132 lines
4.7 KiB
TypeScript

// Module ID: 17711
// Function ID: 17712
// Name: ParentalConsentWarningManager
// Dependencies: [4330, 7651, 14991, 7652, 1074, 14992, 4607, 17712, 1897, 7232, 17714, 2]
// Module 17711 (ParentalConsentWarningManager)
import asyncRequireImpl from "asyncRequireImpl" /* 1897 */;
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4607 */;
import ParentalConsentWarningTypes from "ParentalConsentWarningTypes" /* 14992 */;
import ParentalConsentWarningActionCreators from "ParentalConsentWarningActionCreators" /* 17714 */;
import ActionSheetStore from "ActionSheetStore" /* 4330 */;
import FamilyCenterStore from "FamilyCenterStore" /* 7651 */;
import ParentalConsentWarningStore from "ParentalConsentWarningStore" /* 14991 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7232 */;
require = fn;
function maybePresentModal(daysRemaining) {
daysRemaining = undefined;
if (daysRemaining != null) {
daysRemaining = daysRemaining.daysRemaining;
}
let hasItem;
if (daysRemaining != null) {
const surfaces = daysRemaining.surfaces;
if (surfaces != null) {
hasItem = surfaces.includes(ParentalConsentWarningTypes.ParentalConsentWarningSurface.MODAL);
}
}
let tmp5 = true === hasItem && null != daysRemaining;
if (tmp5) {
tmp5 = daysRemaining >= 0;
}
if (tmp5) {
tmp5 = !ParentalConsentWarningStore.hasShownModalToday();
}
if (tmp5) {
const _Object = Object;
const values = Object.values(FamilyCenterStore.getLinkedUsers());
tmp5 = !values.some((link_status) => {
let tmp = link_status.link_status === constants.ACTIVE;
if (tmp) {
tmp = link_status.link_type === constants2.PARENT;
}
return tmp;
});
}
if (tmp5) {
tmp5 = !ActionSheetStore.isOpen();
}
if (tmp5) {
const obj = { daysRemaining };
ActionSheetActionCreatorsDefault.openLazy(asyncRequireImpl(17712, dependencyMap.paths), "ParentalConsentWarningModal", obj);
}
}
const FamilyCenterConstants = fn(7652);
({ UserLinkStatus: closure_7, UserLinkType: closure_8 } = FamilyCenterConstants);
const AppStates = fn(1074).AppStates;
const prototype = function ParentalConsentWarningManager() {
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = {
PARENTAL_CONSENT_WARNING_FETCH_SUCCESS(warning) {
maybePresentModal(warning.warning);
},
POST_CONNECTION_OPEN() {
const values = Object.values(linkedUsers.getLinkedUsers());
c3 = values.some((link_status) => {
let tmp = link_status.link_status === constants.ACTIVE;
if (tmp) {
tmp = link_status.link_type === constants2.PARENT;
}
return tmp;
});
ParentalConsentWarningActionCreators.maybeFetchWarning();
if (!ParentalConsentWarningStore.shouldFetchToday()) {
maybePresentModal(ParentalConsentWarningStore.getWarning());
}
},
APP_STATE_UPDATE(state) {
if (state.state === constants.ACTIVE) {
ParentalConsentWarningActionCreators.maybeFetchWarning();
if (!ParentalConsentWarningStore.shouldFetchToday()) {
maybePresentModal(obj2.getWarning());
}
obj2 = ParentalConsentWarningStore;
}
},
CURRENT_USER_UPDATE(user) {
user = user.user;
if (undefined !== user.linked_users) {
const linked_users = user.linked_users;
const someResult = linked_users.some((link_status) => {
let tmp = link_status.link_status === constants.ACTIVE;
if (tmp) {
tmp = link_status.link_type === constants2.PARENT;
}
return tmp;
});
c3 = someResult;
if (tmp) {
if (someResult) {
const warning = ParentalConsentWarningStore.getWarning();
let hasItem;
if (warning != null) {
const surfaces = warning.surfaces;
if (surfaces != null) {
hasItem = surfaces.includes(ParentalConsentWarningTypes.ParentalConsentWarningSurface.BANNER);
}
}
if (true === hasItem) {
ParentalConsentWarningActionCreators.forceFetchWarning();
}
} else {
ParentalConsentWarningActionCreators.forceFetchWarning();
}
}
tmp = undefined !== c3 && c3 !== someResult;
}
},
LOGOUT() {
c3 = undefined;
ParentalConsentWarningActionCreators.resetFetchState();
}
};
return applyArgumentsResult;
}.prototype;
class prototype extends tmp3 {
}
const prototype1 = new prototype();
const size = fn(2);
const result = size.fileFinishedImporting("modules/parent_tools/native/ParentalConsentWarningManager.tsx");
export default prototype1;