198 lines
11 KiB
TypeScript
198 lines
11 KiB
TypeScript
/* Metro module 9400; source: modules/oauth2/native/WebhookGuildChannelSelector.tsx; dependencies: [5, 57, 31, 27, 1383, 3793, 1878, 33, 4501, 697, 4080, 9059, 1962, 1244, 4805, 9347, 4573, 1305, 7972, 2] */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
|
|
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 NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as ChannelRecordModule from '../../../records/ChannelRecord.tsx'; /* Metro dependency 1383 */
|
|
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 NativeModule2 from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */
|
|
|
|
function _fun73285(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#73285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9586:6, offset: 0x01d66b43, size: 440 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
const createStyles = (CreateStylesModule).createStyles;
|
|
object = {selectorGroup: {'flexDirection': 'column', 'gap': 8}};
|
|
const object2 = {};
|
|
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
|
|
object2.backgroundColor = BACKGROUND_BASE_LOWER;
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object.select = object2;
|
|
const TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
|
|
object.label = {color: TEXT_SUBTLE, fontWeight: '500'};
|
|
const RED_400 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.RED_400;
|
|
object.error = {color: RED_400};
|
|
value = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/oauth2/native/WebhookGuildChannelSelector.tsx');
|
|
exports.default = WebhookGuildChannelSelector;
|
|
exports.useStyles = value;
|
|
function WebhookGuildChannelSelector({selectedGuildId, selectedChannelId, onChannelChange, error}) { // fn#73286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9586:618, offset: 0x01d66cfb, size: 757 bytes, params: 2, frame: 29
|
|
const LegacyText = (NativeModule).LegacyText;
|
|
const styles = useStyles();
|
|
const binding = env0_5;
|
|
const [property, env0_4] = env0_4Binding(binding.useState(null), 2);
|
|
var env0_5 = binding.useRef(false);
|
|
const value6 = binding.useCallback(_fun73287, [property, onChannelChange, selectedChannelId, selectedGuildId]);
|
|
binding.useEffect(_fun73290, [onChannelChange, selectedGuildId]);
|
|
binding.useEffect(_fun73296, [property, onChannelChange, selectedChannelId, selectedGuildId]);
|
|
if (selectedGuildId == null) {
|
|
return null;
|
|
}
|
|
const r16 = property == null ? undefined : property.channels.find(function({id}) {
|
|
return id === selectedChannelId;
|
|
});
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const items2 = [
|
|
<Text variant="eyebrow" color="text-default">
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8qKd+J'])}
|
|
</Text>,
|
|
];
|
|
items2[1] = (
|
|
error != null
|
|
? (
|
|
error === ''
|
|
? null
|
|
: (
|
|
<LegacyText style={styles.error}>
|
|
{error}
|
|
</LegacyText>
|
|
)
|
|
)
|
|
: null
|
|
);
|
|
const FormRow = (NativeModule2).FormRow;
|
|
const r12 = r16?.name ?? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Re/64R']);
|
|
const FormRow2 = (NativeModule2).FormRow;
|
|
const Arrow = FormRow2.Arrow;
|
|
items2[2] = (
|
|
<FormRow
|
|
label={r12}
|
|
disabled={selectedGuildId == null}
|
|
trailing={<Arrow />}
|
|
DEPRECATED_style={styles.select}
|
|
onPress={value6}
|
|
/>
|
|
);
|
|
items2[3] = (
|
|
<LegacyText style={styles.label}>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.kQXMfN)}
|
|
</LegacyText>
|
|
);
|
|
return (
|
|
<View style={styles.selectorGroup}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
function _fun73287() { // fn#73287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9586:808, offset: 0x01d66ff0, size: 247 bytes, params: 1, frame: 23
|
|
var environment;
|
|
var value4;
|
|
var value5;
|
|
var defaultImport;
|
|
var openLazy;
|
|
var value6;
|
|
var object;
|
|
var intl;
|
|
if (Module00005 != null && Module00005.guildId === selectedGuildId) {
|
|
value4 = environment.__proto__;
|
|
value5 = undefined;
|
|
defaultImport = importDefault(dependencyMap[10]);
|
|
openLazy = defaultImport.openLazy;
|
|
value6 = require(dependencyMap[12])(dependencyMap[11], dependencyMap.paths);
|
|
object = {};
|
|
intl = require(dependencyMap[13]).intl;
|
|
object.title = intl.string(require(dependencyMap[13]).t['Re/64R']);
|
|
object.items = Module00005.channels.map(function(a0) {
|
|
var object = {};
|
|
object.label = require(dependencyMap[14]).computeChannelName(createChannelRecord(a0), UserStore,
|
|
RelationshipStore);
|
|
object.value = a0.id;
|
|
return object;
|
|
});
|
|
object.onItemSelect = onItemSelect_73289;
|
|
object.selectedItem = selectedChannelId ?? value5;
|
|
object.hasIcons = false;
|
|
Reflect.apply(openLazy, defaultImport, [value6, 'WebhookGuildChannelSelector', object]);
|
|
}
|
|
function onItemSelect_73289(a0) { // fn#73289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9586:1017, offset: 0x01d67132, size: 59 bytes, params: 2, frame: 12
|
|
let value = environment.__proto__;
|
|
onChannelChange(a0);
|
|
value = environment.__proto__.__proto__;
|
|
(ActionSheetActionCreators).hideActionSheet('WebhookGuildChannelSelector');
|
|
}
|
|
|
|
}
|
|
|
|
function _fun73290() { // fn#73290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9586:1140, offset: 0x01d6716d, size: 66 bytes, params: 1, frame: 13
|
|
env0_4(null);
|
|
if (selectedGuildId == null) {
|
|
onChannelChange(null);
|
|
} else {
|
|
(function(a0) {
|
|
return _updateChannels.apply(this, arguments);
|
|
})(selectedGuildId);
|
|
}
|
|
function _updateChannels() { // fn#73291, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9586:1145, offset: 0x01d671af, size: 53 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const value = environment.__proto__.__proto__;
|
|
return env2_3(_fun73293).apply(this, arguments);
|
|
function* _fun73293(a0) { // fn#73293, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9586:1198, offset: 0x01d671ef, size: 128 bytes, params: 2, frame: 15
|
|
var environment;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
value = env4_0(env4_2[15]);
|
|
yield value.fetchChannels(a0);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
if (require === a0) {
|
|
value.sort(function({name}, a1) {
|
|
return name.localeCompare(a1.name);
|
|
});
|
|
env3_4({guildId: a0, channels: value});
|
|
env3_5.current = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun73296() { // fn#73296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9586:1491, offset: 0x01d6728c, size: 94 bytes, params: 1, frame: 13
|
|
var channels;
|
|
if (env0_5.current) {
|
|
if (Module00005 == null) {
|
|
if (selectedChannelId != null) {
|
|
onChannelChange(null);
|
|
}
|
|
} else {
|
|
channels = Module00005.channels;
|
|
if (!channels.some(function({id}) {
|
|
return id === selectedChannelId;
|
|
})) {
|
|
onChannelChange(null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun73285, 9400, [5, 57, 31, 27, 1383, 3793, 1878, 33, 4501, 697, 4080, 9059, 1962, 1244, 4805, 9347,
|
|
4573, 1305, 7972,
|
|
2]) /* metro module 9400, dependencies: [5, 57, 31, 27, 1383, 3793, 1878, 33, 4501, 697, 4080, 9059, 1962, 1244, 4805, 9347, 4573, 1305, 7972, 2] */;
|