198 lines
9.9 KiB
TypeScript
198 lines
9.9 KiB
TypeScript
/* Metro module 15214; source: components_native/channel_settings/ChannelSettingsChangeRTCRegion.tsx; dependencies: [862, 6, 7, 15, 17, 18, 31, 1379, 15173, 33, 4501, 697, 1244, 8148, 7987, 7988, 7972, 3868, 566, 44, 2] */
|
|
function _fun116390(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:6, offset: 0x02487519, size: 409 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(862) /* metro dependency 862 */;
|
|
const env0_4 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_5 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_6 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_7 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_8 = importDefault(18) /* metro dependency 18 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const regionStore = importDefault(15173) /* metro dependency 15173: RegionStore */;
|
|
const env0_11 = (require(33) /* metro dependency 33 */).jsx;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createLegacyClassComponentStyles = createStylesModule.createLegacyClassComponentStyles;
|
|
const object = {};
|
|
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
|
|
object.backgroundColor = BACKGROUND_BASE_LOWER;
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.paddingHorizontal = PX_16;
|
|
const env0_12 = Reflect.apply(createLegacyClassComponentStyles, createStylesModule, [{form: object}]);
|
|
const PureComponent = value.PureComponent;
|
|
value = _fun116394(PureComponent);
|
|
const ThemeContext = (require(3868) /* metro dependency 3868: native */).ThemeContext;
|
|
value.contextType = ThemeContext;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/channel_settings/ChannelSettingsChangeRTCRegion.tsx');
|
|
exports.default = ConnectedChannelSettingsChangeRTCRegion;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_116391() { // fn#116391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:202, offset: 0x024876b2, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_116391_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun116394(a0) { // fn#116394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:573, offset: 0x02487714, size: 153 bytes, params: 2, frame: 16
|
|
const closure = ChannelSettingsChangeRTCRegion;
|
|
env0_8(closure, a0);
|
|
return env0_5(closure, [{key: 'handleSetRegion', value: value_116399}, {key: 'renderRegion', value: value_116401},
|
|
{key: 'renderRegions', value: value_116402}, {key: 'render', value: value_116404}]);
|
|
}
|
|
|
|
function ConnectedChannelSettingsChangeRTCRegion({channelId}) { // fn#116405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:2249, offset: 0x02487ba5, size: 125 bytes, params: 2, frame: 17
|
|
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
|
|
return ChannelStore.getChannel(channelId);
|
|
});
|
|
(importDefault(44) /* metro dependency 44 */)(channel != null,
|
|
'ConnectedChannelSettingsChangeRTCRegion: channel cannot be undefined');
|
|
return ((Component) => <Component channel={channel} />)(env0_13);
|
|
}
|
|
|
|
function ChannelSettingsChangeRTCRegion(a0) { // fn#116395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:585, offset: 0x024877ad, size: 149 bytes, params: 2, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_4;
|
|
binding(this, ChannelSettingsChangeRTCRegion);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_7(ChannelSettingsChangeRTCRegion);
|
|
binding = env1_6;
|
|
if (_isNativeReflectConstruct_116391()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_7(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.state = _fun116396();
|
|
return value;
|
|
}
|
|
|
|
function value_116399(a0) { // fn#116399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1403, offset: 0x02487991, size: 131 bytes, params: 2, frame: 17
|
|
var environment;
|
|
let value = a0;
|
|
const state = this.state;
|
|
const value2 = null;
|
|
const value3 = 'AUTOMATIC_RTC_REGION';
|
|
state.selectedRegionId = value2 != value ? value : value3;
|
|
const r6 = value !== value3 ? value : value2;
|
|
value = environment.__proto__;
|
|
value = importDefault(8148) /* metro dependency 8148: ChannelSettingsActionCreators */;
|
|
value.updateChannel({rtcRegion: r6});
|
|
this.setState({submitting: true}, _fun116400);
|
|
}
|
|
|
|
function value_116401(a0) { // fn#116401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1634, offset: 0x02487a5c, size: 72 bytes, params: 2, frame: 16
|
|
const TableRadioRow = (require(7987) /* metro dependency 7987: TableRadioRowNative */).TableRadioRow;
|
|
return (
|
|
<TableRadioRow
|
|
label={a0.name}
|
|
value={a0.id}
|
|
key={a0.id}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function value_116402() { // fn#116402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1739, offset: 0x02487aa4, size: 144 bytes, params: 1, frame: 17
|
|
const value3 = env1_3(this.state.regions).slice(0);
|
|
const value4 = value3.map(this.renderRegion, this);
|
|
const TableRadioGroup = (require(7988) /* metro dependency 7988: TableRadioGroupNative */).TableRadioGroup;
|
|
return (
|
|
<TableRadioGroup
|
|
defaultValue={this.state.selectedRegionId}
|
|
onChange={onChange_116403}
|
|
hasIcons={false}
|
|
>
|
|
{value4}
|
|
</TableRadioGroup>
|
|
);
|
|
}
|
|
|
|
function value_116404() { // fn#116404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1974, offset: 0x02487b4d, size: 88 bytes, params: 1, frame: 16
|
|
const value2 = env1_12(this.context);
|
|
const Form = (require(7972) /* metro dependency 7972: native */).Form;
|
|
return (
|
|
<Form style={value2.form}>
|
|
{this.renderRegions()}
|
|
</Form>
|
|
);
|
|
}
|
|
|
|
function _fun116396() { // fn#116396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:870, offset: 0x02487842, size: 272 bytes, params: 1, frame: 21
|
|
var push;
|
|
var value6;
|
|
var items2;
|
|
var value7;
|
|
const object2 = {'regions': null, 'submitting': false, 'selectedRegionId': 'AUTOMATIC_RTC_REGION'};
|
|
object2.regions = [];
|
|
const value = 'AUTOMATIC_RTC_REGION';
|
|
const getRegions = RegionStore.getRegions;
|
|
const channel = env0_0.props.channel;
|
|
const getGuildId = channel.getGuildId;
|
|
const value4 = Reflect.apply(getRegions, RegionStore, [Reflect.apply(getGuildId, channel, [])]);
|
|
const value5 = undefined;
|
|
const intl = require(dependencyMap[12]).intl;
|
|
const string = intl.string;
|
|
const JEmsap = require(dependencyMap[12]).t.JEmsap;
|
|
const items3 = [{'id': 'AUTOMATIC_RTC_REGION', 'name': null, 'sample_hostname': '', 'sample_port': 0, 'vip': false,
|
|
'deprecated': false, 'optimal': false, 'hidden': false, name: Reflect.apply(string, intl, [JEmsap])}];
|
|
if (value4 != null) {
|
|
push = items3.push;
|
|
value6 = value4.filter(function(a0) {
|
|
return !a0.deprecated && !a0.hidden;
|
|
});
|
|
items2 = [];
|
|
arraySpread(items2, value6, 0, dependencyMap);
|
|
apply(push, items2, items3, dependencyMap);
|
|
value7 = value4.find(_fun116398);
|
|
object2.selectedRegionId = (value7 == null ? value5 : value7.id) ?? value;
|
|
}
|
|
object2.regions = items3;
|
|
return object2;
|
|
}
|
|
|
|
function _fun116400() { // fn#116400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1540, offset: 0x02487a14, size: 72 bytes, params: 1, frame: 15
|
|
let value = environment.__proto__.__proto__;
|
|
value = importDefault(8148) /* metro dependency 8148: ChannelSettingsActionCreators */;
|
|
value.saveChannel(env0_0.props.channel.id, {rtcRegion: env0_1});
|
|
}
|
|
|
|
function value_116402OnChange(a0) { // fn#116403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1900, owner: value_116402.onChange, offset: 0x02487b34, size: 25 bytes, params: 2, frame: 11
|
|
return env0_0.handleSetRegion(a0);
|
|
}
|
|
|
|
function _fun116398({id}) { // fn#116398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1213, offset: 0x0248796c, size: 37 bytes, params: 2, frame: 2
|
|
return id === env1_0.props.channel.rtcRegion;
|
|
}
|
|
|