Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,358 @@
/* Metro module 11734; source: modules/polls/native/PollCreation.tsx; dependencies: [31, 27, 7217, 33, 4501, 697, 477, 4500, 1244, 7981, 1305, 10376, 4573, 11735, 4080, 11736, 1962, 6238, 4015, 8742, 480, 5463, 11733, 3857, 11098, 3869, 11737, 11742, 5286, 7149, 4497, 11743, 5277, 5313, 11744, 7972, 11746, 8950, 2] */
function _fun89916(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89916, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:6, offset: 0x02023666, size: 668 bytes, params: 8, frame: 26
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_4 = value2.TouchableOpacity;
const env0_5 = value2.View;
const env0_6 = value2.ScrollView;
const pollsConstantsModule = require(7217) /* metro dependency 7217: PollsConstants */;
const env0_7 = pollsConstantsModule.MAX_POLL_QUESTION_LENGTH;
const env0_8 = pollsConstantsModule.POLL_CREATION_DURATION_ACTION_SHEET_KEY;
const value4 = require(33) /* metro dependency 33 */;
const env0_9 = value4.jsx;
const env0_10 = value4.Fragment;
const env0_11 = value4.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
object2.viewPadding = {paddingHorizontal: 18};
object2.scrollContainer = {'paddingVertical': 20, 'gap': 16};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.safeAreaContainer = {backgroundColor: BACKGROUND_BASE_LOW, flex: 1};
const value6 = 10;
object2.header = {'flexDirection': 'row', 'paddingHorizontal': 18, 'paddingVertical': 10};
object2.actionButton = {'flex': 0, 'justifyContent': 'flex-start', 'minWidth': 48, 'paddingHorizontal': 0,
'marginHorizontal': 0};
object2.postButton = {justifyContent: 'flex-end'};
object2.title = {'textAlign': 'center', 'flexGrow': 1};
object2.label = {fontSize: 14};
object2.answerInputsContainer = {'marginVertical': 20, 'rowGap': 16};
const object3 = {'paddingVertical': null, 'paddingLeft': 14, 'marginRight': 30, 'display': 'flex',
'flexDirection': 'row', 'gap': 16, 'alignItems': 'center', 'justifyContent': 'flex-start'};
object3.paddingVertical = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? value6 : 8;
const MESSAGE_BACKGROUND_HOVER = (importDefault(697) /* metro dependency 697: native */).colors.MESSAGE_BACKGROUND_HOVER;
object3.backgroundColor = MESSAGE_BACKGROUND_HOVER;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.addAnswerButtonDefault = object3;
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object2.addAnswerIcon = {color: TEXT_MUTED};
const INTERACTIVE_BACKGROUND_HOVER = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_BACKGROUND_HOVER;
object2.pollConfigSection = {borderTopWidth: 1, borderColor: INTERACTIVE_BACKGROUND_HOVER};
const env0_12 = Reflect.apply(createStyles, createStylesModule, [object2]);
const env0_13 = value.forwardRef(_fun89921);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/polls/native/PollCreation.tsx');
exports.default = PollCreation;
}
function UnsavedChangesAlertModal({onConfirm}) { // fn#89917, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:1199, offset: 0x02023902, size: 370 bytes, params: 2, frame: 29
const AlertModal = (require(4500) /* metro dependency 4500: AlertModalNative */).AlertModal;
const object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const HMrgcp = (require(1244) /* metro dependency 1244: indexNative */).t.HMrgcp;
object2.title = Reflect.apply(string, intl, [HMrgcp]);
object2.content = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Wxa/j8']);
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
const AlertActionButton = (require(4500) /* metro dependency 4500: AlertModalNative */).AlertActionButton;
string = intl.string;
const TzJA4g = (require(1244) /* metro dependency 1244: indexNative */).t.TzJA4g;
object2.actions = <><AlertActionButton text={Reflect.apply(string, intl,
[TzJA4g])} onPress={onConfirm} key="confirm" /><AlertActionButton variant="secondary" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['2BR5R2'])} key="back" /></>;
return <AlertModal {...object2} />;
}
function AddAnswerButton({onPress}) { // fn#89918, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:2194, offset: 0x02023a74, size: 319 bytes, params: 2, frame: 22
const styles = useStyles();
const addAnswerButtonDefault = styles.addAnswerButtonDefault;
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
let object2 = {};
object2.source = importDefault(10376) /* metro dependency 10376 */;
const Icon2 = (require(1305) /* metro dependency 1305: native */).Icon;
const Sizes = Icon2.Sizes;
const LARGE = Sizes.LARGE;
object2.size = LARGE;
object2.color = styles.addAnswerIcon.color;
const icon = <Icon {...object2} />;
object2 = {onPress: onPress, style: addAnswerButtonDefault, accessibilityRole: 'button'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
let B2Uvme = (require(1244) /* metro dependency 1244: indexNative */).t.B2Uvme;
object2.accessibilityLabel = Reflect.apply(string, intl, [B2Uvme]);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
string = intl.string;
B2Uvme = (require(1244) /* metro dependency 1244: indexNative */).t.B2Uvme;
return (
<TouchableOpacity {...object2}>
{icon}
<Text variant="text-md/medium" color="text-muted">
{Reflect.apply(string, intl, [B2Uvme])}
</Text>
</TouchableOpacity>
);
}
function PollDurationSelectionRow({selectedDuration, onChange}) { // fn#89919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:2604, offset: 0x02023bb3, size: 342 bytes, params: 2, frame: 24
const property = (importDefault(11735) /* metro dependency 11735: usePollDurationOptions */)()[selectedDuration];
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
const object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
object2.label = Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.bGHzxb]);
object2.accessibilityLabel = '' + intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bGHzxb) + ' ' + property;
string = intl.string;
const A4PJ1o = (require(1244) /* metro dependency 1244: indexNative */).t.A4PJ1o;
object2.accessibilityHint = Reflect.apply(string, intl, [A4PJ1o]);
object2.onPress = function() {
require(dependencyMap[18]).dismissKeyboard();
importDefault(dependencyMap[14]).openLazy(require(dependencyMap[16])(dependencyMap[15], dependencyMap.paths),
POLL_CREATION_DURATION_ACTION_SHEET_KEY, {selectedDuration: selectedDuration, onChange: onChange});
};
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
object2.trailing = <Text variant="text-md/normal" color="text-muted">{property}</Text>;
object2.arrow = true;
return <TableRow {...object2} />;
}
function _fun89921({onChange, onSubmitEditing, error}, a1) { // fn#89921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:1616, offset: 0x02023d84, size: 410 bytes, params: 3, frame: 25
const r9 = error != null && error.length > 0;
const TextInput = (require(7981) /* metro dependency 7981: TextInputNative */).TextInput;
const object2 = {ref: a1, textAlignVertical: 'center'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
let WBiKnI = (require(1244) /* metro dependency 1244: indexNative */).t.WBiKnI;
object2.label = Reflect.apply(string, intl, [WBiKnI]);
string = intl.string;
WBiKnI = (require(1244) /* metro dependency 1244: indexNative */).t.WBiKnI;
object2.accessibilityLabel = Reflect.apply(string, intl, [WBiKnI]);
object2.accessibilityHint = r9 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.jnq5Ho,
{errorMessage: error}) : undefined;
object2.placeholder = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/uQqJW']);
object2.onChange = onChange;
object2.isClearable = true;
object2.status = r9 ? 'error' : 'default';
object2.errorMessage = error;
object2.maxLength = MAX_POLL_QUESTION_LENGTH;
object2.returnKeyType = 'next';
object2.blurOnSubmit = false;
object2.onSubmitEditing = onSubmitEditing;
object2.textContentType = 'none';
object2.autoFocus = true;
object2.autoCorrect = true;
return <TextInput {...object2} />;
}
function PollCreation({channel, onCancel}) { // fn#89922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3104, offset: 0x02023f1e, size: 1620 bytes, params: 2, frame: 44
const defaultImport = importDefault(8742) /* metro dependency 8742: useTrackImpression */;
const object2 = {};
const ImpressionTypes = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionTypes;
const VIEW = ImpressionTypes.VIEW;
object2.type = VIEW;
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
const POLL_EDITOR_VIEWED = ImpressionNames.POLL_EDITOR_VIEWED;
object2.name = POLL_EDITOR_VIEWED;
defaultImport(object2);
const binding = env0_3;
binding.useEffect(function() {
return _fun89924;
}, [onCancel]);
const styles = useStyles();
const insets = (importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)({includeKeyboardHeight: true}).insets;
const env0_2 = binding.useRef(false);
const value5 = (importDefault(11737) /* metro dependency 11737: useCreatePollFormData */)(channel,
binding.useCallback(_fun89925, []), binding.useCallback(function({indexToRemove}) {
var AccessibilityAnnouncer = require(dependencyMap[25]).AccessibilityAnnouncer;
var intl = require(dependencyMap[8]).intl;
var BByGU4 = require(dependencyMap[8]).t.BByGU4;
AccessibilityAnnouncer.announce(intl.formatToPlainString(BByGU4, {number: indexToRemove + 1}));
}, []));
const answers = value5.answers;
const env0_4 = value5.question;
const allowMultiSelect = value5.allowMultiSelect;
const env0_6 = value5.setAllowMultiSelect;
const canAddMoreAnswers = value5.canAddMoreAnswers;
const env0_7 = value5.canRemoveMoreAnswers;
const handleQuestionChange = value5.handleQuestionChange;
const env0_8 = value5.handleAnswerTextChange;
const env0_9 = value5.handleEmojiSelect;
const handleAddAnswer = value5.handleAddAnswer;
const env0_11 = value5.handleRemoveAnswer;
const env0_12 = value5.handleRemoveAnswerImage;
const handleSubmitPoll = value5.handleSubmitPoll;
const fieldErrors = value5.fieldErrors;
const env0_13 = fieldErrors;
const duration = value5.duration;
const setDuration = value5.setDuration;
const createPollError = value5.createPollError;
const submitting = value5.submitting;
const shouldFocusOnInvalidField = value5.shouldFocusOnInvalidField;
const setShouldFocusOnInvalidField = value5.setShouldFocusOnInvalidField;
const useTrackPollEventsModule = require(11742) /* metro dependency 11742: useTrackPollEvents */;
const useTrackPollCreationEvents = useTrackPollEventsModule.useTrackPollCreationEvents;
const env0_16 = Reflect.apply(useTrackPollCreationEvents, useTrackPollEventsModule, [answers,
allowMultiSelect]).trackPollCreationCancelled;
(require(5286) /* metro dependency 5286: useNavigatorBackPressHandlerNative */).useNavigatorBackPressHandler(_fun89928);
const value6 = (importDefault(11743) /* metro dependency 11743: useFocusHelper */)({onAddAnswer: function() {
handleAddAnswer();
}});
binding.useEffect(_fun89930, [fieldErrors, value6, setShouldFocusOnInvalidField, shouldFocusOnInvalidField]);
const items3 = [styles.safeAreaContainer];
items3[1] = {paddingTop: insets.top, paddingBottom: insets.bottom};
const jsxRuntimeEnv0_10Binding = jsxRuntimeEnv0_10;
const HeaderActionButton = (require(5277) /* metro dependency 5277: HeaderActionButtonNative */).HeaderActionButton;
let intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const items2 = [<HeaderActionButton accessibilityLabel={Reflect.apply(string, intl,
[(require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC']])} onPress={onPress_89931} source={importDefault(5313) /* metro dependency 5313 */} style={styles.actionButton} />];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
string = intl.string;
const Flr51u = (require(1244) /* metro dependency 1244: indexNative */).t.Flr51u;
items2[1] = <Text accessibilityRole="header" variant="redesign/heading-18/bold" color="mobile-text-heading-primary" style={styles.title}>{Reflect.apply(string,
intl, [Flr51u])}</Text>;
string = intl.string;
const JOj8Zk = (require(1244) /* metro dependency 1244: indexNative */).t.JOj8Zk;
items2[2] = <HeaderActionButton text={Reflect.apply(string, intl, [JOj8Zk])} style={[styles.actionButton,
styles.postButton]} disabled={submitting} onPress={handleSubmitPoll} />;
const items4 = [<View style={styles.header}>{items2}</View>];
const items5 = [createPollError != null && ((Component) => <Component>{createPollError?.getAnyErrorMessage()}</Component>)(importDefault(11744) /* metro dependency 11744: ErrorBlock */)];
items5[1] = ((Component) => <Component ref={value6.refWithKey('question')} onChange={handleQuestionChange} onSubmitEditing={value6.focusNext} error={fieldErrors?.question} />)(env0_13);
const FormLabel = (require(7972) /* metro dependency 7972: native */).FormLabel;
const items6 = [<FormLabel text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.oMBfeS)} color="text-subtle" style={styles.label} />];
items6[1] = answers.map(_fun89932);
items6[2] = canAddMoreAnswers && <AddAnswerButton onPress={handleAddAnswer} />;
items5[2] = <View style={styles.answerInputsContainer}>{items6}</View>;
items4[1] = <ScrollView style={styles.viewPadding} contentContainerStyle={styles.scrollContainer} keyboardShouldPersistTaps="handled">{items5}</ScrollView>;
const pollDurationSelectionRow = <PollDurationSelectionRow selectedDuration={duration} onChange={setDuration} />;
const TableCheckboxRow = (require(8950) /* metro dependency 8950: TableCheckboxRowNative */).TableCheckboxRow;
items4[2] = <View style={styles.pollConfigSection}>{pollDurationSelectionRow}<TableCheckboxRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Ux+iQU'])} checked={allowMultiSelect} onPress={function() {
return setAllowMultiSelect(!allowMultiSelect);
}} /></View>;
return (
<View style={items3}>
<>
{items4}
</>
</View>
);
}
function _fun89923() { // fn#89923, offset: 0x02024572, size: 11 bytes, params: 1, frame: 1
return _fun89924;
}
function _fun89925() { // fn#89925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3387, offset: 0x020245a7, size: 166 bytes, params: 1, frame: 17
env0_2.current = true;
let value = environment.__proto__;
(require(11733) /* metro dependency 11733: PollCreationModalActionCreators */).closeCreatePollModal();
value = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
const open = value.open;
const object2 = {key: 'POLL_CREATED_SUCCESS'};
const PollsIcon = (require(11098) /* metro dependency 11098: PollsIcon */).PollsIcon;
object2.IconComponent = PollsIcon;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const OPsckI = (require(1244) /* metro dependency 1244: indexNative */).t.OPsckI;
object2.content = Reflect.apply(string, intl, [OPsckI]);
Reflect.apply(open, value, [object2]);
}
function handleCancelClose() { // fn#89927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4249, owner: PollCreation.handleCancelClose, offset: 0x020246c2, size: 124 bytes, params: 1, frame: 16
trackPollCreationCancelled();
const value = environment.__proto__;
(require(11733) /* metro dependency 11733: PollCreationModalActionCreators */).closeCreatePollModal();
const AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
const announce = AccessibilityAnnouncer.announce;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
Reflect.apply(announce, AccessibilityAnnouncer,
[intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+G3oRq'])]);
}
function _fun89928() { // fn#89928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4413, offset: 0x0202473e, size: 214 bytes, params: 1, frame: 18
var r0;
var moduleValue2;
var openAlert;
var AccessibilityAnnouncer;
var announce;
var intl;
let value = environment.__proto__;
const pollsUtilsModule = require(7149) /* metro dependency 7149: PollsUtils */;
if (pollsUtilsModule.isPollCreationEmpty(question, answers)) {
trackPollCreationCancelled();
AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
announce = AccessibilityAnnouncer.announce;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
Reflect.apply(announce, AccessibilityAnnouncer,
[intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+G3oRq'])]);
r0 = false;
} else {
moduleValue2 = require(4497) /* metro dependency 4497: useAlertStoreNative */;
openAlert = moduleValue2.openAlert;
value = <UnsavedChangesAlertModal onConfirm={handleCancelClose} />;
Reflect.apply(openAlert, moduleValue2, ['poll-creation-unsaved-changes', value]);
value = true;
r0 = value;
}
return r0;
}
function _fun89930() { // fn#89930, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:4720, offset: 0x02024814, size: 186 bytes, params: 1, frame: 20
var value3;
var intl;
const Object = global.Object;
const value2 = Object.keys(fieldErrors);
if (value2.length > 0) {
value3 = environment.__proto__;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
(require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer.announce(intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.w8e4qF,
{numOfErrors: value2.length}));
if (shouldFocusOnInvalidField) {
env0_18.focus(value2[0]);
setShouldFocusOnInvalidField(false);
}
}
}
function PollCreationOnPress() { // fn#89931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:5162, owner: PollCreation.onPress, offset: 0x020248ce, size: 126 bytes, params: 1, frame: 17
const value = environment.__proto__;
const pollsUtilsModule = require(7149) /* metro dependency 7149: PollsUtils */;
if (pollsUtilsModule.isPollCreationEmpty(question, answers)) {
handleCancelClose();
} else {
(require(4497) /* metro dependency 4497: useAlertStoreNative */).openAlert('poll-creation-unsaved-changes',
<UnsavedChangesAlertModal onConfirm={handleCancelClose} />);
}
}
function _fun89932(a0, a1) { // fn#89932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:6126, offset: 0x0202494c, size: 232 bytes, params: 3, frame: 22
let value = environment.__proto__;
value = undefined;
const PollAnswerInput = importDefault(11746) /* metro dependency 11746: PollAnswerInput */;
const binding = env0_18;
return (
<PollAnswerInput
inputRef={binding.refWithKey('answer-' + a0.localCreationAnswerId)}
answer={a0}
index={a1}
channelId={channel.id}
onSubmitEditing={binding.focusNext}
onAnswerTextChange={handleAnswerTextChange}
onAnswerEmojiSelect={handleEmojiSelect}
onRemoveAnswer={handleRemoveAnswer}
onRemoveAnswerImage={handleRemoveAnswerImage}
canRemoveAnswer={canRemoveMoreAnswers}
error={fieldErrors == null ? value : fieldErrors['answer-' + a0.localCreationAnswerId]}
key={a0.localCreationAnswerId}
/>
);
}
function _fun89924() { // fn#89924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11920:3263, offset: 0x0202457d, size: 42 bytes, params: 1, frame: 11
if (!(env1_2.current || onCancel == null)) {
onCancel();
}
}