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

103 lines
6.5 KiB
TypeScript

/* Metro module 11051; source: modules/stickers/native/StickersUtils.tsx; dependencies: [31, 27, 1867, 1878, 11052, 661, 1346, 11049, 4785, 11053, 11054, 1583, 2] */
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
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 ExpressionPickerConstantsModule from '../../expression_picker/ExpressionPickerConstants.tsx'; /* Metro dependency 1346 */
import * as StickersTypesModule from '../StickersTypes.tsx'; /* Metro dependency 4785 */
import * as StickersHooksModule from '../StickersHooks.tsx'; /* Metro dependency 11049 */
import * as StickerPickerStoreModule from './StickerPickerStore.tsx'; /* Metro dependency 11052 */
function _fun84642(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11237:6, offset: 0x01f51cd6, size: 284 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/stickers/native/StickersUtils.tsx');
exports.useStickerCategories = useStickerCategories;
exports.preloadSticker = function({hash, url, width, height, frames, callback}) {
var NativeLottieUtils = NativeModules.NativeLottieUtils;
NativeLottieUtils.preload(hash, url, width, height, frames, callback);
};
exports.dropPreloadedSticker = function(a0) {
var NativeLottieUtils = NativeModules.NativeLottieUtils;
NativeLottieUtils.dropPreload(a0);
};
exports.openStickerPickerToPackId = openStickerPickerToPackId;
function useStickerCategories(a0) { // fn#84643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11237:348, offset: 0x01f51df2, size: 120 bytes, params: 2, frame: 16
return ReactModule.useMemo(_fun84644, [GuildStore.getGuilds(),
(StickersHooksModule).useStickerPackCategories(a0),
UserStore.getCurrentUser()]);
function _fun84644() { // fn#84644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11237:449, offset: 0x01f51e6a, size: 62 bytes, params: 1, frame: 12
let value = env0_0.filter(function(a0) {
return a0.stickers.length > 0;
});
value = value.filter(_fun84646);
return value.map(_fun84647);
function _fun84646({id, type}) { // fn#84646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11237:496, offset: 0x01f51ebe, size: 160 bytes, params: 2, frame: 15
const value = environment.__proto__;
const property = env1_2[id];
const StickerCategoryTypes = (StickersTypesModule).StickerCategoryTypes;
const GUILD = StickerCategoryTypes.GUILD;
let r0 = type !== GUILD || env1_1 != null && env1_1.nsfwAllowed;
r0 = !r0 ? property == null : r0;
r0 = !r0 ? property.nsfwLevel !== GuildNSFWContentLevel.AGE_RESTRICTED && property.nsfwLevel !== GuildNSFWContentLevel.EXPLICIT : r0;
return !!r0;
}
function _fun84647(a0) { // fn#84647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11237:667, offset: 0x01f51f5e, size: 192 bytes, params: 2, frame: 16
var r2;
var object;
let type = a0.type;
const value = environment.__proto__.__proto__;
const StickerCategoryTypes = (StickersTypesModule).StickerCategoryTypes;
const FAVORITE = StickerCategoryTypes.FAVORITE;
if (type === FAVORITE) {
r2 = a0.type === StickerCategoryTypes.FAVORITE ? importDefault(11053) /* metro dependency 11053 */ : importDefault(11054) /* metro dependency 11054 */;
object = {};
copyDataProperties(object, a0, 8);
object['icon'] = r2;
return object;
}
type = a0.type;
const RECENT = StickerCategoryTypes.RECENT;
if (type === RECENT) {
r2 = a0.type === StickerCategoryTypes.FAVORITE ? importDefault(11053) /* metro dependency 11053 */ : importDefault(11054) /* metro dependency 11054 */;
object = {};
copyDataProperties(object, a0, 8);
object['icon'] = r2;
return object;
}
return a0;
}
}
}
function openStickerPickerToPackId(a0, a1) { // fn#84650, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11237:1087, offset: 0x01f52080, size: 68 bytes, params: 3, frame: 13
const env0_0 = a0;
useStickerPickerStore.getState().setPackToScrollTo(a1);
global.setTimeout(_fun84651, 1);
function _fun84651() { // fn#84651, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11237:1141, offset: 0x01f520c4, size: 90 bytes, params: 1, frame: 15
var openCustomKeyboard;
var object;
const current = env0_0.current;
if (current != null) {
openCustomKeyboard = current.openCustomKeyboard;
object = {};
value = environment.__proto__;
object.type = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes.EXPRESSION;
object.context = ExpressionPickerViewType.STICKER;
Reflect.apply(openCustomKeyboard, current, [object]);
}
}
}
}
global.__d(_fun84642, 11051, [31, 27, 1867, 1878, 11052, 661, 1346, 11049, 4785, 11053, 11054, 1583,
2]) /* metro module 11051, dependencies: [31, 27, 1867, 1878, 11052, 661, 1346, 11049, 4785, 11053, 11054, 1583, 2] */;