136 lines
8.1 KiB
TypeScript
136 lines
8.1 KiB
TypeScript
/* Metro module 9398; source: modules/oauth2/native/AuthorizeScopes.tsx; dependencies: [31, 27, 33, 4501, 1244, 6988, 697, 4073, 4573, 6518, 4121, 8042, 4122, 2] */
|
|
import UseInitialValue from '../../../hooks/useInitialValue.tsx'; /* Metro dependency 6518 */
|
|
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as ScopesModule from '../scopes.tsx'; /* Metro dependency 4121 */
|
|
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 ApplicationIntegrationTypeModule from '../../../external/discord_common/js/shared/shared-constants/ApplicationIntegrationType.tsx'; /* Metro dependency 8042 */
|
|
|
|
function _fun73272(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#73272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9584:6, offset: 0x01d65f0e, size: 319 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
const env0_6 = (CreateStylesModule).createStyles({scopesContainer: {'flexDirection': 'column',
|
|
'gap': 16}, scopes: {'flexDirection': 'column', 'gap': 16}, scopeContainer: {flexDirection: 'row'},
|
|
scope: {'flex': 1, 'flexDirection': 'column', 'justifyContent': 'center'}, iconWrapper: {'marginRight': 12,
|
|
'width': 20, 'height': 20}, fakeScopeIcon: {opacity: 0.6}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/oauth2/native/AuthorizeScopes.tsx');
|
|
exports.default = AuthorizeScopes;
|
|
function Scope_73273({text, error, isFake}) { // fn#73273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9584:433, offset: 0x01d6604d, size: 602 bytes, params: 2, frame: 31
|
|
const Text = (TextModule).Text;
|
|
const styles = useStyles();
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
const r11 = isFake ? Reflect.apply(string, intl, [t.OX8EMU]) : Reflect.apply(string, intl, [t['0lpCFG']]);
|
|
const value6 = '';
|
|
return (
|
|
<View
|
|
style={styles.scopeContainer}
|
|
accessible
|
|
accessibilityLabel={value6 + r11 + ': ' + text + (error != null ? '. ' + error : value6)}
|
|
>
|
|
<View
|
|
style={styles.iconWrapper}
|
|
accessible={false}
|
|
importantForAccessibility="no-hide-descendants"
|
|
>
|
|
{
|
|
isFake
|
|
? ((CircleXIcon) => <CircleXIcon style={styles.fakeScopeIcon} color={(importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED} size="refresh_sm" />)((require(6988) /* metro dependency 6988: CircleXIcon */).CircleXIcon)
|
|
: ((CircleCheckIcon) => <CircleCheckIcon color={(importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED} size="refresh_sm" />)((require(4073) /* metro dependency 4073: CircleCheckIcon */).CircleCheckIcon)
|
|
}
|
|
</View>
|
|
<View style={styles.scope}>
|
|
<Text variant="text-md/normal" color={isFake ? 'text-muted' : undefined}>
|
|
{text}
|
|
</Text>
|
|
{
|
|
error != null
|
|
? (
|
|
<Text variant="text-xs/normal">
|
|
{error}
|
|
</Text>
|
|
)
|
|
: null
|
|
}
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function AuthorizeScopes({application, accountScopes, requestedScopes, integrationType, errors, isTrustedName}) { // fn#73274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9584:1227, offset: 0x01d662a7, size: 556 bytes, params: 2, frame: 29
|
|
isTrustedName = !(isTrustedName === undefined) && isTrustedName;
|
|
const styles = useStyles();
|
|
const value2 = (UseInitialValue)(_fun73275);
|
|
if (accountScopes.length === 0) {
|
|
return null;
|
|
}
|
|
const value3 = value2();
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const r16 = isTrustedName ? t.PZpY9c : t['1Hz+Sl'];
|
|
const ApplicationIntegrationType = (ApplicationIntegrationTypeModule).ApplicationIntegrationType;
|
|
const USER_INSTALL = ApplicationIntegrationType.USER_INSTALL;
|
|
let r10 = integrationType === USER_INSTALL && requestedScopes.includes((require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes.APPLICATIONS_COMMANDS);
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const text = (
|
|
<Text variant="heading-sm/normal" color="text-default">
|
|
{intl.format(r16, {application: application.name})}
|
|
</Text>
|
|
);
|
|
const value8 = accountScopes.map(_fun73276).flat();
|
|
r10 = r10 && <Scope_73273 text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Ls2XRq)} />;
|
|
return (
|
|
<View style={styles.scopesContainer}>
|
|
{text}
|
|
<View style={styles.scopes}>
|
|
{value8}
|
|
{r10}
|
|
<Scope_73273 text={value3} isFake />
|
|
</View>
|
|
</View>
|
|
);
|
|
function _fun73275() { // fn#73275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9584:1370, offset: 0x01d664d3, size: 96 bytes, params: 1, frame: 17
|
|
let value = environment.__proto__;
|
|
const FAKE_SCOPES = (ScopesModule).FAKE_SCOPES;
|
|
const Math = global.Math;
|
|
const floor = Math.floor;
|
|
const Math2 = global.Math;
|
|
value = Math2.random();
|
|
const FAKE_SCOPES2 = (ScopesModule).FAKE_SCOPES;
|
|
return FAKE_SCOPES[Reflect.apply(floor, Math, [value * FAKE_SCOPES2.length])];
|
|
}
|
|
|
|
function _fun73276(a0) { // fn#73276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9584:1846, offset: 0x01d66533, size: 72 bytes, params: 2, frame: 14
|
|
var environment;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__;
|
|
const getScopeNames = (ScopesModule).getScopeNames;
|
|
value = Reflect.apply(getScopeNames, value, [a0, accountScopes]);
|
|
return value.map(_fun73277);
|
|
function _fun73277(a0, a1) { // fn#73277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9584:1882, offset: 0x01d6657b, size: 130 bytes, params: 3, frame: 21
|
|
const value = environment.__proto__.__proto__;
|
|
return (
|
|
<Scope_73273
|
|
text={a0}
|
|
error={a1 !== 0 || errors == null || errors[env0_0] == null ? undefined : errors[env0_0][0]}
|
|
key={'' + env0_0 + '-' + a1}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun73272, 9398, [31, 27, 33, 4501, 1244, 6988, 697, 4073, 4573, 6518, 4121, 8042, 4122,
|
|
2]) /* metro module 9398, dependencies: [31, 27, 33, 4501, 1244, 6988, 697, 4073, 4573, 6518, 4121, 8042, 4122, 2] */;
|