/* Metro module 13347; source: modules/parent_tools/hooks/useParentalControlSettings.tsx; dependencies: [5, 31, 5119, 6263, 8172, 13348, 13351, 1314, 4844, 7004, 8170, 566, 5118, 6264, 2] */ import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */ import FamilyCenterControlledSettingsStore from '../FamilyCenterControlledSettingsStore.tsx'; /* Metro dependency 5119 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import * as Preloaded_user_settingsModule from '../../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/preloaded_user_settings.tsx'; /* Metro dependency 1314 */ import * as ConstantsModule from '../../safety_common/Constants.tsx'; /* Metro dependency 6263 */ import * as UserSettingsUtilsModule from '../../../utils/UserSettingsUtils.tsx'; /* Metro dependency 7004 */ import * as UseUserLinksModule from './useUserLinks.tsx'; /* Metro dependency 8170 */ import * as UseSelectedTeenModule from './useSelectedTeen.tsx'; /* Metro dependency 8172 */ import * as ParentalControlledUserSettingsModule from '../../user_settings/family_center/ParentalControlledUserSettings.tsx'; /* Metro dependency 13348 */ import * as FamilyCenterControlledSettingsUtilsModule from '../FamilyCenterControlledSettingsUtils.tsx'; /* Metro dependency 13351 */ function _fun101624(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101624, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:6, offset: 0x0221a9b6, size: 242 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/parent_tools/hooks/useParentalControlSettings.tsx'); exports.useParentalControlledExplicitContentSettings = useParentalControlledExplicitContentSettings; exports.useParentalControlledGoreContentSettings = useParentalControlledGoreContentSettings; exports.useDefaultGuildsRestricted = useDefaultGuildsRestricted; exports.useAllowFriendsFromMutualGuildsOnlyForTeen = useAllowFriendsFromMutualGuildsOnlyForTeen; exports.useIsParentallyControlled = useIsParentallyControlled; exports.useParentalControlledConsent = function(a0) { return {hasConsented: _fun101632(a0), updateConsent: _fun101634(a0)}; }; function useParentalControlledExplicitContentSettings() { // fn#101625, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:291, offset: 0x0221aaa8, size: 294 bytes, params: 1, frame: 21 var r0; var object; var moduleValue2; var resolveExplicitContentSettingWithDefaultsForTeen; var moduleValue3; const value2 = undefined; const value3 = (UseSelectedTeenModule).useSelectedTeen(); const ParentalControlledExplicitContent = (ParentalControlledUserSettingsModule).ParentalControlledExplicitContent; const useControlledSetting = ParentalControlledExplicitContent.useControlledSetting; const value4 = null; let id = value4 == value3 ? value2 : value3.id; const value5 = Reflect.apply(useControlledSetting, ParentalControlledExplicitContent, [id]); if (value4 == value3) { r0 = value4; } else { object = {}; moduleValue2 = require(13351) /* metro dependency 13351: FamilyCenterControlledSettingsUtils */; resolveExplicitContentSettingWithDefaultsForTeen = moduleValue2.resolveExplicitContentSettingWithDefaultsForTeen; id = value4 == value3 ? value2 : value3.id; object.explicitContentNonFriendDm = Reflect.apply(resolveExplicitContentSettingWithDefaultsForTeen, moduleValue2, [{teenId: id, setting: value4 == value5 ? value2 : value5.explicitContentNonFriendDm}]); moduleValue3 = require(13351) /* metro dependency 13351: FamilyCenterControlledSettingsUtils */; resolveExplicitContentSettingWithDefaultsForTeen = moduleValue3.resolveExplicitContentSettingWithDefaultsForTeen; id = value4 == value3 ? value2 : value3.id; object.explicitContentFriendDm = Reflect.apply(resolveExplicitContentSettingWithDefaultsForTeen, moduleValue3, [{teenId: id, setting: value4 == value5 ? value2 : value5.explicitContentFriendDm, isFriend: true}]); object.explicitContentGuilds = (require(1314) /* metro dependency 1314: preloaded_user_settings */).ExplicitContentRedaction.BLUR; r0 = object; } return r0; } function useParentalControlledGoreContentSettings() { // fn#101626, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:878, offset: 0x0221abce, size: 308 bytes, params: 1, frame: 19 const value2 = undefined; const value3 = (UseSelectedTeenModule).useSelectedTeen(); const ParentalControlledGoreContent = (ParentalControlledUserSettingsModule).ParentalControlledGoreContent; const value4 = ParentalControlledGoreContent.useControlledSetting(value3 == null ? value2 : value3.id); if (value3 == null) { return null; } const {goreContentNonFriendDm, goreContentFriendDm} = value4 ?? ({}); const object = {}; object.goreContentNonFriendDm = FamilyCenterControlledSettingsUtilsModule.isSetAndNotDefault(goreContentNonFriendDm) ? goreContentNonFriendDm : (require(4844) /* metro dependency 4844: SensitiveMediaGoreRedactionSettingsUtils */).resolveGoreSettingWithDefaultsForTeen({isDm: true}); object.goreContentFriendDm = FamilyCenterControlledSettingsUtilsModule.isSetAndNotDefault(goreContentFriendDm) ? goreContentFriendDm : (require(4844) /* metro dependency 4844: SensitiveMediaGoreRedactionSettingsUtils */).resolveGoreSettingWithDefaultsForTeen({'isDm': true, 'isFriend': true}); const ExplicitContentRedaction = (Preloaded_user_settingsModule).ExplicitContentRedaction; const BLUR = ExplicitContentRedaction.BLUR; object.goreContentGuilds = BLUR; return object; } function useDefaultGuildsRestricted() { // fn#101627, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:1417, offset: 0x0221ad02, size: 149 bytes, params: 1, frame: 17 const value2 = undefined; const value3 = (UseSelectedTeenModule).useSelectedTeen(); const ParentalControlledDefaultGuildsRestricted = (ParentalControlledUserSettingsModule).ParentalControlledDefaultGuildsRestricted; const value4 = ParentalControlledDefaultGuildsRestricted.useControlledSetting(value3 == null ? value2 : value3.id); const ParentalControlledDefaultGuildsRestrictedV2 = (ParentalControlledUserSettingsModule).ParentalControlledDefaultGuildsRestrictedV2; return ParentalControlledDefaultGuildsRestrictedV2.useControlledSetting(value3 == null ? value2 : value3.id) ?? (value4 && !!value4); } function useAllowFriendsFromMutualGuildsOnlyForTeen() { // fn#101628, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:1714, offset: 0x0221ad97, size: 134 bytes, params: 1, frame: 16 const value2 = undefined; const value3 = (UseSelectedTeenModule).useSelectedTeen(); const ParentalControlledFriendSourceFlags = (ParentalControlledUserSettingsModule).ParentalControlledFriendSourceFlags; const value = ReactModule.useMemo(_fun101629, [ParentalControlledFriendSourceFlags.useControlledSetting(value3 == null ? value2 : value3.id)]); return value.mutualGuilds && !value.all; function _fun101629() { // fn#101629, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:1901, offset: 0x0221ae1d, size: 45 bytes, params: 1, frame: 11 const value = environment.__proto__; return (UserSettingsUtilsModule).computeFlags(env0_0); } } function useIsParentallyControlled() { // fn#101630, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:1994, offset: 0x0221ae4a, size: 37 bytes, params: 1, frame: 11 return (UseUserLinksModule).useHasActiveParentLinks(); } function useParentalControlledConsent(a0) { // fn#101631, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:2105, offset: 0x0221ae6f, size: 47 bytes, params: 2, frame: 12 return {hasConsented: ((a0) => { var env0_0 = a0; var env0_1 = (require(8172) /* metro dependency 8172: useSelectedTeen */).useSelectedTeenId(); return (require(566) /* metro dependency 566: flux */).useStateFromStores([FamilyCenterControlledSettingsStore], _fun101633); })(a0), updateConsent: useUpdateParentalControlledConsent(a0)}; function useParentalControlledHasConsented(a0) { // fn#101632, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:2152, owner: useParentalControlledConsent.useParentalControlledHasConsented, offset: 0x0221ae9e, size: 92 bytes, params: 2, frame: 16 const env0_0 = a0; const env0_1 = (UseSelectedTeenModule).useSelectedTeenId(); return (FluxModule).useStateFromStores([FamilyCenterControlledSettingsStore], _fun101633); function _fun101633() { // fn#101633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:2272, offset: 0x0221aefa, size: 32 bytes, params: 1, frame: 13 const familyCenterControlledSettingsStoreBinding = FamilyCenterControlledSettingsStore; return familyCenterControlledSettingsStoreBinding.hasConsented(env0_1, env0_0); } } function useUpdateParentalControlledConsent(a0) { // fn#101634, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:2304, owner: useParentalControlledConsent.useUpdateParentalControlledConsent, offset: 0x0221af1a, size: 88 bytes, params: 2, frame: 15 var environment; const env0_0 = a0; const value = environment.__proto__; return env1_4.useCallback(_fun101635(), [(UseSelectedTeenModule).useSelectedTeenId(), a0]); function _fun101635() { // fn#101635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:2406, offset: 0x0221af72, size: 36 bytes, params: 1, frame: 12 const env0_0 = env2_3(_fun101637); return _fun101638; function* _fun101637(a0) { // fn#101637, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:2426, offset: 0x0221afa1, size: 193 bytes, params: 2, frame: 19 var items3; var items2; var binding; var binding2; var property; var value4; var updateTeenConsents; var value5; var error; var showFailedToast; var GENERIC_ERROR; if (false) { return undefined; } value = environment.__proto__.__proto__; if (env2_1 == null) { return undefined; } if (a0) { binding = env2_0; items3 = [binding]; } else { items3 = []; } if (a0) { items2 = []; } else { binding = env2_0; items2 = [binding]; } try { binding = env4_1; } catch (error) { binding = env4_1; value = binding(env4_2[13]); showFailedToast = value.showFailedToast; GENERIC_ERROR = env4_6.GENERIC_ERROR; Reflect.apply(showFailedToast, value, [GENERIC_ERROR]); return undefined; } try { binding2 = env4_2; } catch (error) { binding = env4_1; value = binding(env4_2[13]); showFailedToast = value.showFailedToast; GENERIC_ERROR = env4_6.GENERIC_ERROR; Reflect.apply(showFailedToast, value, [GENERIC_ERROR]); return undefined; } try { property = binding2[12]; } catch (error) { binding = env4_1; value = binding(env4_2[13]); showFailedToast = value.showFailedToast; GENERIC_ERROR = env4_6.GENERIC_ERROR; Reflect.apply(showFailedToast, value, [GENERIC_ERROR]); return undefined; } try { value4 = binding(property); } catch (error) { binding = env4_1; value = binding(env4_2[13]); showFailedToast = value.showFailedToast; GENERIC_ERROR = env4_6.GENERIC_ERROR; Reflect.apply(showFailedToast, value, [GENERIC_ERROR]); return undefined; } try { updateTeenConsents = value4.updateTeenConsents; } catch (error) { binding = env4_1; value = binding(env4_2[13]); showFailedToast = value.showFailedToast; GENERIC_ERROR = env4_6.GENERIC_ERROR; Reflect.apply(showFailedToast, value, [GENERIC_ERROR]); return undefined; } try { binding = env2_1; } catch (error) { binding = env4_1; value = binding(env4_2[13]); showFailedToast = value.showFailedToast; GENERIC_ERROR = env4_6.GENERIC_ERROR; Reflect.apply(showFailedToast, value, [GENERIC_ERROR]); return undefined; } try { value = Reflect.apply(updateTeenConsents, value4, [binding, items3, items2]); } catch (error) { binding = env4_1; value = binding(env4_2[13]); showFailedToast = value.showFailedToast; GENERIC_ERROR = env4_6.GENERIC_ERROR; Reflect.apply(showFailedToast, value, [GENERIC_ERROR]); return undefined; } yield value; try { value = undefined; value5 = false; } catch (error) { binding = env4_1; value = binding(env4_2[13]); showFailedToast = value.showFailedToast; GENERIC_ERROR = env4_6.GENERIC_ERROR; Reflect.apply(showFailedToast, value, [GENERIC_ERROR]); return undefined; } return value5 ? value : undefined; } function _fun101638() { // fn#101638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13537:2585, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13 return env0_0.apply(this, arguments); } } } } } global.__d(_fun101624, 13347, [5, 31, 5119, 6263, 8172, 13348, 13351, 1314, 4844, 7004, 8170, 566, 5118, 6264, 2]) /* metro module 13347, dependencies: [5, 31, 5119, 6263, 8172, 13348, 13351, 1314, 4844, 7004, 8170, 566, 5118, 6264, 2] */;