308 lines
17 KiB
TypeScript
308 lines
17 KiB
TypeScript
/* Metro module 13122; source: modules/devtools/native/components/DevToolsContent.tsx; dependencies: [57, 31, 27, 10557, 4107, 1220, 33, 4501, 697, 566, 10558, 13123, 4573, 5278, 4081, 14278, 14280, 1484, 1585, 6231, 6238, 3857, 13121, 2] */
|
|
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ApexExperimentStore from '../../../experiments/apex/ApexExperimentStore.tsx'; /* Metro dependency 1220 */
|
|
import UseSafeAreaInsetsNative from '../../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
|
|
import ExperimentStore from '../../../experiments/ExperimentStore.tsx'; /* Metro dependency 4107 */
|
|
import BuildOverrideStore from '../../../build_overrides/BuildOverrideStore.tsx'; /* Metro dependency 10557 */
|
|
import UseSortedDevToolsScreens from '../useSortedDevToolsScreens.tsx'; /* Metro dependency 13123 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as FluxModule from '../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as UseNavigationNativeModule from '../../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
|
|
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as PressablesModule from '../../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
|
|
import * as TableRowGroupNativeModule from '../../../../design/components/TableRow/native/TableRowGroup.native.tsx'; /* Metro dependency 6231 */
|
|
import * as TableRowNativeModule from '../../../../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */
|
|
import * as ArrowSmallUpIconModule from '../../../../design/components/Icon/native/redesign/generated/ArrowSmallUpIcon.tsx'; /* Metro dependency 14278 */
|
|
import * as ArrowSmallDownIconModule from '../../../../design/components/Icon/native/redesign/generated/ArrowSmallDownIcon.tsx'; /* Metro dependency 14280 */
|
|
|
|
function _fun100275(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13312:6, offset: 0x021e2f4d, size: 552 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {};
|
|
const object2 = {};
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object2.backgroundColor = BACKGROUND_BASE_LOW;
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.padding = PX_16;
|
|
object.devToolsContainer = object2;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.sortingIcons = {flexDirection: 'row', gap: PX_8};
|
|
const object4 = {};
|
|
const CONTROL_SECONDARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_SECONDARY_BACKGROUND_DEFAULT;
|
|
object4.backgroundColor = CONTROL_SECONDARY_BACKGROUND_DEFAULT;
|
|
let PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
|
|
object4.width = PX_32;
|
|
PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
|
|
object4.height = PX_32;
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
object4.justifyContent = 'center';
|
|
object4.alignItems = 'center';
|
|
object.button = object4;
|
|
object.disabledButton = {opacity: 0.5};
|
|
const env0_12 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
const value5 = value.memo(_fun100279);
|
|
value = value.memo(DevToolsContent);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/devtools/native/components/DevToolsContent.tsx');
|
|
exports.default = value;
|
|
exports.DevToolsContentSubLabel = value5;
|
|
function DevToolsContentSortButtons({screenKey, start, end}) { // fn#100276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13312:811, offset: 0x021e3175, size: 355 bytes, params: 2, frame: 27
|
|
const styles = useStyles();
|
|
const PressableOpacity = (PressablesModule).PressableOpacity;
|
|
const pressableOpacityProps = {onPress: onPress_100277, disabled: start, style: [styles.button,
|
|
start && styles.disabledButton], accessibilityRole: 'button', accessibilityLabel: 'Shift up'};
|
|
const ArrowSmallUpIcon = (ArrowSmallUpIconModule).ArrowSmallUpIcon;
|
|
const pressableOpacity = (
|
|
<PressableOpacity {...pressableOpacityProps}>
|
|
<ArrowSmallUpIcon />
|
|
</PressableOpacity>
|
|
);
|
|
const pressableOpacityProps2 = {onPress: onPress_100278, disabled: end, style: [styles.button,
|
|
end && styles.disabledButton], accessibilityRole: 'button', accessibilityLabel: 'Shift down'};
|
|
const ArrowSmallDownIcon = (ArrowSmallDownIconModule).ArrowSmallDownIcon;
|
|
return (
|
|
<View style={styles.sortingIcons}>
|
|
{pressableOpacity}
|
|
<PressableOpacity {...pressableOpacityProps2}>
|
|
<ArrowSmallDownIcon />
|
|
</PressableOpacity>
|
|
</View>
|
|
);
|
|
function DevToolsContentSortButtonsOnPress() { // fn#100277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13312:966, owner: DevToolsContentSortButtons.onPress, offset: 0x021e32d8, size: 94 bytes, params: 1, frame: 15
|
|
let value = environment.__proto__;
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
const triggerHapticFeedback = value.triggerHapticFeedback;
|
|
const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes;
|
|
const IMPACT_MEDIUM = HapticFeedbackTypes.IMPACT_MEDIUM;
|
|
Reflect.apply(triggerHapticFeedback, value, [IMPACT_MEDIUM]);
|
|
value = require(13123) /* metro dependency 13123: useSortedDevToolsScreens */;
|
|
value.updateSortOrder(screenKey, 'up');
|
|
}
|
|
|
|
function DevToolsContentSortButtonsOnPress_100278() { // fn#100278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13312:1265, owner: DevToolsContentSortButtons.onPress, offset: 0x021e3336, size: 94 bytes, params: 1, frame: 15
|
|
let value = environment.__proto__;
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
const triggerHapticFeedback = value.triggerHapticFeedback;
|
|
const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes;
|
|
const IMPACT_MEDIUM = HapticFeedbackTypes.IMPACT_MEDIUM;
|
|
Reflect.apply(triggerHapticFeedback, value, [IMPACT_MEDIUM]);
|
|
value = require(13123) /* metro dependency 13123: useSortedDevToolsScreens */;
|
|
value.updateSortOrder(screenKey, 'down');
|
|
}
|
|
|
|
}
|
|
|
|
function _fun100279({label, value}) { // fn#100279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13312:639, offset: 0x021e3394, size: 121 bytes, params: 2, frame: 20
|
|
const Text = (TextModule).Text;
|
|
const Text2 = (TextModule).Text;
|
|
return (
|
|
<Text variant="text-xs/medium" color="text-subtle">
|
|
{label}
|
|
<Text2 variant="text-xs/semibold">
|
|
{value}
|
|
</Text2>
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
function DevToolsContent({title, embedded}) { // fn#100280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13312:1550, offset: 0x021e340d, size: 319 bytes, params: 2, frame: 22
|
|
var r0;
|
|
var object2;
|
|
const styles = useStyles();
|
|
const env0_0 = (UseNavigationNativeModule).useNavigation();
|
|
const value2 = (UseSafeAreaInsetsNative)();
|
|
const env0_1 = useDevToolsContentSublabels();
|
|
const [env0_2, env0_3] = env0_3Binding(env0_4.useState(false), 2);
|
|
const value5 = (UseSortedDevToolsScreens)();
|
|
const TableRowGroup = (TableRowGroupNativeModule).TableRowGroup;
|
|
const tableRowGroup = (
|
|
<TableRowGroup title={title} hasIcons>
|
|
{value5.map(_fun100286)}
|
|
</TableRowGroup>
|
|
);
|
|
if (embedded) {
|
|
r0 = tableRowGroup;
|
|
} else {
|
|
var scrollViewBindingProps = {style: styles.devToolsContainer};
|
|
object2 = {};
|
|
object2.paddingBottom = value2.bottom + (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
scrollViewBindingProps.contentContainerStyle = object2;
|
|
r0 = (
|
|
<ScrollView {...scrollViewBindingProps}>
|
|
{tableRowGroup}
|
|
</ScrollView>
|
|
);
|
|
}
|
|
return r0;
|
|
function useDevToolsContentSublabels() { // fn#100281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13312:1649, owner: DevToolsContent.useDevToolsContentSublabels, offset: 0x021e354c, size: 186 bytes, params: 1, frame: 19
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
let useStateFromStores = FluxModule.useStateFromStores;
|
|
const env0_0 = Reflect.apply(useStateFromStores, FluxModule, [[BuildOverrideStore], function() {
|
|
var r0;
|
|
var property = BuildOverrideStore.getCurrentBuildOverride().overrides;
|
|
var value2 = undefined;
|
|
if (property == null) {
|
|
r0 = value2;
|
|
} else {
|
|
property = property[require(dependencyMap[10]).DEVICE_FIELD];
|
|
r0 = property == null ? value2 : property.id;
|
|
}
|
|
return r0;
|
|
}]);
|
|
const length = FluxModule.useStateFromStores([ExperimentStore], function() {
|
|
var Object = global.Object;
|
|
return Object.keys(ExperimentStore.getAllExperimentOverrideDescriptors()).length;
|
|
});
|
|
useStateFromStores = FluxModule.useStateFromStores;
|
|
const env0_1 = length + Reflect.apply(useStateFromStores, FluxModule, [[ApexExperimentStore], function() {
|
|
var Object = global.Object;
|
|
return Object.keys(ApexExperimentStore.getClientOverrides()).length;
|
|
}]);
|
|
return (UseSortedDevToolsScreens)().map(_fun100285);
|
|
function _fun100285(a0) { // fn#100285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13312:2047, offset: 0x021e36ac, size: 174 bytes, params: 2, frame: 16
|
|
const iterator = a0[Symbol.iterator]();
|
|
let item2 = iterator.next();
|
|
const item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
const value = undefined;
|
|
const value2 = item2 === value;
|
|
const r1 = value2 ? value : item;
|
|
if (!value2) {
|
|
item2.return();
|
|
}
|
|
if (r1 === 'buildOverride') {
|
|
return (
|
|
env0_0 != null
|
|
? ((Component) => <Component label="Build override: " value={env0_0} />)(env2_13)
|
|
: value
|
|
);
|
|
}
|
|
if (r1 === 'experiments') {
|
|
return (
|
|
env0_1 > 0
|
|
? ((Component) => <Component label="Experiments overridden: " value={env0_1.toString()} />)(env2_13)
|
|
: value
|
|
);
|
|
}
|
|
return value;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun100286(a0, a1) { // fn#100286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13312:2381, offset: 0x021e375a, size: 319 bytes, params: 3, frame: 28
|
|
var r1;
|
|
var r2;
|
|
var r42;
|
|
var item3;
|
|
var value3;
|
|
var headerTitle;
|
|
var Icon;
|
|
var error;
|
|
const iterator = a0[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
const value = undefined;
|
|
let item2 = Reflect.apply(iterator2, iterator, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
const value2 = item2 === value;
|
|
const r4 = value2 ? value : item;
|
|
if (value2) {
|
|
r1 = item2;
|
|
r2 = value2;
|
|
r42 = value;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value3 = item3 === value;
|
|
if (value3) {
|
|
r1 = item3;
|
|
r2 = value3;
|
|
r42 = value;
|
|
} else {
|
|
r1 = item3;
|
|
r2 = value3;
|
|
r42 = item;
|
|
}
|
|
}
|
|
try {
|
|
headerTitle = r42.headerTitle;
|
|
Icon = r42.Icon;
|
|
} catch (error) {
|
|
if (!r2) {
|
|
try {
|
|
r1.return();
|
|
} catch {
|
|
}
|
|
}
|
|
throw error;
|
|
}
|
|
if (!r2) {
|
|
r1.return();
|
|
}
|
|
const TableRow = (TableRowNativeModule).TableRow;
|
|
const tableRowProps = {label: headerTitle, subLabel: env0_1[a1]};
|
|
const TableRow2 = (TableRowNativeModule).TableRow;
|
|
const Icon2 = TableRow2.Icon;
|
|
tableRowProps.icon = <Icon2 IconComponent={Icon} />;
|
|
const binding = env0_2;
|
|
tableRowProps.arrow = !binding;
|
|
tableRowProps.trailing = (
|
|
binding
|
|
? (
|
|
<DevToolsContentSortButtons
|
|
screenKey={r4}
|
|
start={a1 === 0}
|
|
end={a1 === env0_4.length - 1}
|
|
/>
|
|
)
|
|
: value
|
|
);
|
|
tableRowProps.onLongPress = onLongPress_100287;
|
|
tableRowProps.onPress = onPress_100289;
|
|
return <TableRow {...tableRowProps} key={r4} />;
|
|
function onLongPress_100287() { // fn#100287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13312:2619, offset: 0x021e3899, size: 159 bytes, params: 1, frame: 16
|
|
var environment;
|
|
let value = environment.__proto__.__proto__;
|
|
(importDefault(3857) /* metro dependency 3857: ToastActionCreators */).open({key: env1_2 ? 'sorting-disabled' : 'sorting-enabled',
|
|
content: env1_2 ? 'Sorting disabled' : 'Sorting enabled'});
|
|
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
|
|
const triggerHapticFeedback = value.triggerHapticFeedback;
|
|
const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes;
|
|
const IMPACT_MEDIUM = HapticFeedbackTypes.IMPACT_MEDIUM;
|
|
Reflect.apply(triggerHapticFeedback, value, [IMPACT_MEDIUM]);
|
|
env1_3(function(a0) {
|
|
return !a0;
|
|
});
|
|
}
|
|
|
|
function onPress_100289() { // fn#100289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13312:2826, offset: 0x021e3938, size: 102 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__;
|
|
if (!env1_2) {
|
|
if (env1_0.push != null) {
|
|
env1_0.push(env0_0);
|
|
} else {
|
|
value = environment.__proto__.__proto__;
|
|
value = require(13121) /* metro dependency 13121: DevToolsNavigator */;
|
|
value.navigateToDevTools({screenKey: env0_0});
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun100275, 13122, [57, 31, 27, 10557, 4107, 1220, 33, 4501, 697, 566, 10558, 13123, 4573, 5278, 4081,
|
|
14278, 14280, 1484, 1585, 6231, 6238, 3857, 13121,
|
|
2]) /* metro module 13122, dependencies: [57, 31, 27, 10557, 4107, 1220, 33, 4501, 697, 566, 10558, 13123, 4573, 5278, 4081, 14278, 14280, 1484, 1585, 6231, 6238, 3857, 13121, 2] */;
|