356 lines
16 KiB
React
356 lines
16 KiB
React
/* Metro module 1495; source: unknown; dependencies: [1492, 1493] */
|
|
function _fun17033(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#17033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:6, offset: 0x00e620a9, size: 115 bytes, params: 8, frame: 16
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
exports.default = TabRouter;
|
|
exports.TabActions = {jumpTo: function(a0, a1) {
|
|
return {type: 'JUMP_TO', payload: {name: a0, params: a1}};
|
|
}};
|
|
}
|
|
|
|
function getRouteHistory(a0, a1, a2, a3) { // fn#17035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:192, offset: 0x00e62140, size: 238 bytes, params: 5, frame: 17
|
|
var r6;
|
|
var r4;
|
|
var findIndex;
|
|
var index;
|
|
var value2;
|
|
var unshift;
|
|
let value = a1;
|
|
const env0_0 = a3;
|
|
let key = a0[value].key;
|
|
const items2 = [{type: 'route', key: key}];
|
|
if (a2 === 'order') {
|
|
if (value > 0) {
|
|
r4 = value;
|
|
reducibleLoop9: while (true) {
|
|
unshift = items2.unshift;
|
|
key = a0[r4 - 1].key;
|
|
Reflect.apply(unshift, items2, [{type: 'route', key: key}]);
|
|
value = typeof r4 === 'bigint' ? r4 - 1n : +r4 - 1;
|
|
if (value > 0) {
|
|
r4 = value;
|
|
continue reducibleLoop9;
|
|
}
|
|
break reducibleLoop9;
|
|
}
|
|
}
|
|
} else if (a2 === 'firstRoute') {
|
|
reducibleJoin10: while (true) {
|
|
if (value === 0) {
|
|
break reducibleJoin10;
|
|
}
|
|
unshift = items2.unshift;
|
|
key = a0[0].key;
|
|
Reflect.apply(unshift, items2, [{type: 'route', key: key}]);
|
|
break reducibleJoin10;
|
|
}
|
|
} else {
|
|
reducibleJoin10: while (true) {
|
|
if (a2 !== 'initialRoute') {
|
|
break reducibleJoin10;
|
|
}
|
|
findIndex = a0.findIndex;
|
|
index = Reflect.apply(findIndex, a0, [function({name}) {
|
|
return name === importAll;
|
|
}]);
|
|
value2 = 0;
|
|
r6 = index === -1 ? value2 : index;
|
|
if (value === r6) {
|
|
break reducibleJoin10;
|
|
}
|
|
unshift = items2.unshift;
|
|
key = a0[r6].key;
|
|
Reflect.apply(unshift, items2, [{type: 'route', key: key}]);
|
|
break reducibleJoin10;
|
|
}
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function changeIndex(a0, a1, a2, a3) { // fn#17037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:536, offset: 0x00e62243, size: 148 bytes, params: 5, frame: 19
|
|
var r0;
|
|
var value;
|
|
var key;
|
|
if (a2 === 'history') {
|
|
key = a0.routes[a1].key;
|
|
value = a0.history.filter(_fun17038);
|
|
value = value.concat({type: 'route', key: key});
|
|
r0 = value;
|
|
} else {
|
|
r0 = getRouteHistory(a0.routes, a1, a2, a3);
|
|
}
|
|
const Object = global.Object;
|
|
return Object.assign({}, a0, {index: a1, history: r0});
|
|
}
|
|
|
|
function TabRouter({initialRouteName, backBehavior}) { // fn#17039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:787, offset: 0x00e622fc, size: 165 bytes, params: 2, frame: 18
|
|
const env0_1 = backBehavior === undefined ? 'firstRoute' : backBehavior;
|
|
const Object = global.Object;
|
|
return Object.assign({}, importDefault(1492) /* metro dependency 1492 */, {type: 'tab',
|
|
getInitialState: getInitialState, getRehydratedState: getRehydratedState,
|
|
getStateForRouteNamesChange: getStateForRouteNamesChange, getStateForRouteFocus: getStateForRouteFocus,
|
|
getStateForAction: getStateForAction_17054, shouldActionChangeFocus: function(a0) {
|
|
return a0.type === 'NAVIGATE';
|
|
}, actionCreators: env0_3});
|
|
}
|
|
|
|
function _fun17038(a0) { // fn#17038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:632, offset: 0x00e622d7, size: 37 bytes, params: 2, frame: 3
|
|
return a0.type === 'route' && a0.key !== key;
|
|
}
|
|
|
|
function TabRouterGetInitialState({routeNames, routeParamList}) { // fn#17040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:940, owner: TabRouter.getInitialState, offset: 0x00e623a1, size: 205 bytes, params: 2, frame: 20
|
|
const r4 = initialRouteName === undefined ? 0 : routeNames.includes(initialRouteName) ? routeNames.indexOf(initialRouteName) : 0;
|
|
const value4 = routeNames.map(_fun17041);
|
|
const routeHistory = getRouteHistory(value4, r4, env0_1, initialRouteName);
|
|
const object2 = {'stale': false, 'type': 'tab'};
|
|
object2.key = 'tab-' + (require(1493) /* metro dependency 1493 */).nanoid();
|
|
object2.index = r4;
|
|
object2.routeNames = routeNames;
|
|
object2.history = routeHistory;
|
|
object2.routes = value4;
|
|
return object2;
|
|
}
|
|
|
|
function TabRouterGetRehydratedState(a0, {routeNames, routeParamList}) { // fn#17042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:1264, owner: TabRouter.getRehydratedState, offset: 0x00e624cc, size: 335 bytes, params: 3, frame: 28
|
|
const env0_1 = a0;
|
|
if (a0.stale === false) {
|
|
return a0;
|
|
}
|
|
const value = routeNames.map(_fun17043);
|
|
const Math = global.Math;
|
|
const min = Math.min;
|
|
const Math2 = global.Math;
|
|
const max = Math2.max;
|
|
const indexOf = routeNames.indexOf;
|
|
const routes = a0.routes;
|
|
let r2 = a0?.index ?? 0;
|
|
const value5 = Reflect.apply(min, Math, [Reflect.apply(max, Math2, [Reflect.apply(indexOf, routeNames,
|
|
[routes[r2]?.name]), 0]), value.length - 1]);
|
|
r2 = a0.history?.filter(_fun17045);
|
|
r2 = r2 ?? [];
|
|
const changeIndexBinding = changeIndex;
|
|
const object2 = {'stale': false, 'type': 'tab'};
|
|
object2.key = 'tab-' + (require(1493) /* metro dependency 1493 */).nanoid();
|
|
object2.index = value5;
|
|
object2.routeNames = routeNames;
|
|
object2.history = r2;
|
|
object2.routes = value;
|
|
return changeIndexBinding(object2, value5, env0_1, initialRouteName);
|
|
}
|
|
|
|
function TabRouterGetStateForRouteNamesChange(a0, {routeNames, routeParamList, routeKeyChanges}) { // fn#17047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:2004, owner: TabRouter.getStateForRouteNamesChange, offset: 0x00e6273e, size: 214 bytes, params: 3, frame: 21
|
|
const env0_0 = a0;
|
|
const value = routeNames.map(_fun17048);
|
|
const Math = global.Math;
|
|
const value3 = Math.max(0, routeNames.indexOf(a0.routes[a0.index].name));
|
|
const value4 = a0.history.filter(_fun17050);
|
|
const r7 = value4.length ? value4 : getRouteHistory(value, value3, routeParamList, initialRouteName);
|
|
const Object = global.Object;
|
|
return Object.assign({}, a0, {history: r7, routeNames: routeNames, routes: value, index: value3});
|
|
}
|
|
|
|
function TabRouterGetStateForRouteFocus(a0, a1) { // fn#17052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:2526, owner: TabRouter.getStateForRouteFocus, offset: 0x00e628fb, size: 91 bytes, params: 3, frame: 18
|
|
var environment;
|
|
var r0;
|
|
var value2;
|
|
let value = a0;
|
|
const env0_0 = a1;
|
|
const index = value.routes.findIndex(function({key}) {
|
|
return key === require;
|
|
});
|
|
if (index === -1) {
|
|
r0 = value;
|
|
} else if (index === value.index) {
|
|
r0 = value;
|
|
} else {
|
|
value2 = environment.__proto__;
|
|
value = changeIndex(value, index, env0_1, initialRouteName);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function TabRouterGetStateForAction(a0, a1, {routeParamList, routeGetIdList}) { // fn#17054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:2678, owner: TabRouter.getStateForAction, offset: 0x00e6296b, size: 438 bytes, params: 4, frame: 23
|
|
var environment;
|
|
var r2;
|
|
var r6;
|
|
var r0;
|
|
var value;
|
|
var history;
|
|
var length;
|
|
var key;
|
|
var Object;
|
|
var assign;
|
|
var object2;
|
|
var changeIndexBinding;
|
|
const env0_0 = a1;
|
|
const type = a1.type;
|
|
if (type === 'JUMP_TO') {
|
|
r6 = a1.type !== 'NAVIGATE' ? a0.routes.findIndex(function({name}) {
|
|
return name === require.payload.name;
|
|
}) : a1.payload.key ? a0.routes.findIndex(_fun17055) : a0.routes.findIndex(_fun17056);
|
|
value = null;
|
|
if (r6 === -1) {
|
|
r0 = value;
|
|
} else {
|
|
value = environment.__proto__;
|
|
changeIndexBinding = changeIndex;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
object2 = {};
|
|
object2.routes = a0.routes.map(_fun17057);
|
|
value = Reflect.apply(assign, Object, [{}, a0, object2]);
|
|
value = changeIndexBinding(value, r6, routeParamList, initialRouteName);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
if (type === 'NAVIGATE') {
|
|
r6 = a1.type !== 'NAVIGATE' ? a0.routes.findIndex(function({name}) {
|
|
return name === require.payload.name;
|
|
}) : a1.payload.key ? a0.routes.findIndex(_fun17055) : a0.routes.findIndex(_fun17056);
|
|
value = null;
|
|
if (r6 === -1) {
|
|
r0 = value;
|
|
} else {
|
|
value = environment.__proto__;
|
|
changeIndexBinding = changeIndex;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
object2 = {};
|
|
object2.routes = a0.routes.map(_fun17057);
|
|
value = Reflect.apply(assign, Object, [{}, a0, object2]);
|
|
value = changeIndexBinding(value, r6, routeParamList, initialRouteName);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
if (type === 'GO_BACK') {
|
|
history = a0.history;
|
|
length = history.length;
|
|
if (length === 1) {
|
|
return null;
|
|
}
|
|
history = a0.history;
|
|
length = a0.history.length;
|
|
key = history[length - 2].key;
|
|
value = a0.routes.findIndex(function({key}) {
|
|
return key === key;
|
|
});
|
|
if (value === -1) {
|
|
r2 = null;
|
|
} else {
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
object2 = {};
|
|
object2.history = a0.history.slice(0, -1);
|
|
object2.index = value;
|
|
value = Reflect.apply(assign, Object, [{}, a0, object2]);
|
|
r2 = value;
|
|
}
|
|
return r2;
|
|
}
|
|
value = environment.__proto__;
|
|
return (importDefault(1492) /* metro dependency 1492 */).getStateForAction(a0, a1);
|
|
}
|
|
|
|
function _fun17041(a0) { // fn#17041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:1058, offset: 0x00e6246e, size: 94 bytes, params: 2, frame: 16
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(1493) /* metro dependency 1493 */;
|
|
value = value.nanoid();
|
|
return {name: a0, key: '' + a0 + '-' + value, params: routeParamList[a0]};
|
|
}
|
|
|
|
function _fun17043(a0) { // fn#17043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:1385, offset: 0x00e6261b, size: 231 bytes, params: 2, frame: 21
|
|
const env0_0 = a0;
|
|
const value2 = env0_1.routes.find(_fun17044);
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
const r0 = value2 ? value2.name !== a0 ? '' + a0 + '-' + (require(1493) /* metro dependency 1493 */).nanoid() : value2.key || '' + a0 + '-' + (require(1493) /* metro dependency 1493 */).nanoid() : '' + a0 + '-' + (require(1493) /* metro dependency 1493 */).nanoid();
|
|
const routeParamListBinding = routeParamList;
|
|
const value6 = undefined;
|
|
return Reflect.apply(assign, Object, [{}, value2, {name: a0, key: r0,
|
|
params: value6 !== routeParamListBinding[a0] ? global.Object.assign({}, routeParamList[a0],
|
|
value2 ? value2.params : value6) : value2 ? value2.params : value6}]);
|
|
}
|
|
|
|
function _fun17045(a0) { // fn#17045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:1794, offset: 0x00e62702, size: 34 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
return env0_2.find(_fun17046);
|
|
}
|
|
|
|
function _fun17048(a0) { // fn#17048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:2113, offset: 0x00e62814, size: 132 bytes, params: 2, frame: 18
|
|
var environment;
|
|
var r0;
|
|
var object2;
|
|
var value3;
|
|
const value2 = a0.routes.find(_fun17049);
|
|
if (value2) {
|
|
r0 = value2;
|
|
} else {
|
|
object2 = {name: a0};
|
|
value3 = environment.__proto__.__proto__;
|
|
object2.key = '' + a0 + '-' + (require(1493) /* metro dependency 1493 */).nanoid();
|
|
object2.params = routeParamList[a0];
|
|
r0 = object2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun17050(a0) { // fn#17050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:2326, offset: 0x00e628c9, size: 50 bytes, params: 2, frame: 12
|
|
const env0_0 = a0;
|
|
return a0.type !== 'route' || env0_3.find(_fun17051);
|
|
}
|
|
|
|
function _fun17055({key}) { // fn#17055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:2876, offset: 0x00e62b21, size: 32 bytes, params: 2, frame: 2
|
|
return key === require.payload.key;
|
|
}
|
|
|
|
function _fun17056({name}) { // fn#17056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:2940, offset: 0x00e62b41, size: 32 bytes, params: 2, frame: 2
|
|
return name === require.payload.name;
|
|
}
|
|
|
|
function _fun17057(a0, a1) { // fn#17057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:3035, offset: 0x00e62b61, size: 537 bytes, params: 3, frame: 24
|
|
var path;
|
|
const value = a0;
|
|
if (a1 !== env0_3) {
|
|
return value;
|
|
}
|
|
const property = routeGetIdList[value.name];
|
|
const value3 = undefined;
|
|
const value6 = (property == null ? value3 : property({params: value.params})) === (property == null ? value3 : property({params: require.payload.params}));
|
|
const r7 = value6 ? value.key : '' + value.name + '-' + (require(1493) /* metro dependency 1493 */).nanoid();
|
|
const r2 = require.type !== 'NAVIGATE' ? value3 !== routeParamList[value.name] ? global.Object.assign({},
|
|
routeParamList[value.name],
|
|
require.payload.params) : require.payload.params : require.payload.merge && value6 ? value3 !== require.payload.params || value3 !== routeParamList[value.name] ? global.Object.assign({},
|
|
routeParamList[value.name], value.params,
|
|
require.payload.params) : value.params : value3 !== routeParamList[value.name] ? global.Object.assign({},
|
|
routeParamList[value.name], require.payload.params) : require.payload.params;
|
|
if (require.type !== 'NAVIGATE') {
|
|
path = value.path;
|
|
} else {
|
|
path = require.payload.path;
|
|
path = path != null ? require.payload.path : value.path;
|
|
}
|
|
return r2 !== value.params ? global.Object.assign({}, value, {key: r7, path: path,
|
|
params: r2}) : path === value.path ? value : global.Object.assign({}, value, {key: r7, path: path, params: r2});
|
|
}
|
|
|
|
function _fun17049(a0) { // fn#17049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1622:2147, offset: 0x00e62898, size: 49 bytes, params: 2, frame: 12
|
|
var r0;
|
|
var routeKeyChangesBinding;
|
|
const name = a0.name;
|
|
let value = name === env0_0;
|
|
if (value) {
|
|
value = environment.__proto__;
|
|
routeKeyChangesBinding = routeKeyChanges;
|
|
value = !routeKeyChangesBinding.includes(a0.name);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|