212 lines
11 KiB
JavaScript
212 lines
11 KiB
JavaScript
/* Metro module 1568; source: unknown; dependencies: [31, 27, 1487, 1569] */
|
|
import * as ReactNativeModule from './module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
|
|
|
|
function _fun17541(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#17541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:6, offset: 0x00e6f7a3, size: 119 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const value = ReactNativeModule;
|
|
const env0_4 = value.Linking;
|
|
value.Platform;
|
|
exports.default = useLinking;
|
|
function useLinking(a0, {independent, enabled, prefixes, filter, config, getInitialURL, subscribe, getStateFromPath, getActionFromState}) { // fn#17542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:154, offset: 0x00e6f81a, size: 433 bytes, params: 3, frame: 24
|
|
const env0_0 = a0;
|
|
const r8 = enabled === undefined || enabled;
|
|
const filter2 = filter;
|
|
const r7 = getInitialURL !== undefined ? getInitialURL : _fun17543;
|
|
const r5 = subscribe !== undefined ? subscribe : _fun17545;
|
|
getStateFromPath = getStateFromPath === undefined ? (require(1487) /* metro dependency 1487 */).getStateFromPath : getStateFromPath;
|
|
getActionFromState = getActionFromState === undefined ? (require(1487) /* metro dependency 1487 */).getActionFromState : getActionFromState;
|
|
const binding = filter2;
|
|
binding.useEffect(function() {
|
|
}, [r8, independent]);
|
|
const env0_9 = binding.useRef(r8);
|
|
const env0_10 = binding.useRef(prefixes);
|
|
const env0_11 = binding.useRef(filter);
|
|
const env0_12 = binding.useRef(config);
|
|
const env0_13 = binding.useRef(r7);
|
|
const env0_14 = binding.useRef(getStateFromPath);
|
|
const env0_15 = binding.useRef(getActionFromState);
|
|
binding.useEffect(_fun17549);
|
|
value = binding.useCallback(_fun17550, []);
|
|
const value2 = binding.useCallback(_fun17551, [value]);
|
|
binding.useEffect(_fun17555, [r8, value, a0, r5]);
|
|
return {getInitialState: value2};
|
|
function _fun17543() { // fn#17543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:293, offset: 0x00e6f9cb, size: 83 bytes, params: 1, frame: 14
|
|
var environment;
|
|
const Promise = global.Promise;
|
|
const race = Promise.race;
|
|
const value = environment.__proto__;
|
|
const items2 = [Linking.getInitialURL()];
|
|
const Promise2 = global.Promise;
|
|
items2[1] = new Promise2(function(a0) {
|
|
return (0, global.setTimeout)(a0, 150);
|
|
});
|
|
return Reflect.apply(race, Promise, [items2]);
|
|
}
|
|
|
|
function _fun17545(a0) { // fn#17545, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:428, offset: 0x00e6fa36, size: 87 bytes, params: 2, frame: 15
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const callback_175462 = callback_17546;
|
|
const value = environment.__proto__;
|
|
const env0_2 = Linking.addEventListener('url', callback_175462);
|
|
const env0_3 = Linking.removeEventListener?.bind(Linking);
|
|
return _fun17547;
|
|
function callback_17546({url}) { // fn#17546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:448, offset: 0x00e6fa8d, size: 24 bytes, params: 2, frame: 11
|
|
return env0_0(url);
|
|
}
|
|
|
|
function _fun17547() { // fn#17547, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:582, offset: 0x00e6faa5, size: 74 bytes, params: 1, frame: 14
|
|
if (env0_2 == null) {
|
|
if (env0_3 != null) {
|
|
env0_3('url', callback_17546);
|
|
}
|
|
} else if (env0_2.remove) {
|
|
env0_2.remove();
|
|
} else if (env0_3 != null) {
|
|
env0_3('url', callback_17546);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun17549() { // fn#17549, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:923, offset: 0x00e6faef, size: 105 bytes, params: 1, frame: 3
|
|
env0_9.current = env0_1;
|
|
env0_10.current = prefixes;
|
|
env0_11.current = filter;
|
|
env0_12.current = config;
|
|
env0_13.current = env0_5;
|
|
env0_14.current = getStateFromPath;
|
|
env0_15.current = getActionFromState;
|
|
}
|
|
|
|
function _fun17550(a0) { // fn#17550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:1042, offset: 0x00e6fb58, size: 112 bytes, params: 2, frame: 14
|
|
var current;
|
|
var binding;
|
|
var value2;
|
|
var value3;
|
|
var defaultImport;
|
|
var value4;
|
|
if (a0) {
|
|
current = env0_11.current;
|
|
if (current) {
|
|
binding = env0_11;
|
|
if (binding.current(a0)) {
|
|
value2 = environment.__proto__;
|
|
value3 = undefined;
|
|
value4 = (importDefault(1569) /* metro dependency 1569 */)(env0_10.current, a0);
|
|
return value3 === value4 ? value3 : env0_14.current(value4, env0_12.current);
|
|
}
|
|
return undefined;
|
|
}
|
|
value2 = environment.__proto__;
|
|
value3 = undefined;
|
|
defaultImport = importDefault(1569) /* metro dependency 1569 */;
|
|
current = env0_10.current;
|
|
value4 = defaultImport(current, a0);
|
|
return value3 === value4 ? value3 : env0_14.current(value4, env0_12.current);
|
|
}
|
|
}
|
|
|
|
function _fun17551() { // fn#17551, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:1187, offset: 0x00e6fbc8, size: 106 bytes, params: 1, frame: 13
|
|
var value2;
|
|
if (env0_9.current) {
|
|
value2 = env0_13.current();
|
|
if (value2 == null) {
|
|
var env0_0 = env0_16(value2);
|
|
return {then: then_17553, catch: _catch_17554};
|
|
}
|
|
if (typeof value2 !== 'string') {
|
|
return value2.then(_fun17552);
|
|
}
|
|
var env0_0 = env0_16(value2);
|
|
}
|
|
return {then: then_17553, catch: _catch_17554};
|
|
function _fun17552(a0) { // fn#17552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:1282, offset: 0x00e6fc32, size: 19 bytes, params: 2, frame: 11
|
|
return env1_16(a0);
|
|
}
|
|
|
|
function then_17553(a0) { // fn#17553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:1328, offset: 0x00e6fc45, size: 45 bytes, params: 2, frame: 14
|
|
const Promise = global.Promise;
|
|
const resolve = Promise.resolve;
|
|
const binding = env0_0;
|
|
return Reflect.apply(resolve, Promise, [a0 ? a0(binding) : binding]);
|
|
}
|
|
|
|
function _catch_17554() { // fn#17554, offset: 0x00c38205, size: 9 bytes, params: 1, frame: 1
|
|
return env0_1;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun17555() { // fn#17555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:1450, offset: 0x00e6fc72, size: 23 bytes, params: 1, frame: 11
|
|
return env0_6(listener_17556);
|
|
function listener_17556(a0) { // fn#17556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:1471, offset: 0x00e6fc89, size: 305 bytes, params: 2, frame: 20
|
|
var r7;
|
|
var r6;
|
|
var current;
|
|
var routes;
|
|
var binding;
|
|
var value4;
|
|
var error;
|
|
var console;
|
|
var warn;
|
|
var message;
|
|
const value = undefined;
|
|
if (env1_1) {
|
|
current = env1_0.current;
|
|
r7 = current ? env1_16(a0) : value;
|
|
if (current) {
|
|
if (r7) {
|
|
var env0_0 = current.getRootState();
|
|
routes = r7.routes;
|
|
if (routes.some(_fun17557)) {
|
|
global.console.warn("The navigation state parsed from the URL contains routes not present in the root navigator. This usually means that the linking configuration doesn't match the navigation structure. See https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration.");
|
|
return value;
|
|
}
|
|
binding = env1_15;
|
|
value4 = binding.current(r7, env1_12.current);
|
|
if (value !== value4) {
|
|
try {
|
|
current.dispatch(value4);
|
|
} catch (error) {
|
|
console = global.console;
|
|
warn = console.warn;
|
|
if (typeof error !== 'object') {
|
|
r6 = error;
|
|
} else if (error == null) {
|
|
r6 = error;
|
|
} else if ('message' in error) {
|
|
message = error.message;
|
|
r6 = message;
|
|
} else {
|
|
r6 = error;
|
|
}
|
|
Reflect.apply(warn, console,
|
|
["An error occurred when trying to handle the link '" + a0 + "': " + r6]);
|
|
}
|
|
} else {
|
|
current.resetRoot(r7);
|
|
}
|
|
return value;
|
|
}
|
|
return value;
|
|
}
|
|
}
|
|
return value;
|
|
function _fun17557(a0) { // fn#17557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1695:1580, offset: 0x00e6fdba, size: 49 bytes, params: 2, frame: 12
|
|
return !(env0_0 != null && env0_0.routeNames.includes(a0.name));
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun17541, 1568, [31, 27, 1487, 1569]) /* metro module 1568, dependencies: [31, 27, 1487, 1569] */;
|