129 lines
6.8 KiB
TypeScript
129 lines
6.8 KiB
TypeScript
/* Metro module 13509; source: modules/quests/native/QuestHomeSetting.tsx; dependencies: [57, 31, 9481, 6528, 33, 4501, 697, 1484, 3769, 7508, 13510, 13514, 2] */
|
|
function _fun102590(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13699:6, offset: 0x02241890, size: 297 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const parseSortMethod = function(a0) {
|
|
var value = a0;
|
|
return value == null ? QuestHomeSortMethods.SUGGESTED : global.Object.values(QuestHomeSortMethods).includes(value) ? value : QuestHomeSortMethods.SUGGESTED;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const questHomeNavigationStore = importDefault(9481) /* metro dependency 9481: QuestHomeNavigationStore */;
|
|
let value = require(6528) /* metro dependency 6528: QuestConstants */;
|
|
const env0_6 = value.QuestHomeSortMethods;
|
|
const env0_7 = value.getQuestHomeFilterOptionItem;
|
|
const env0_8 = (require(33) /* metro dependency 33 */).jsx;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
const env0_9 = Reflect.apply(createStyles, value, [{container: {backgroundColor: BACKGROUND_BASE_LOWEST}}]);
|
|
const env0_10 = [];
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/native/QuestHomeSetting.tsx');
|
|
exports.default = QuestHomeSetting;
|
|
}
|
|
|
|
function parseFilters(a0) { // fn#102592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13699:392, offset: 0x022419f7, size: 88 bytes, params: 2, frame: 12
|
|
if (a0 == null) {
|
|
return env0_10;
|
|
}
|
|
let value = a0.split(',');
|
|
value = value.map(function(a0) {
|
|
return getQuestHomeFilterOptionItem(a0);
|
|
});
|
|
value = value.filter(function(a0) {
|
|
return a0 != null;
|
|
});
|
|
return value.length > 0 ? value : env0_10;
|
|
}
|
|
|
|
function QuestHomeSetting() { // fn#102595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13699:520, offset: 0x02241a4f, size: 380 bytes, params: 1, frame: 26
|
|
const styles = useStyles();
|
|
const binding = env0_4;
|
|
let useState = binding.useState;
|
|
const value2 = Reflect.apply(useState, binding, [_fun102596]);
|
|
const binding2 = env0_3;
|
|
const value3 = binding2(value2, 2);
|
|
const property = value3[0];
|
|
const property2 = value3[1];
|
|
useState = binding.useState;
|
|
const value4 = binding2(Reflect.apply(useState, binding, [_fun102597]), 2);
|
|
const property3 = value4[0];
|
|
const property4 = value4[1];
|
|
binding.useEffect(function() {
|
|
var object = {};
|
|
object.equalityFn = require(dependencyMap[8]).shallow;
|
|
object.fireImmediately = true;
|
|
return QuestHomeNavigationStore.subscribe(_fun102599, _fun102600, object);
|
|
}, []);
|
|
const value5 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
useState = binding.useState;
|
|
const value6 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property5 = value6[0];
|
|
var env0_3 = value6[1];
|
|
binding.useEffect(_fun102601, [value5]);
|
|
const value7 = binding.useCallback(_fun102603, []);
|
|
binding.useEffect(function() {
|
|
return _fun102605;
|
|
}, []);
|
|
const value8 = QuestHomeNavigationStore.useField('scrollToQuestId');
|
|
(importDefault(13510) /* metro dependency 13510: useQuestHomeHeader */)({setSelectedSortMethod: property2,
|
|
setSelectedFilters: property4, selectedFilters: property3, selectedSortMethod: property});
|
|
return ((Component) => <Component containerStyle={styles.container} isNavigationComplete={property5} scrollToQuestId={value8} sortMethod={property} filters={property3} onClearFilters={value7} />)(importDefault(13514) /* metro dependency 13514: QuestHome */);
|
|
}
|
|
|
|
function _fun102596() { // fn#102596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13699:572, offset: 0x02241bcb, size: 35 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
return parseSortMethod(QuestHomeNavigationStore.getField('sort'));
|
|
}
|
|
|
|
function _fun102597() { // fn#102597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13699:651, offset: 0x02241bee, size: 35 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
return parseFilters(QuestHomeNavigationStore.getField('filter'));
|
|
}
|
|
|
|
function _fun102598() { // fn#102598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13699:728, offset: 0x02241c11, size: 80 bytes, params: 1, frame: 17
|
|
const subscribe = QuestHomeNavigationStore.subscribe;
|
|
const object2 = {};
|
|
object2.equalityFn = (require(3769) /* metro dependency 3769 */).shallow;
|
|
object2.fireImmediately = true;
|
|
return Reflect.apply(subscribe, QuestHomeNavigationStore, [function({sort, filter}) {
|
|
return {sort: sort, filter: filter};
|
|
}, _fun102600, object2]);
|
|
}
|
|
|
|
function _fun102601() { // fn#102601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13699:1039, offset: 0x02241ce3, size: 34 bytes, params: 1, frame: 13
|
|
return env0_2.addListener('transitionEnd', _fun102602);
|
|
}
|
|
|
|
function _fun102603() { // fn#102603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13699:1112, offset: 0x02241d05, size: 23 bytes, params: 1, frame: 11
|
|
env0_1(env1_10);
|
|
}
|
|
|
|
function _fun102604() { // fn#102604, offset: 0x02241d1c, size: 11 bytes, params: 1, frame: 1
|
|
return function() {
|
|
importDefault(dependencyMap[9]).close();
|
|
QuestHomeNavigationStore.resetState();
|
|
};
|
|
}
|
|
|
|
function _fun102600(a0, {sort, filter}) { // fn#102600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13699:788, offset: 0x02241c7c, size: 103 bytes, params: 3, frame: 14
|
|
var value;
|
|
var binding;
|
|
const sort = a0.sort;
|
|
if (sort !== sort) {
|
|
value = environment.__proto__;
|
|
binding = env1_0;
|
|
value = environment.__proto__.__proto__;
|
|
binding(parseSortMethod(a0.sort));
|
|
}
|
|
const filter = a0.filter;
|
|
if (filter !== filter) {
|
|
value = environment.__proto__;
|
|
binding = env1_1;
|
|
value = environment.__proto__.__proto__;
|
|
binding(parseFilters(a0.filter));
|
|
}
|
|
}
|
|
|