96 lines
5.3 KiB
TypeScript
96 lines
5.3 KiB
TypeScript
/* Metro module 4667; source: modules/native_permissions/NativePermissionStore.tsx; dependencies: [6, 7, 15, 17, 18, 4661, 661, 694, 683, 566, 2] */
|
|
function _fun40403(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:6, offset: 0x010ffb0b, size: 289 bytes, params: 8, frame: 19
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
|
const env0_7 = (require(4661) /* metro dependency 4661: NativePermissionConstants */).NativePermissionStates;
|
|
const env0_8 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
|
|
object = {permissionStates: {}};
|
|
const DeviceSettingsStore = (importDefault(566) /* metro dependency 566: flux */).DeviceSettingsStore;
|
|
const value = _fun40407(DeviceSettingsStore);
|
|
value.displayName = 'NativePermissionStore';
|
|
value.persistKey = 'NativePermissionsStore';
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/native_permissions/NativePermissionStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_40404() { // fn#40404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:206, offset: 0x010ffc2c, size: 94 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_40404_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun40407(a0) { // fn#40407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:429, offset: 0x010ffc8a, size: 139 bytes, params: 2, frame: 16
|
|
const closure = NativePermissionStore;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'initialize', value: value_40410}, {key: 'getUserAgnosticState', value: value_40411},
|
|
{key: 'hasPermission', value: value_40412}, {key: 'handleSetNativePermission', value: value_40413}]);
|
|
}
|
|
|
|
function NativePermissionStore() { // fn#40408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:441, offset: 0x010ffd15, size: 154 bytes, params: 1, frame: 20
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
env1_2(this, NativePermissionStore);
|
|
const items2 = [importDefault(694) /* metro dependency 694: Dispatcher */];
|
|
items2[1] = {SET_NATIVE_PERMISSION: SET_NATIVE_PERMISSION_40409};
|
|
const value3 = env1_5(NativePermissionStore);
|
|
return env1_4(this, _isNativeReflectConstruct_40404() ? global.Reflect.construct(value3, items2,
|
|
env1_5(this).constructor) : value3.apply(this, items2));
|
|
}
|
|
|
|
function value_40410(a0) { // fn#40410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:830, offset: 0x010ffdc8, size: 27 bytes, params: 2, frame: 2
|
|
const r1 = a0 ?? env1_9;
|
|
value = environment.__proto__;
|
|
}
|
|
|
|
function value_40412(a0) { // fn#40412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:941, offset: 0x010ffde3, size: 45 bytes, params: 2, frame: 4
|
|
const value = environment.__proto__;
|
|
const property = env1_9.permissionStates[a0];
|
|
return property != null && property === NativePermissionStates.ACCEPTED;
|
|
}
|
|
|
|
function value_40413({state, permissionType}) { // fn#40413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:1053, offset: 0x010ffe10, size: 119 bytes, params: 2, frame: 17
|
|
var defaultImport;
|
|
const permissionStates = env1_9.permissionStates;
|
|
const property = permissionStates[permissionType];
|
|
permissionStates[permissionType] = state;
|
|
if (property !== state) {
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport.track(AnalyticEvents.PERMISSIONS_ACKED, {type: permissionType, action: state,
|
|
previous_action: property ?? NativePermissionStates.NONE});
|
|
}
|
|
}
|
|
|
|
function NativePermissionStoreSET_NATIVE_PERMISSION(a0) { // fn#40409, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4845:710, owner: NativePermissionStore.SET_NATIVE_PERMISSION, offset: 0x010ffdaf, size: 25 bytes, params: 2, frame: 11
|
|
return env0_0.handleSetNativePermission(a0);
|
|
}
|
|
|