/* 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] */ 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 var object3; const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(5) /* metro dependency 5 */; const env0_4 = importDefault(57) /* metro dependency 57 */; const env0_5 = importAll(31) /* metro dependency 31 */; const env0_6 = (require(27) /* metro dependency 27 */).View; const env0_7 = (require(1383) /* metro dependency 1383: ChannelRecord */).createChannelRecord; const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */; const userStore = importDefault(1878) /* metro dependency 1878: UserStore */; let value = require(33) /* metro dependency 33 */; const env0_10 = value.jsx; const env0_11 = value.jsxs; const createStyles = (require(4501) /* metro dependency 4501: createStyles */).createStyles; object3 = {selectorGroup: {'flexDirection': 'column', 'gap': 8}}; const object4 = {}; const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER; object4.backgroundColor = BACKGROUND_BASE_LOWER; object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs; object3.select = object4; const TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE; object3.label = {color: TEXT_SUBTLE, fontWeight: '500'}; const RED_400 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.RED_400; object3.error = {color: RED_400}; value = Reflect.apply(createStyles, value, [object3]); (require(2) /* metro dependency 2 */).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 = (require(1305) /* metro dependency 1305: native */).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 = (require(4573) /* metro dependency 4573: Text */).Text; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const items2 = [{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8qKd+J'])}]; items2[1] = error != null ? error === '' ? null : {error} : null; const FormRow = (require(7972) /* metro dependency 7972: native */).FormRow; const r12 = r16?.name ?? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Re/64R']); const FormRow2 = (require(7972) /* metro dependency 7972: native */).FormRow; const Arrow = FormRow2.Arrow; items2[2] = } DEPRECATED_style={styles.select} onPress={value6} />; items2[3] = {intl.string((require(1244) /* metro dependency 1244: indexNative */).t.kQXMfN)}; return ( {items2} ); } 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 object2; var intl; if (env0_3 != null && env0_3.guildId === selectedGuildId) { value4 = environment.__proto__; value5 = undefined; defaultImport = importDefault(dependencyMap[10]); openLazy = defaultImport.openLazy; value6 = require(dependencyMap[12])(dependencyMap[11], dependencyMap.paths); object2 = {}; intl = require(dependencyMap[13]).intl; object2.title = intl.string(require(dependencyMap[13]).t['Re/64R']); object2.items = env0_3.channels.map(function(a0) { var object = {}; object.label = require(dependencyMap[14]).computeChannelName(createChannelRecord(a0), UserStore, RelationshipStore); object.value = a0.id; return object; }); object2.onItemSelect = onItemSelect_73289; object2.selectedItem = selectedChannelId ?? value5; object2.hasIcons = false; Reflect.apply(openLazy, defaultImport, [value6, 'WebhookGuildChannelSelector', object2]); } } 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 _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 (env0_3 == null) { if (selectedChannelId != null) { onChannelChange(null); } } else { channels = env0_3.channels; if (!channels.some(function({id}) { return id === selectedChannelId; })) { onChannelChange(null); } } } } 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__; (importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet('WebhookGuildChannelSelector'); } 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; } } }