decord/source/modules/parent_tools/native/ParentalConsentWarningManager.tsx

137 lines
4.4 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 16775
// Function ID: 16776
2026-07-29 08:29:29 +00:00
// Name: maybePresentModal
2026-08-24 06:08:38 +00:00
// Dependencies: [4089, 5301, 14292, 5302, 676, 14293, 4346, 16776, 2008, 5043, 16778, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 16775 (maybePresentModal)
import asyncRequireImpl from "asyncRequireImpl" /* 2008 */;
import ACTION_SHEET_HEIGHT_HALFDefault from "ACTION_SHEET_HEIGHT_HALF" /* 4346 */;
import initializeDefault from "initialize" /* 5043 */;
import frozen from "frozen" /* 14293 */;
import closure_4 from "setContent" /* 4089 */;
import closure_5 from "freshTeenActivityWithMap" /* 5301 */;
import closure_6 from "initialize" /* 14292 */;
import items from "items" /* 5302 */;
import { AppStates } from "ME" /* 676 */;
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
function maybePresentModal(daysRemaining) {
daysRemaining = undefined;
if (daysRemaining != null) {
daysRemaining = daysRemaining.daysRemaining;
2026-07-20 16:05:17 +00:00
}
let hasItem;
2026-07-29 08:29:29 +00:00
if (daysRemaining != null) {
const surfaces = daysRemaining.surfaces;
if (surfaces != null) {
2026-08-24 06:08:38 +00:00
hasItem = surfaces.includes(frozen.ParentalConsentWarningSurface.MODAL);
2026-07-20 16:05:17 +00:00
}
}
let tmp5 = true === hasItem && null != daysRemaining;
if (tmp5) {
tmp5 = daysRemaining >= 0;
}
if (tmp5) {
2026-08-24 06:08:38 +00:00
tmp5 = !closure_6.hasShownModalToday();
2026-07-20 16:05:17 +00:00
}
if (tmp5) {
const _Object = Object;
2026-07-29 08:29:29 +00:00
const values = Object.values(linkedUsers.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;
});
2026-07-20 16:05:17 +00:00
}
if (tmp5) {
tmp5 = !open.isOpen();
}
if (tmp5) {
2026-07-29 08:29:29 +00:00
const obj = { daysRemaining: null };
obj[0] = daysRemaining;
2026-08-24 06:08:38 +00:00
ACTION_SHEET_HEIGHT_HALFDefault.openLazy(asyncRequireImpl(16776, dependencyMap.paths), "ParentalConsentWarningModal", obj);
const obj2 = ACTION_SHEET_HEIGHT_HALFDefault;
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
({ UserLinkStatus: error, UserLinkType: closure_8 } = items);
initializeDefault;
2026-07-29 08:29:29 +00:00
let prototype = function ParentalConsentWarningManager() {
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = {
PARENTAL_CONSENT_WARNING_FETCH_SUCCESS(warning) {
callback2(warning.warning);
},
POST_CONNECTION_OPEN() {
const values = Object.values(linkedUsers.getLinkedUsers());
2026-08-24 06:08:38 +00:00
closure_3 = values.some((link_status) => {
2026-07-29 08:29:29 +00:00
let tmp = link_status.link_status === constants.ACTIVE;
if (tmp) {
tmp = link_status.link_type === constants2.PARENT;
}
return tmp;
});
2026-08-24 06:08:38 +00:00
callback(16778).maybeFetchWarning();
if (!closure_6.shouldFetchToday()) {
callback2(closure_6.getWarning());
2026-07-29 08:29:29 +00:00
}
},
APP_STATE_UPDATE(state) {
if (state.state === constants.ACTIVE) {
2026-08-24 06:08:38 +00:00
callback(16778).maybeFetchWarning();
if (!closure_6.shouldFetchToday()) {
2026-07-29 08:29:29 +00:00
callback2(obj2.getWarning());
}
2026-08-24 06:08:38 +00:00
const obj = callback(16778);
obj2 = closure_6;
2026-07-29 08:29:29 +00:00
}
},
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;
});
2026-08-24 06:08:38 +00:00
closure_3 = someResult;
2026-07-29 08:29:29 +00:00
if (tmp) {
if (someResult) {
2026-08-24 06:08:38 +00:00
const warning = closure_6.getWarning();
2026-07-29 08:29:29 +00:00
let hasItem;
if (warning != null) {
const surfaces = warning.surfaces;
if (surfaces != null) {
2026-08-24 06:08:38 +00:00
hasItem = surfaces.includes(callback(14293).ParentalConsentWarningSurface.BANNER);
2026-07-29 08:29:29 +00:00
}
}
if (true === hasItem) {
2026-08-24 06:08:38 +00:00
callback(16778).forceFetchWarning();
const obj2 = callback(16778);
2026-07-29 08:29:29 +00:00
}
} else {
2026-08-24 06:08:38 +00:00
callback(16778).forceFetchWarning();
const obj = callback(16778);
2026-07-29 08:29:29 +00:00
}
}
tmp = undefined !== closure_3 && closure_3 !== someResult;
}
},
LOGOUT() {
2026-08-24 06:08:38 +00:00
c3 = undefined;
callback(16778).resetFetchState();
2026-07-29 08:29:29 +00:00
}
};
return applyArgumentsResult;
}.prototype;
class prototype extends tmp3 {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
prototype = new prototype();
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/parent_tools/native/ParentalConsentWarningManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default prototype;