343 lines
17 KiB
TypeScript
343 lines
17 KiB
TypeScript
/* Metro module 11473; source: modules/safety_hub/SafetyHubStore.tsx; dependencies: [6, 7, 15, 17, 18, 5267, 5268, 11474, 566, 694, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as SafetyHubConstantsModule from './SafetyHubConstants.tsx'; /* Metro dependency 5267 */
|
|
import * as SafetyHubModelsModule from './SafetyHubModels.tsx'; /* Metro dependency 5268 */
|
|
|
|
function _fun87846(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87846, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:6, offset: 0x01fcdcff, size: 776 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const closure = function(a0) {
|
|
var r3;
|
|
if (a0 == null) {
|
|
throwTypeError(a0, "Cannot destructure 'undefined' or 'null'.", r3);
|
|
throw undefined;
|
|
}
|
|
env0_26 = '';
|
|
env0_28 = null;
|
|
env0_29 = false;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = SafetyHubConstantsModule;
|
|
const AgeCheckStatus = value.AgeCheckStatus;
|
|
const AppealIngestionSignal = value.AppealIngestionSignal;
|
|
const env0_10 = value.AGE_CHECK_MAX_POLL_ATTEMPTS;
|
|
let env0_11 = {};
|
|
const env0_12 = {};
|
|
object = {};
|
|
const AccountStandingState = (SafetyHubModelsModule).AccountStandingState;
|
|
const ALL_GOOD = AccountStandingState.ALL_GOOD;
|
|
object.state = ALL_GOOD;
|
|
let env0_20 = [];
|
|
let env0_23 = AppealIngestionSignal.DIDNT_VIOLATE_POLICY;
|
|
let env0_30 = AgeCheckStatus.NONE;
|
|
const Store = (Flux).Store;
|
|
_fun87851(Store).displayName = 'SafetyHubStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {SAFETY_HUB_FETCH_START: function() {
|
|
env0_14 = true;
|
|
}, SAFETY_HUB_FETCH_SUCCESS: function({classifications, accountStanding, isDsaEligible, isAppealEligible, username,
|
|
appealEligibility}) {
|
|
env0_11 = importDefault(dependencyMap[7])(classifications, 'id');
|
|
env0_13 = accountStanding;
|
|
env0_18 = isDsaEligible;
|
|
env0_19 = isAppealEligible;
|
|
env0_14 = false;
|
|
env0_15 = true;
|
|
env0_16 = null;
|
|
env0_25 = username;
|
|
env0_20 = appealEligibility;
|
|
}, SAFETY_HUB_FETCH_FAILURE: function({error}) {
|
|
env0_14 = false;
|
|
env0_15 = false;
|
|
env0_16 = error;
|
|
}, SAFETY_HUB_FETCH_CLASSIFICATION_START: SAFETY_HUB_FETCH_CLASSIFICATION_START,
|
|
SAFETY_HUB_FETCH_CLASSIFICATION_SUCCESS: SAFETY_HUB_FETCH_CLASSIFICATION_SUCCESS,
|
|
SAFETY_HUB_FETCH_CLASSIFICATION_FAILURE: SAFETY_HUB_FETCH_CLASSIFICATION_FAILURE,
|
|
SAFETY_HUB_APPEAL_OPEN: function(a0) {
|
|
env0_17 = a0.classificationId;
|
|
}, SAFETY_HUB_APPEAL_CLOSE: function() {
|
|
env0_17 = null;
|
|
env0_23 = AppealIngestionSignal.DIDNT_VIOLATE_POLICY;
|
|
env0_24 = '';
|
|
}, SAFETY_HUB_APPEAL_SIGNAL_SELECT: function(a0) {
|
|
env0_23 = a0.signal;
|
|
}, SAFETY_HUB_APPEAL_SIGNAL_CUSTOM_INPUT_CHANGE: function(a0) {
|
|
env0_24 = a0.userInput;
|
|
}, SAFETY_HUB_REQUEST_REVIEW_START: function(a0) {
|
|
var r3;
|
|
if (a0 == null) {
|
|
throwTypeError(a0, "Cannot destructure 'undefined' or 'null'.", r3);
|
|
throw undefined;
|
|
}
|
|
env0_21 = true;
|
|
env0_22 = null;
|
|
}, SAFETY_HUB_REQUEST_REVIEW_SUCCESS: SAFETY_HUB_REQUEST_REVIEW_SUCCESS,
|
|
SAFETY_HUB_REQUEST_REVIEW_FAILURE: function({error}) {
|
|
env0_21 = false;
|
|
env0_22 = error;
|
|
}, SAFETY_HUB_REQUEST_AUTOMATED_UNDERAGE_APPEAL_START: function(a0) {
|
|
var r3;
|
|
if (a0 == null) {
|
|
throwTypeError(a0, "Cannot destructure 'undefined' or 'null'.", r3);
|
|
throw undefined;
|
|
}
|
|
env0_26 = '';
|
|
env0_28 = null;
|
|
env0_29 = true;
|
|
}, SAFETY_HUB_REQUEST_AUTOMATED_UNDERAGE_APPEAL_SUCCESS: function(a0) {
|
|
env0_26 = a0.verificationWebviewUrl;
|
|
env0_28 = null;
|
|
env0_29 = false;
|
|
}, SAFETY_HUB_REQUEST_AUTOMATED_UNDERAGE_APPEAL_FAILURE: function({error}) {
|
|
env0_26 = '';
|
|
env0_28 = error;
|
|
env0_29 = false;
|
|
}, SAFETY_HUB_AUTOMATED_UNDERAGE_APPEAL_MODAL_OPEN: closure,
|
|
SAFETY_HUB_AUTOMATED_UNDERAGE_APPEAL_MODAL_CLOSE: closure,
|
|
SAFETY_HUB_AUTOMATED_UNDERAGE_APPEAL_SUBMIT_SUCCESS: SAFETY_HUB_AUTOMATED_UNDERAGE_APPEAL_SUBMIT_SUCCESS,
|
|
SAFETY_HUB_AUTOMATED_UNDERAGE_APPEAL_START_POLL: function(a0) {
|
|
var r3;
|
|
if (a0 == null) {
|
|
throwTypeError(a0, "Cannot destructure 'undefined' or 'null'.", r3);
|
|
throw undefined;
|
|
}
|
|
env0_30 = AgeCheckStatus.LOADING;
|
|
env0_31 = null;
|
|
}, SAFETY_HUB_CHECK_AUTOMATED_UNDERAGE_APPEAL_START: SAFETY_HUB_CHECK_AUTOMATED_UNDERAGE_APPEAL_START,
|
|
SAFETY_HUB_CHECK_AUTOMATED_UNDERAGE_APPEAL_SUCCESS: SAFETY_HUB_CHECK_AUTOMATED_UNDERAGE_APPEAL_SUCCESS,
|
|
SAFETY_HUB_CHECK_AUTOMATED_UNDERAGE_APPEAL_FAILURE: function({error}) {
|
|
env0_30 = AgeCheckStatus.ERROR;
|
|
env0_31 = error;
|
|
}, LOGOUT: function() {
|
|
env0_14 = false;
|
|
env0_11 = {};
|
|
var object = {};
|
|
object.state = require(dependencyMap[6]).AccountStandingState.ALL_GOOD;
|
|
env0_13 = object;
|
|
env0_17 = null;
|
|
env0_23 = AppealIngestionSignal.DIDNT_VIOLATE_POLICY;
|
|
env0_24 = '';
|
|
env0_20 = [];
|
|
}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/safety_hub/SafetyHubStore.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_87847() { // fn#87847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:235, offset: 0x01fce007, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_87847_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun87851(a0) { // fn#87851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:703, offset: 0x01fce09c, size: 627 bytes, params: 2, frame: 16
|
|
const SafetyHubStore2 = SafetyHubStore;
|
|
Inherits(SafetyHubStore2, a0);
|
|
return CreateClass(SafetyHubStore2, [{key: 'isFetching', value: value_87853}, {key: 'getClassifications',
|
|
value: value_87854}, {key: 'getClassification', value: value_87855}, {key: 'getAccountStanding',
|
|
value: value_87856}, {key: 'getFetchError', value: value_87857}, {key: 'isInitialized', value: value_87858},
|
|
{key: 'getClassificationRequestState', value: value_87859}, {key: 'getAppealClassificationId',
|
|
value: value_87860}, {key: 'getIsDsaEligible', value: value_87861}, {key: 'getIsAppealEligible',
|
|
value: value_87862}, {key: 'getAppealEligibility', value: value_87863}, {key: 'getAppealSignal',
|
|
value: function() {
|
|
return DIDNT_VIOLATE_POLICY;
|
|
}}, {key: 'getFreeTextAppealReason', value: value_87865}, {key: 'getIsSubmitting', value: value_87866},
|
|
{key: 'getSubmitError', value: value_87867}, {key: 'getUsername', value: value_87868},
|
|
{key: 'getAgeVerificationWebviewUrl', value: value_87869}, {key: 'getAgeVerificationError', value: value_87870},
|
|
{key: 'getIsLoadingAgeVerification', value: value_87871}, {key: 'getAgeCheckStatus', value: function() {
|
|
return NONE;
|
|
}}, {key: 'getAgeCheckError', value: value_87873}, {key: 'getAgeCheckAttempts', value: value_87874}]);
|
|
function SafetyHubStore() { // fn#87852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:715, offset: 0x011293ae, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_3(this, SafetyHubStore);
|
|
const value3 = env1_6(SafetyHubStore);
|
|
return env1_5(this, _isNativeReflectConstruct_87847() ? global.Reflect.construct(value3, arguments,
|
|
env1_6(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_87853() { // fn#87853, offset: 0x00df0f5a, size: 9 bytes, params: 1, frame: 1
|
|
return env1_14;
|
|
}
|
|
|
|
function value_87854() { // fn#87854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:1057, offset: 0x01fce30f, size: 27 bytes, params: 1, frame: 11
|
|
const Object = global.Object;
|
|
return Object.values(env1_11);
|
|
}
|
|
|
|
function value_87855(a0) { // fn#87855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:1125, offset: 0x0108d3ec, size: 16 bytes, params: 2, frame: 2
|
|
return env1_11[a0];
|
|
}
|
|
|
|
function value_87856() { // fn#87856, offset: 0x00e2f9d5, size: 9 bytes, params: 1, frame: 1
|
|
return env1_13;
|
|
}
|
|
|
|
function value_87857() { // fn#87857, offset: 0x00df0e94, size: 9 bytes, params: 1, frame: 1
|
|
return env1_16;
|
|
}
|
|
|
|
function value_87858() { // fn#87858, offset: 0x00df0e8b, size: 9 bytes, params: 1, frame: 1
|
|
return env1_15;
|
|
}
|
|
|
|
function value_87859(a0) { // fn#87859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:1346, offset: 0x00f8559b, size: 16 bytes, params: 2, frame: 2
|
|
return env1_12[a0];
|
|
}
|
|
|
|
function value_87860() { // fn#87860, offset: 0x00e07553, size: 9 bytes, params: 1, frame: 1
|
|
return env1_17;
|
|
}
|
|
|
|
function value_87861() { // fn#87861, offset: 0x00df0e82, size: 9 bytes, params: 1, frame: 1
|
|
return env1_18;
|
|
}
|
|
|
|
function value_87862() { // fn#87862, offset: 0x00d406a2, size: 9 bytes, params: 1, frame: 1
|
|
return env1_19;
|
|
}
|
|
|
|
function value_87863() { // fn#87863, offset: 0x00e4253a, size: 9 bytes, params: 1, frame: 1
|
|
return env1_20;
|
|
}
|
|
|
|
function value_87865() { // fn#87865, offset: 0x00df3acd, size: 9 bytes, params: 1, frame: 1
|
|
return env1_24;
|
|
}
|
|
|
|
function value_87866() { // fn#87866, offset: 0x00f854d6, size: 9 bytes, params: 1, frame: 1
|
|
return env1_21;
|
|
}
|
|
|
|
function value_87867() { // fn#87867, offset: 0x00e425c8, size: 9 bytes, params: 1, frame: 1
|
|
return env1_22;
|
|
}
|
|
|
|
function value_87868() { // fn#87868, offset: 0x00df3ad6, size: 9 bytes, params: 1, frame: 1
|
|
return env1_25;
|
|
}
|
|
|
|
function value_87869() { // fn#87869, offset: 0x00df3adf, size: 9 bytes, params: 1, frame: 1
|
|
return env1_26;
|
|
}
|
|
|
|
function value_87870() { // fn#87870, offset: 0x0108042c, size: 9 bytes, params: 1, frame: 1
|
|
return env1_28;
|
|
}
|
|
|
|
function value_87871() { // fn#87871, offset: 0x00ef0ca7, size: 9 bytes, params: 1, frame: 1
|
|
return env1_29;
|
|
}
|
|
|
|
function value_87873() { // fn#87873, offset: 0x00df3abb, size: 9 bytes, params: 1, frame: 1
|
|
return env1_31;
|
|
}
|
|
|
|
function value_87874() { // fn#87874, offset: 0x00df3b32, size: 9 bytes, params: 1, frame: 1
|
|
return env1_27;
|
|
}
|
|
|
|
}
|
|
|
|
function SAFETY_HUB_FETCH_CLASSIFICATION_START({classificationId}) { // fn#87878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:2658, offset: 0x01fce3bd, size: 62 bytes, params: 2, frame: 14
|
|
const binding = env0_12;
|
|
const ClassificationRequestState = (SafetyHubModelsModule).ClassificationRequestState;
|
|
const PENDING = ClassificationRequestState.PENDING;
|
|
binding[classificationId] = PENDING;
|
|
}
|
|
|
|
function SAFETY_HUB_FETCH_CLASSIFICATION_SUCCESS({classification, accountStanding, isDsaEligible, username, isAppealEligible}) { // fn#87879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:2812, offset: 0x01fce3fb, size: 132 bytes, params: 2, frame: 18
|
|
let binding = env0_11;
|
|
let id = classification.id;
|
|
binding[id] = classification;
|
|
binding = env0_12;
|
|
id = classification.id;
|
|
const ClassificationRequestState = (SafetyHubModelsModule).ClassificationRequestState;
|
|
const SUCCESS = ClassificationRequestState.SUCCESS;
|
|
binding[id] = SUCCESS;
|
|
}
|
|
|
|
function SAFETY_HUB_FETCH_CLASSIFICATION_FAILURE({error, classificationId}) { // fn#87880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:3073, offset: 0x01fce47f, size: 75 bytes, params: 2, frame: 15
|
|
const binding = env0_12;
|
|
const ClassificationRequestState = (SafetyHubModelsModule).ClassificationRequestState;
|
|
const FAILED = ClassificationRequestState.FAILED;
|
|
binding[classificationId] = FAILED;
|
|
}
|
|
|
|
function SAFETY_HUB_REQUEST_REVIEW_SUCCESS({classificationId}) { // fn#87886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:3693, offset: 0x01fce554, size: 80 bytes, params: 2, frame: 13
|
|
const property = env0_11[classificationId];
|
|
const AppealStatusType = (SafetyHubModelsModule).AppealStatusType;
|
|
const REVIEW_PENDING = AppealStatusType.REVIEW_PENDING;
|
|
property.appeal_status = {status: REVIEW_PENDING};
|
|
}
|
|
|
|
function SAFETY_HUB_AUTOMATED_UNDERAGE_APPEAL_SUBMIT_SUCCESS(a0) { // fn#87891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:4608, offset: 0x01fce631, size: 142 bytes, params: 2, frame: 22
|
|
var r6;
|
|
var propertyName;
|
|
var propertyName2;
|
|
var is_coppa;
|
|
var property;
|
|
var AppealStatusType;
|
|
var REVIEW_PENDING;
|
|
if (a0 == null) {
|
|
throwTypeError(a0, "Cannot destructure 'undefined' or 'null'.", undefined);
|
|
throw undefined;
|
|
}
|
|
env0_30 = AgeCheckStatus.LOADING;
|
|
for (propertyName in env0_11) {
|
|
is_coppa = env0_11[propertyName].is_coppa;
|
|
if (!is_coppa) {
|
|
r6 = propertyName2;
|
|
continue;
|
|
}
|
|
property = env0_11[propertyName];
|
|
AppealStatusType = (require(5268) /* metro dependency 5268: SafetyHubModels */).AppealStatusType;
|
|
REVIEW_PENDING = AppealStatusType.REVIEW_PENDING;
|
|
property.appeal_status = {status: REVIEW_PENDING};
|
|
r6 = propertyName2;
|
|
}
|
|
}
|
|
|
|
function SAFETY_HUB_CHECK_AUTOMATED_UNDERAGE_APPEAL_START(a0) { // fn#87893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:4962, offset: 0x01fce6f2, size: 66 bytes, params: 2, frame: 13
|
|
if (a0 == null) {
|
|
throwTypeError(a0, "Cannot destructure 'undefined' or 'null'.", undefined);
|
|
throw undefined;
|
|
}
|
|
env0_30 = AgeCheckStatus.LOADING;
|
|
env0_27 += 1;
|
|
}
|
|
|
|
function SAFETY_HUB_CHECK_AUTOMATED_UNDERAGE_APPEAL_SUCCESS({success}) { // fn#87894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11659:5092, offset: 0x01fce734, size: 75 bytes, params: 2, frame: 3
|
|
env0_30 = success ? AgeCheckStatus.SUCCESS : env0_27 < AGE_CHECK_MAX_POLL_ATTEMPTS ? AgeCheckStatus.LOADING : AgeCheckStatus.FAILURE;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun87846, 11473, [6, 7, 15, 17, 18, 5267, 5268, 11474, 566, 694,
|
|
2]) /* metro module 11473, dependencies: [6, 7, 15, 17, 18, 5267, 5268, 11474, 566, 694, 2] */;
|