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

137 lines
4.4 KiB
TypeScript
Raw Normal View History

2026-09-02 09:53:35 +00:00
// Module ID: 17281
// Function ID: 17282
2026-07-29 08:29:29 +00:00
// Name: maybePresentModal
2026-09-02 09:53:35 +00:00
// Dependencies: [4186, 7291, 14696, 7292, 673, 14697, 4445, 17282, 2008, 5494, 17284, 2]
2026-07-20 16:05:17 +00:00
2026-09-02 09:53:35 +00:00
// Module 17281 (maybePresentModal)
import asyncRequireImpl from "asyncRequireImpl" /* 2008 */;
2026-09-01 10:26:29 +00:00
import ACTION_SHEET_HEIGHT_HALFDefault from "ACTION_SHEET_HEIGHT_HALF" /* 4445 */;
2026-09-02 09:53:35 +00:00
import initializeDefault from "initialize" /* 5494 */;
import frozen from "frozen" /* 14697 */;
2026-09-01 10:26:29 +00:00
import closure_4 from "setContent" /* 4186 */;
2026-09-02 09:53:35 +00:00
import closure_5 from "freshTeenActivityWithMap" /* 7291 */;
import closure_6 from "initialize" /* 14696 */;
import items from "items" /* 7292 */;
import { AppStates } from "ME" /* 673 */;
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-09-02 09:53:35 +00:00
ACTION_SHEET_HEIGHT_HALFDefault.openLazy(asyncRequireImpl(17282, dependencyMap.paths), "ParentalConsentWarningModal", obj);
2026-08-24 06:08:38 +00:00
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-09-02 09:53:35 +00:00
callback(17284).maybeFetchWarning();
2026-08-24 06:08:38 +00:00
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-09-02 09:53:35 +00:00
callback(17284).maybeFetchWarning();
2026-08-24 06:08:38 +00:00
if (!closure_6.shouldFetchToday()) {
2026-07-29 08:29:29 +00:00
callback2(obj2.getWarning());
}
2026-09-02 09:53:35 +00:00
const obj = callback(17284);
2026-08-24 06:08:38 +00:00
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-09-02 09:53:35 +00:00
hasItem = surfaces.includes(callback(14697).ParentalConsentWarningSurface.BANNER);
2026-07-29 08:29:29 +00:00
}
}
if (true === hasItem) {
2026-09-02 09:53:35 +00:00
callback(17284).forceFetchWarning();
const obj2 = callback(17284);
2026-07-29 08:29:29 +00:00
}
} else {
2026-09-02 09:53:35 +00:00
callback(17284).forceFetchWarning();
const obj = callback(17284);
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;
2026-09-02 09:53:35 +00:00
callback(17284).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;