160 lines
9.1 KiB
JavaScript
160 lines
9.1 KiB
JavaScript
/* Metro module 1462; source: unknown; dependencies: [5, 7, 6, 1463, 1465, 1466] */
|
|
import Module00005 from './module-00005.js'; /* Metro dependency 5 */
|
|
import ClassCallCheck from './module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from './module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import Module01463 from './module-01463.js'; /* Metro dependency 1463 */
|
|
import Module01465 from './module-01465.js'; /* Metro dependency 1465 */
|
|
import * as DEVICE_CONNECTIVITY_EVENTModule from './module-01466-DEVICE_CONNECTIVITY_EVENT.js'; /* Metro dependency 1466 */
|
|
|
|
function _fun16753(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#16753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:6, offset: 0x00e59252, size: 125 bytes, params: 8, frame: 18
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const value = CreateClass;
|
|
exports.default = value(State);
|
|
function State(a0) { // fn#16754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:131, offset: 0x00e592cf, size: 299 bytes, params: 2, frame: 18
|
|
ClassCallCheck(this, State);
|
|
this._nativeEventSubscription = null;
|
|
const Set = global.Set;
|
|
const value2 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
const set = new Set();
|
|
this._subscriptions = set instanceof Object ? set : value2;
|
|
this._latestState = null;
|
|
this._handleNativeStateUpdate = _handleNativeStateUpdate;
|
|
this._handleInternetReachabilityUpdate = _handleInternetReachabilityUpdate;
|
|
this._fetchCurrentState = _fun16759();
|
|
this._convertState = _convertState;
|
|
this.latest = latest;
|
|
this.add = add_16766;
|
|
this.remove = remove_16767;
|
|
this.tearDown = tearDown;
|
|
const defaultImport = Module01465;
|
|
var _handleInternetReachabilityUpdate = this._handleInternetReachabilityUpdate;
|
|
const value4 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
|
|
const defaultImport2 = new defaultImport(a0, _handleInternetReachabilityUpdate);
|
|
this._internetReachability = defaultImport2 instanceof Object ? defaultImport2 : value4;
|
|
const eventEmitter = (Module01463).eventEmitter;
|
|
const addListener = eventEmitter.addListener;
|
|
const DEVICE_CONNECTIVITY_EVENT = (DEVICE_CONNECTIVITY_EVENTModule).DEVICE_CONNECTIVITY_EVENT;
|
|
var _handleNativeStateUpdate = this._handleNativeStateUpdate;
|
|
this._nativeEventSubscription = Reflect.apply(addListener, eventEmitter, [DEVICE_CONNECTIVITY_EVENT,
|
|
_handleNativeStateUpdate]);
|
|
this._fetchCurrentState();
|
|
function _handleNativeStateUpdate(a0) { // fn#16755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:290, owner: State._handleNativeStateUpdate, offset: 0x00e593fa, size: 75 bytes, params: 2, frame: 13
|
|
const binding = env0_0;
|
|
binding._internetReachability.update(a0);
|
|
binding._latestState = binding._convertState(a0);
|
|
binding._subscriptions.forEach(_fun16756);
|
|
function _fun16756(a0) { // fn#16756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:404, offset: 0x00c44018, size: 19 bytes, params: 2, frame: 11
|
|
return a0(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function _handleInternetReachabilityUpdate(a0) { // fn#16757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:471, owner: State._handleInternetReachabilityUpdate, offset: 0x00e59445, size: 95 bytes, params: 2, frame: 17
|
|
var Object;
|
|
var assign;
|
|
var binding;
|
|
if (env0_0._latestState) {
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
binding = env0_0;
|
|
binding._latestState = Reflect.apply(assign, Object, [{}, binding._latestState, {isInternetReachable: a0}]);
|
|
binding._subscriptions.forEach(_fun16758);
|
|
}
|
|
function _fun16758(a0) { // fn#16758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:608, offset: 0x00c44018, size: 19 bytes, params: 2, frame: 11
|
|
return a0(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun16759() { // fn#16759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:661, offset: 0x00e594a4, size: 32 bytes, params: 1, frame: 12
|
|
const env0_0 = env1_3(_fun16761);
|
|
return _fun16763;
|
|
function* _fun16761(a0) { // fn#16761, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:681, offset: 0x00e594cd, size: 149 bytes, params: 2, frame: 16
|
|
var environment;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
value = env3_0(env3_2[3]);
|
|
const getCurrentState = value.getCurrentState;
|
|
yield Reflect.apply(getCurrentState, value, [a0]);
|
|
value = undefined;
|
|
if (true) {
|
|
importDefault._internetReachability.update(value);
|
|
value = importDefault._convertState(value);
|
|
if (!a0) {
|
|
importDefault._latestState = value;
|
|
importDefault._subscriptions.forEach(_fun16762);
|
|
}
|
|
}
|
|
return value;
|
|
function _fun16762(a0) { // fn#16762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:846, offset: 0x00c44018, size: 19 bytes, params: 2, frame: 11
|
|
return a0(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun16763(a0) { // fn#16763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:886, offset: 0x00c3945f, size: 30 bytes, params: 2, frame: 13
|
|
return env0_0.apply(this, arguments);
|
|
}
|
|
|
|
}
|
|
|
|
function _convertState(a0) { // fn#16764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:952, owner: State._convertState, offset: 0x00e59562, size: 77 bytes, params: 2, frame: 17
|
|
var r0;
|
|
var Object;
|
|
var assign;
|
|
var object;
|
|
let value = a0;
|
|
if (typeof value.isInternetReachable === 'boolean') {
|
|
r0 = value;
|
|
} else {
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
object = {};
|
|
object.isInternetReachable = env0_0._internetReachability.currentState();
|
|
value = Reflect.apply(assign, Object, [{}, value, object]);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function latest(a0) { // fn#16765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:1106, owner: State.latest, offset: 0x00e595af, size: 81 bytes, params: 2, frame: 14
|
|
const binding = env0_0;
|
|
return a0 ? binding._fetchCurrentState(a0) : binding._latestState ? global.Promise.resolve(env0_0._latestState) : env0_0._fetchCurrentState();
|
|
}
|
|
|
|
function StateAdd(a0) { // fn#16766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:1231, owner: State.add, offset: 0x00e59600, size: 78 bytes, params: 2, frame: 13
|
|
let binding = env0_0;
|
|
binding._subscriptions.add(a0);
|
|
const _latestState = binding._latestState;
|
|
binding = env0_0;
|
|
if (_latestState) {
|
|
a0(binding._latestState);
|
|
} else {
|
|
binding.latest().then(a0);
|
|
}
|
|
}
|
|
|
|
function StateRemove(a0) { // fn#16767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:1332, owner: State.remove, offset: 0x00e5964e, size: 30 bytes, params: 2, frame: 11
|
|
env0_0._subscriptions.delete(a0);
|
|
}
|
|
|
|
function StateTearDown() { // fn#16768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1589:1386, owner: State.tearDown, offset: 0x00e5966c, size: 93 bytes, params: 1, frame: 10
|
|
if (env0_0._internetReachability) {
|
|
env0_0._internetReachability.tearDown();
|
|
}
|
|
if (env0_0._nativeEventSubscription) {
|
|
env0_0._nativeEventSubscription.remove();
|
|
}
|
|
env0_0._subscriptions.clear();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun16753, 1462, [5, 7, 6, 1463, 1465,
|
|
1466]) /* metro module 1462, dependencies: [5, 7, 6, 1463, 1465, 1466] */;
|