134 lines
6.0 KiB
React
134 lines
6.0 KiB
React
/* Metro module 1532; source: unknown; dependencies: [57, 65, 31, 33, 1493, 1530, 1511, 1531, 1533] */
|
|
function _fun17322(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#17322, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1659:6, offset: 0x00e69f5c, size: 153 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importDefault(65) /* metro dependency 65 */;
|
|
const env0_5 = importAll(31) /* metro dependency 31 */;
|
|
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
|
|
exports.default = PreventRemoveProvider;
|
|
}
|
|
|
|
function transformPreventedRoutes(a0) { // fn#17323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1659:142, offset: 0x00e69ff5, size: 49 bytes, params: 2, frame: 13
|
|
const binding = env0_4;
|
|
let value = a0.values();
|
|
value = binding(value);
|
|
return value.reduce(function(a0, {routeKey, preventRemove}) {
|
|
var r3;
|
|
r3 = a0[routeKey]?.preventRemove;
|
|
r3 = !r3 ? preventRemove : r3;
|
|
a0[routeKey] = {preventRemove: r3};
|
|
return a0;
|
|
}, {});
|
|
}
|
|
|
|
function PreventRemoveProvider({children}) { // fn#17325, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1659:349, offset: 0x00e6a060, size: 429 bytes, params: 2, frame: 24
|
|
const binding = env0_5;
|
|
let useState = binding.useState;
|
|
const value2 = Reflect.apply(useState, binding, [_fun17326]);
|
|
const binding2 = env0_3;
|
|
const property = binding2(value2, 1)[0];
|
|
useState = binding.useState;
|
|
const Map = global.Map;
|
|
const value5 = Object.create(Map.prototype, {constructor: {value: Map}});
|
|
const map = new Map();
|
|
const value8 = binding2(Reflect.apply(useState, binding, [map instanceof Object ? map : value5]), 2);
|
|
const property2 = value8[0];
|
|
const env0_2 = value8[1];
|
|
var env0_3 = binding.useContext(importDefault(1530) /* metro dependency 1530 */);
|
|
const value9 = binding.useContext(importDefault(1511) /* metro dependency 1511 */);
|
|
const env0_4 = value9;
|
|
const setPreventRemove = binding.useContext(importDefault(1531) /* metro dependency 1531 */)?.setPreventRemove;
|
|
var env0_5 = setPreventRemove;
|
|
const value11 = (importDefault(1533) /* metro dependency 1533 */)(_fun17327);
|
|
env0_5.useEffect(_fun17331, [property, env0_4(property2.values()).some(function(a0) {
|
|
return a0.preventRemove;
|
|
}), value9?.key, setPreventRemove]);
|
|
const value14 = env0_5.useMemo(_fun17333, [value11, property2]);
|
|
const Provider = (importDefault(1531) /* metro dependency 1531 */).Provider;
|
|
return (
|
|
<Provider value={value14}>
|
|
{children}
|
|
</Provider>
|
|
);
|
|
}
|
|
|
|
function _fun17326() { // fn#17326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1659:414, offset: 0x00e6a20d, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (require(1493) /* metro dependency 1493 */).nanoid();
|
|
}
|
|
|
|
function _fun17327(a0, a1, a2) { // fn#17327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1659:628, offset: 0x00e6a232, size: 166 bytes, params: 4, frame: 14
|
|
var value;
|
|
var binding;
|
|
var routes;
|
|
var Error;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
if (a2) {
|
|
if (env0_3 == null) {
|
|
Error = global.Error;
|
|
value = "Couldn't find a route with the key " + a1 + '. Is your component inside NavigationContent?';
|
|
throw new Error();
|
|
}
|
|
if (env0_3 == null) {
|
|
env0_2(_fun17329);
|
|
return undefined;
|
|
}
|
|
binding = env0_3;
|
|
routes = binding.getState().routes;
|
|
if (routes.every(function({key}) {
|
|
return key !== require;
|
|
})) {
|
|
Error = global.Error;
|
|
value = "Couldn't find a route with the key " + a1 + '. Is your component inside NavigationContent?';
|
|
throw new Error();
|
|
}
|
|
}
|
|
env0_2(_fun17329);
|
|
}
|
|
|
|
function _fun17331() { // fn#17331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1659:1117, offset: 0x00e6a3a7, size: 80 bytes, params: 1, frame: 15
|
|
const value2 = undefined;
|
|
if (value2 !== (env0_4 == null ? value2 : env0_4.key)) {
|
|
if (value2 !== setPreventRemove) {
|
|
setPreventRemove(env0_0, env0_4.key, env0_7);
|
|
return _fun17332;
|
|
}
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function _fun17333() { // fn#17333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1659:1270, offset: 0x00e6a418, size: 39 bytes, params: 1, frame: 12
|
|
const object2 = {};
|
|
object2.setPreventRemove = env0_6;
|
|
object2.preventedRoutes = transformPreventedRoutes(env0_1);
|
|
return object2;
|
|
}
|
|
|
|
function _fun17329(a0) { // fn#17329, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1659:836, offset: 0x00e6a2ed, size: 175 bytes, params: 2, frame: 17
|
|
const value2 = a0.get(env0_0);
|
|
const value3 = undefined;
|
|
if (require === (value2 == null ? value3 : value2.routeKey)) {
|
|
var value4 = a0.get(env0_0);
|
|
if (importDefault === (value4 == null ? value3 : value4.preventRemove)) {
|
|
return a0;
|
|
}
|
|
}
|
|
const Map = global.Map;
|
|
const map = new Map(a0);
|
|
if (importDefault) {
|
|
map.set(env0_0, {routeKey: require, preventRemove: importDefault});
|
|
} else {
|
|
map.delete(env0_0);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
function _fun17332() { // fn#17332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1659:1195, offset: 0x00e6a3f7, size: 33 bytes, params: 1, frame: 15
|
|
setPreventRemove(env1_0, env1_4.key, false);
|
|
}
|
|
|