161 lines
10 KiB
TypeScript
161 lines
10 KiB
TypeScript
/* Metro module 16255; source: modules/share/native/AppShare.tsx; dependencies: [57, 31, 27, 4874, 12950, 1226, 661, 11877, 33, 566, 5076, 477, 12989, 11880, 4884, 683, 4594, 13096, 12674, 1581, 5460, 15261, 15307, 4500, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import UseMountEffect from '../../../hooks/useMountEffect.tsx'; /* Metro dependency 4594 */
|
|
import AppContainer from '../../../components_native/AppContainer.tsx'; /* Metro dependency 13096 */
|
|
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as AlertModalNativeModule from '../../../design/components/AlertModal/native/AlertModal.native.tsx'; /* Metro dependency 4500 */
|
|
import * as AnalyticsTrackingStoreModule from '../../../stores/AnalyticsTrackingStore.tsx'; /* Metro dependency 4874 */
|
|
import * as ConstantsModule2 from '../../multi_account/Constants.tsx'; /* Metro dependency 11877 */
|
|
import * as MultiAccountActionCreatorsModule from '../../multi_account/MultiAccountActionCreators.tsx'; /* Metro dependency 11880 */
|
|
import * as ShareStoreModule from '../../../stores/native/ShareStore.tsx'; /* Metro dependency 12950 */
|
|
import * as MainSharedModule from '../../../components_native/MainShared.tsx'; /* Metro dependency 15261 */
|
|
|
|
function _fun125622(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#125622, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16463:6, offset: 0x025deaa8, size: 283 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_5 = value.BackHandler;
|
|
const env0_6 = value.NativeModules;
|
|
AnalyticsTrackingStoreModule;
|
|
ShareStoreModule;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/share/native/AppShare.tsx');
|
|
exports.default = AppShare;
|
|
function AppShare(a0) { // fn#125623, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16463:371, offset: 0x025debc3, size: 414 bytes, params: 2, frame: 22
|
|
var r6;
|
|
var moduleValue;
|
|
const env0_0 = a0;
|
|
let value = useInitialization(a0);
|
|
AppShareUseAuthenticated();
|
|
ReactModule.useEffect(_fun125632, [a0.attachments.length, a0.text]);
|
|
(UseMountEffect)(_fun125633);
|
|
if (value) {
|
|
value = importDefault(12674) /* metro dependency 12674: ShareScreen */;
|
|
moduleValue = require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */;
|
|
value = ((Component) => <Component appEntryKey="share" sharedContent={a0} onClose={moduleValue.isMetaQuest() ? NativeModules.ShareManager.close : BackHandler.exitApp} />)(value);
|
|
r6 = value;
|
|
} else {
|
|
const SceneLoadingIndicator = (require(5460) /* metro dependency 5460: SceneLoadingIndicatorNative */).SceneLoadingIndicator;
|
|
r6 = <SceneLoadingIndicator />;
|
|
}
|
|
const items2 = [r6];
|
|
const ActionSheetContainer = (MainSharedModule).ActionSheetContainer;
|
|
items2[1] = <ActionSheetContainer appEntryKey="share" />;
|
|
items2[2] = ((Component) => <Component />)(importDefault(15307) /* metro dependency 15307: ToastContainer */);
|
|
const AlertModalContainer = (AlertModalNativeModule).AlertModalContainer;
|
|
items2[3] = <AlertModalContainer />;
|
|
return (
|
|
<AppContainer appEntryKey="share">
|
|
{items2}
|
|
</AppContainer>
|
|
);
|
|
function useInitialization({targetUserId}) { // fn#125624, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16463:398, owner: AppShare.useInitialization, offset: 0x025ded61, size: 197 bytes, params: 2, frame: 22
|
|
let binding = env1_4;
|
|
let useState = binding.useState;
|
|
const value3 = env1_3(Reflect.apply(useState, binding, [false]), 2);
|
|
const property = value3[0];
|
|
const env0_2 = value3[1];
|
|
useState = binding.useState;
|
|
const value7 = env1_3(Reflect.apply(useState, binding,
|
|
[targetUserId == null || AuthenticationStore.getId() === targetUserId]), 2);
|
|
const property2 = value7[0];
|
|
const env0_3 = value7[1];
|
|
binding = env1_4;
|
|
binding.useEffect(_fun125625, [property]);
|
|
binding.useEffect(_fun125626, [targetUserId]);
|
|
return property && property2;
|
|
function _fun125625() { // fn#125625, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16463:567, offset: 0x025dee26, size: 60 bytes, params: 1, frame: 12
|
|
var value2;
|
|
if (!env0_1) {
|
|
value2 = environment.__proto__.__proto__;
|
|
(importDefault(12989) /* metro dependency 12989: AccessibilityManager */).init();
|
|
env0_2(true);
|
|
}
|
|
}
|
|
|
|
function _fun125626() { // fn#125626, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16463:619, offset: 0x025dee62, size: 76 bytes, params: 1, frame: 13
|
|
if (targetUserId != null && AuthenticationStore.getId() !== targetUserId) {
|
|
global.setTimeout(_fun125627, 18);
|
|
}
|
|
function _fun125627() { // fn#125627, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16463:660, offset: 0x025deeae, size: 78 bytes, params: 1, frame: 16
|
|
var environment;
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
const switchAccount = MultiAccountActionCreatorsModule.switchAccount;
|
|
const targetUserIdBinding = targetUserId;
|
|
const SHARE_EXTENSION = MultiAccountSwitchLocation.SHARE_EXTENSION;
|
|
Reflect.apply(switchAccount, MultiAccountActionCreatorsModule, [targetUserIdBinding, false,
|
|
SHARE_EXTENSION]).then(_fun125628);
|
|
function _fun125628() { // fn#125628, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16463:718, offset: 0x02011aa1, size: 18 bytes, params: 1, frame: 11
|
|
env2_3(true);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function AppShareUseAuthenticated() { // fn#125629, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16463:761, owner: AppShare.useAuthenticated, offset: 0x025deefc, size: 93 bytes, params: 1, frame: 16
|
|
env1_4.useEffect(_fun125631,
|
|
[(require(566) /* metro dependency 566: flux */).useStateFromStores([AuthenticationStore], function() {
|
|
return AuthenticationStore.isAuthenticated();
|
|
})]);
|
|
function _fun125631() { // fn#125631, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16463:866, offset: 0x025def6c, size: 113 bytes, params: 1, frame: 15
|
|
var defaultImport;
|
|
var startSession;
|
|
var authenticationStoreBinding;
|
|
var moduleValue;
|
|
if (env0_0) {
|
|
value = environment.__proto__.__proto__;
|
|
defaultImport = importDefault(5076) /* metro dependency 5076: AuthenticationActionCreators */;
|
|
startSession = defaultImport.startSession;
|
|
authenticationStoreBinding = AuthenticationStore;
|
|
Reflect.apply(startSession, defaultImport, [authenticationStoreBinding.getToken()]);
|
|
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
|
|
if (moduleValue.isAndroid()) {
|
|
NativeModules.NativePermissionManager.requestNotificationAuthorization();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun125632() { // fn#125632, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16463:1018, offset: 0x025defdd, size: 126 bytes, params: 1, frame: 18
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const EXTERNAL_SHARE_OPENED = AnalyticEvents.EXTERNAL_SHARE_OPENED;
|
|
Reflect.apply(track, defaultImport, [EXTERNAL_SHARE_OPENED,
|
|
{has_content: env0_0.text != null && env0_0.text.length > 0, has_attachment: env0_0.attachments.length > 0}]);
|
|
}
|
|
|
|
function _fun125633() { // fn#125633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16463:1188, offset: 0x025df05b, size: 126 bytes, params: 1, frame: 15
|
|
var environment;
|
|
const object = {};
|
|
const binding = env0_0;
|
|
object.numAttachments = binding.attachments.length;
|
|
object.mimeTypes = binding.attachments.map(function({mimeType}) {
|
|
return mimeType ?? 'unknown';
|
|
});
|
|
const numAttachments = object.numAttachments;
|
|
const mimeTypes = object.mimeTypes;
|
|
let value = environment.__proto__;
|
|
value = require(4884) /* metro dependency 4884: TTIAnalyticsUtils */;
|
|
value.trackAppUIViewed('share', {share_num_attachments: numAttachments, share_attachment_mimetypes: mimeTypes});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun125622, 16255, [57, 31, 27, 4874, 12950, 1226, 661, 11877, 33, 566, 5076, 477, 12989, 11880, 4884,
|
|
683, 4594, 13096, 12674, 1581, 5460, 15261, 15307, 4500,
|
|
2]) /* metro module 16255, dependencies: [57, 31, 27, 4874, 12950, 1226, 661, 11877, 33, 566, 5076, 477, 12989, 11880, 4884, 683, 4594, 13096, 12674, 1581, 5460, 15261, 15307, 4500, 2] */;
|