Files
2026-07-28 01:06:53 +03:00

407 lines
21 KiB
TypeScript

/* Metro module 14557; source: modules/guild_themes/native/GuildThemeNuxActionSheet.tsx; dependencies: [5, 57, 31, 27, 3969, 4042, 1376, 33, 3, 4501, 697, 14558, 4044, 566, 4080, 1244, 6275, 14559, 4573, 7988, 7987, 1305, 4578, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import SelectedGuildStore from '../../../stores/SelectedGuildStore.tsx'; /* Metro dependency 3969 */
import GuildThemeRuntimeStore from '../GuildThemeRuntimeStore.tsx'; /* Metro dependency 4042 */
import GuildThemeNuxPreviewGraphic from './GuildThemeNuxPreviewGraphic.tsx'; /* Metro dependency 14559 */
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 DismissibleContentConstantsModule from '../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */
import * as ClientModule from '../../../flow/Client.tsx'; /* Metro dependency 4044 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as TableRadioRowNativeModule from '../../../design/components/TableRow/native/TableRadioRow.native.tsx'; /* Metro dependency 7987 */
import * as TableRadioGroupNativeModule from '../../../design/components/TableRow/native/TableRadioGroup.native.tsx'; /* Metro dependency 7988 */
import * as GuildThemeNuxUtilsModule from '../GuildThemeNuxUtils.tsx'; /* Metro dependency 14558 */
function _fun110088(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:6, offset: 0x02369b02, size: 560 bytes, params: 8, frame: 24
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;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('GuildThemeNuxActionSheet');
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
const object2 = {};
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.padding = PX_16;
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.paddingTop = PX_8;
object2.paddingBottom = 0;
object.container = object2;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.title = {textAlign: 'center', marginBottom: PX_8};
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object.description = {textAlign: 'center', marginBottom: PX_24};
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object.options = {marginBottom: PX_12};
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object.warning = {marginBottom: PX_12};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.footer = {gap: PX_8};
const env0_13 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/guild_themes/native/GuildThemeNuxActionSheet.tsx');
exports.default = GuildThemeNuxActionSheet;
exports.GUILD_THEME_NUX_ACTION_SHEET_KEY = 'GuildThemeNuxActionSheet';
function GuildThemeNuxActionSheet({guildId, markAsDismissed}) { // fn#110089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:758, offset: 0x02369d32, size: 1596 bytes, params: 2, frame: 38
const HelpMessage = (require(1305) /* metro dependency 1305: native */).HelpMessage;
const styles = useStyles();
const binding = env0_5;
let useState = binding.useState;
const getInitialGuildThemeNuxSelection = (GuildThemeNuxUtilsModule).getInitialGuildThemeNuxSelection;
const value2 = Reflect.apply(useState, binding, [getInitialGuildThemeNuxSelection]);
const binding2 = env0_4;
const value3 = binding2(value2, 2);
const property = value3[0];
const env0_2 = value3[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, [null]), 2);
const property2 = value5[0];
const env0_3 = value5[1];
useState = binding.useState;
const value6 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property3 = value6[0];
var env0_4 = value6[1];
var env0_5 = binding.useRef(false);
const GuildThemeSourcePreference = (ClientModule).GuildThemeSourcePreference;
let PERSONAL = GuildThemeSourcePreference.PERSONAL;
const value7 = property === PERSONAL;
const guildId2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([SelectedGuildStore],
function() {
return SelectedGuildStore.getGuildId();
});
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildThemeRuntimeStore],
_fun110091, [guildId]);
binding.useEffect(_fun110092, [guildId, guildId2]);
const value9 = binding.useCallback(_fun110093, []);
const value10 = binding.useCallback(_fun110094, [markAsDismissed]);
const value12 = binding.useCallback(env0_3(_fun110096), [guildId, value7, markAsDismissed, guildId2]);
const value13 = binding.useCallback(_fun110097, [value10]);
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const r12 = value7 ? Reflect.apply(string, intl, [t.cvoikF]) : Reflect.apply(string, intl, [t['cY+Oob']]);
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const bottomSheetProps = {startExpanded: true,
dismissAccessibilityLabel: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq),
onDismiss: value13, contentStyles: styles.container};
const items2 = [
((Component) => <Component themeSettings={value8} isPersonal={value7} />)(GuildThemeNuxPreviewGraphic),
];
const Text = (TextModule).Text;
string = intl.string;
const Q9zFy9 = (require(1244) /* metro dependency 1244: indexNative */).t.Q9zFy9;
items2[1] = (
<Text
accessibilityRole="header"
variant="heading-xl/semibold"
color="mobile-text-heading-primary"
style={styles.title}
>
{Reflect.apply(string, intl, [Q9zFy9])}
</Text>
);
string = intl.string;
const XLpBLj = (require(1244) /* metro dependency 1244: indexNative */).t.XLpBLj;
items2[2] = (
<Text
variant="text-md/normal"
color="text-default"
style={styles.description}
>
{Reflect.apply(string, intl, [XLpBLj])}
</Text>
);
const TableRadioGroup = (TableRadioGroupNativeModule).TableRadioGroup;
const TableRadioRow = (TableRadioRowNativeModule).TableRadioRow;
string = intl.string;
const aN3RNQ = (require(1244) /* metro dependency 1244: indexNative */).t.aN3RNQ;
const GUILD = GuildThemeSourcePreference.GUILD;
const tableRadioRow = <TableRadioRow label={Reflect.apply(string, intl, [aN3RNQ])} value={GUILD} />;
string = intl.string;
const js8y7t = (require(1244) /* metro dependency 1244: indexNative */).t.js8y7t;
PERSONAL = GuildThemeSourcePreference.PERSONAL;
items2[3] = (
<View style={styles.options}>
<TableRadioGroup
hasIcons={false}
value={property}
onChange={value9}
>
{tableRadioRow}
<TableRadioRow label={Reflect.apply(string, intl, [js8y7t])} value={PERSONAL} />
</TableRadioGroup>
</View>
);
items2[4] = (
value7
? (
<View style={styles.warning}>
<HelpMessage
messageType={(require(1305) /* metro dependency 1305: native */).HelpMessageTypes.WARNING}
borderRadius={(importDefault(697) /* metro dependency 697: native */).radii.md}
>
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.tTHQAy)}
</HelpMessage>
</View>
)
: null
);
items2[5] = (
property2 != null
? (
<View style={styles.warning}>
<HelpMessage
messageType={(require(1305) /* metro dependency 1305: native */).HelpMessageTypes.ERROR}
borderRadius={(importDefault(697) /* metro dependency 697: native */).radii.md}
>
{property2}
</HelpMessage>
</View>
)
: null
);
const Button = (ButtonNativeModule).Button;
items2[6] = (
<View style={styles.footer}>
<Button
text={r12}
variant={value7 ? 'secondary' : 'primary'}
loading={property3}
disabled={property3}
onPress={value12}
/>
</View>
);
return (
<BottomSheet {...bottomSheetProps}>
{items2}
</BottomSheet>
);
function _fun110091() { // fn#110091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:1151, offset: 0x0236a381, size: 66 bytes, params: 1, frame: 12
let value = environment.__proto__;
value = GuildThemeRuntimeStore.getGuildThemeSnapshot(guildId);
const value2 = null;
return value2 != value && value.enabled && value2 != value.themeSettings ? value.themeSettings : value2;
}
function _fun110092() { // fn#110092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:1271, offset: 0x0236a3c3, size: 61 bytes, params: 1, frame: 11
var value;
if (guildId !== guildId) {
value = environment.__proto__;
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
value.hideActionSheet('GuildThemeNuxActionSheet');
}
}
function _fun110093(a0) { // fn#110093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:1341, offset: 0x0236a400, size: 30 bytes, params: 2, frame: 12
env0_3(null);
env0_2(a0);
}
function _fun110094(a0) { // fn#110094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:1381, offset: 0x0236a41e, size: 45 bytes, params: 2, frame: 11
if (!env0_5.current) {
env0_5.current = true;
markAsDismissed(a0);
}
}
function* _fun110096() { // fn#110096, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:1442, offset: 0x0236a456, size: 288 bytes, params: 1, frame: 18
var binding;
var binding2;
var property;
var value4;
var saveGuildThemeNuxPreference;
var value5;
var value6;
var value7;
var error;
var binding3;
var binding4;
var intl;
var string;
var t;
var fEptJP;
if (true) {
value = environment.__proto__;
if (SelectedGuildStore === require) {
env1_4(true);
env1_3(null);
try {
binding = env2_0;
} catch (error) {
binding = env2_12;
binding.error('Failed to save guild theme NUX preference', error);
binding = env1_3;
binding3 = env2_0;
binding4 = env2_2;
intl = binding3(binding4[15]).intl;
string = intl.string;
t = binding3(binding4[15]).t;
fEptJP = t.fEptJP;
binding(Reflect.apply(string, intl, [fEptJP]));
env1_4(false);
return undefined;
}
try {
binding2 = env2_2;
} catch (error) {
binding = env2_12;
binding.error('Failed to save guild theme NUX preference', error);
binding = env1_3;
binding3 = env2_0;
binding4 = env2_2;
intl = binding3(binding4[15]).intl;
string = intl.string;
t = binding3(binding4[15]).t;
fEptJP = t.fEptJP;
binding(Reflect.apply(string, intl, [fEptJP]));
env1_4(false);
return undefined;
}
try {
property = binding2[11];
} catch (error) {
binding = env2_12;
binding.error('Failed to save guild theme NUX preference', error);
binding = env1_3;
binding3 = env2_0;
binding4 = env2_2;
intl = binding3(binding4[15]).intl;
string = intl.string;
t = binding3(binding4[15]).t;
fEptJP = t.fEptJP;
binding(Reflect.apply(string, intl, [fEptJP]));
env1_4(false);
return undefined;
}
try {
value4 = binding(property);
} catch (error) {
binding = env2_12;
binding.error('Failed to save guild theme NUX preference', error);
binding = env1_3;
binding3 = env2_0;
binding4 = env2_2;
intl = binding3(binding4[15]).intl;
string = intl.string;
t = binding3(binding4[15]).t;
fEptJP = t.fEptJP;
binding(Reflect.apply(string, intl, [fEptJP]));
env1_4(false);
return undefined;
}
try {
saveGuildThemeNuxPreference = value4.saveGuildThemeNuxPreference;
} catch (error) {
binding = env2_12;
binding.error('Failed to save guild theme NUX preference', error);
binding = env1_3;
binding3 = env2_0;
binding4 = env2_2;
intl = binding3(binding4[15]).intl;
string = intl.string;
t = binding3(binding4[15]).t;
fEptJP = t.fEptJP;
binding(Reflect.apply(string, intl, [fEptJP]));
env1_4(false);
return undefined;
}
try {
} catch (error) {
binding = env2_12;
binding.error('Failed to save guild theme NUX preference', error);
binding = env1_3;
binding3 = env2_0;
binding4 = env2_2;
intl = binding3(binding4[15]).intl;
string = intl.string;
t = binding3(binding4[15]).t;
fEptJP = t.fEptJP;
binding(Reflect.apply(string, intl, [fEptJP]));
env1_4(false);
return undefined;
}
try {
} catch (error) {
binding = env2_12;
binding.error('Failed to save guild theme NUX preference', error);
binding = env1_3;
binding3 = env2_0;
binding4 = env2_2;
intl = binding3(binding4[15]).intl;
string = intl.string;
t = binding3(binding4[15]).t;
fEptJP = t.fEptJP;
binding(Reflect.apply(string, intl, [fEptJP]));
env1_4(false);
return undefined;
}
try {
value5 = Reflect.apply(saveGuildThemeNuxPreference, value4, [require, View]);
} catch (error) {
binding = env2_12;
binding.error('Failed to save guild theme NUX preference', error);
binding = env1_3;
binding3 = env2_0;
binding4 = env2_2;
intl = binding3(binding4[15]).intl;
string = intl.string;
t = binding3(binding4[15]).t;
fEptJP = t.fEptJP;
binding(Reflect.apply(string, intl, [fEptJP]));
env1_4(false);
return undefined;
}
yield value5;
try {
value6 = undefined;
value7 = false;
} catch (error) {
binding = env2_12;
binding.error('Failed to save guild theme NUX preference', error);
binding = env1_3;
binding3 = env2_0;
binding4 = env2_2;
intl = binding3(binding4[15]).intl;
string = intl.string;
t = binding3(binding4[15]).t;
fEptJP = t.fEptJP;
binding(Reflect.apply(string, intl, [fEptJP]));
env1_4(false);
return undefined;
}
if (value7) {
return value6;
}
env1_5.current = true;
var TAKE_ACTION = env2_9.TAKE_ACTION;
importDefault(TAKE_ACTION);
binding = env2_1;
binding(env2_2[14]).hideActionSheet('GuildThemeNuxActionSheet');
}
}
}
function _fun110097() { // fn#110097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:1745, offset: 0x0236a576, size: 29 bytes, params: 1, frame: 11
const binding = env0_8;
const USER_DISMISS = ContentDismissActionType.USER_DISMISS;
binding(USER_DISMISS);
}
}
}
global.__d(_fun110088, 14557, [5, 57, 31, 27, 3969, 4042, 1376, 33, 3, 4501, 697, 14558, 4044, 566, 4080, 1244,
6275, 14559, 4573, 7988, 7987, 1305, 4578,
2]) /* metro module 14557, dependencies: [5, 57, 31, 27, 3969, 4042, 1376, 33, 3, 4501, 697, 14558, 4044, 566, 4080, 1244, 6275, 14559, 4573, 7988, 7987, 1305, 4578, 2] */;