479 lines
25 KiB
TypeScript
479 lines
25 KiB
TypeScript
/* Metro module 9814; source: actions/GIFPickerActionCreators.tsx; dependencies: [1949, 9815, 661, 670, 4863, 9816, 9819, 507, 694, 22, 491, 1471, 9598, 1362, 1349, 4647, 1244, 683, 2] */
|
|
function _fun76851(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:6, offset: 0x01de77ac, size: 490 bytes, params: 8, frame: 24
|
|
let env0_0 = require;
|
|
const closure = trackSearchStart_76852;
|
|
const closure2 = trackSearchResultViewed_76853;
|
|
const closure3 = doSearchRequest;
|
|
const closure4 = resetSearch;
|
|
const closure5 = function(a0) {
|
|
var r1;
|
|
var r0;
|
|
var value = a0;
|
|
var value3 = importDefault(dependencyMap[11]).toURLSafe(value);
|
|
if (value3 == null) {
|
|
r0 = value;
|
|
} else {
|
|
if (require(dependencyMap[12]).isAttachmentUrl(value3)) {
|
|
value = require(dependencyMap[12]);
|
|
value = value.removeSignedUrlParameters(value3);
|
|
value = value.toString();
|
|
r1 = value;
|
|
} else {
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
|
|
const gifPickerViewStore = importDefault(9815) /* metro dependency 9815: GIFPickerViewStore */;
|
|
let value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_5 = value.AnalyticEvents;
|
|
const env0_6 = value.Endpoints;
|
|
const env0_7 = value.SearchTypes;
|
|
const env0_8 = value.GIFPickerResultTypes;
|
|
value = require(670) /* metro dependency 670: UserSettingsConstants */;
|
|
const env0_9 = value.MAX_FAVORITE_GIFS_SIZE;
|
|
const env0_10 = value.UserSettingsDelay;
|
|
const env0_11 = RegExp('-', 'g');
|
|
const env0_12 = (importDefault(22) /* metro dependency 22 */).debounce(closure3, 250);
|
|
const env0_13 = RegExp('\\.(webp|avif|gif)(\\?|$)', 'i');
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('actions/GIFPickerActionCreators.tsx');
|
|
exports.trackSearchStart = closure;
|
|
exports.trackSearchResultViewed = closure2;
|
|
exports.search = search_76861;
|
|
exports.fetchSuggestions = fetchSuggestions;
|
|
exports.resetSearch = closure4;
|
|
exports.trackSelectGIF = trackSelectGIF;
|
|
exports.initializeSearch = initializeSearch_76865;
|
|
exports.fetchTrending = fetchTrending;
|
|
exports.fetchTrendingGIFs = fetchTrendingGIFs;
|
|
exports.gifUrlKey = closure5;
|
|
exports.addFavoriteGIF = function(a0) {
|
|
var env0_0 = a0;
|
|
var FrecencyUserSettingsActionCreators = require(dependencyMap[13]).FrecencyUserSettingsActionCreators;
|
|
var INFREQUENT_USER_ACTION = UserSettingsDelay.INFREQUENT_USER_ACTION;
|
|
FrecencyUserSettingsActionCreators.updateAsync('favoriteGifs', _fun76873, INFREQUENT_USER_ACTION);
|
|
};
|
|
exports.removeFavoriteGIF = function(a0) {
|
|
var env0_0 = a0;
|
|
var FrecencyUserSettingsActionCreators = require(dependencyMap[13]).FrecencyUserSettingsActionCreators;
|
|
var INFREQUENT_USER_ACTION = UserSettingsDelay.INFREQUENT_USER_ACTION;
|
|
FrecencyUserSettingsActionCreators.updateAsync('favoriteGifs', _fun76876, INFREQUENT_USER_ACTION);
|
|
};
|
|
exports.fetchTrendingSearchTerms = fetchTrendingSearchTerms;
|
|
}
|
|
|
|
function trackSearchStart_76852(a0) { // fn#76852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:266, offset: 0x01de7996, size: 175 bytes, params: 2, frame: 19
|
|
const r6 = a0 != null ? {[a0]: 1} : {};
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
const SEARCH_STARTED = AnalyticEvents.SEARCH_STARTED;
|
|
const object2 = {};
|
|
const GIF = SearchTypes.GIF;
|
|
object2.search_type = GIF;
|
|
object2.load_id = GIFPickerViewStore.getAnalyticsID();
|
|
const Object = global.Object;
|
|
object2.num_modifiers = Object.keys(r6).length;
|
|
object2.modifiers = r6;
|
|
object2.gif_provider = (require(9816) /* metro dependency 9816: GifProviderConfig */).getProviderForAPIRequest();
|
|
Reflect.apply(trackWithMetadata, defaultImport, [SEARCH_STARTED, object2]);
|
|
}
|
|
|
|
function trackSearchResultViewed_76853(a0, a1) { // fn#76853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:507, offset: 0x01de7a45, size: 290 bytes, params: 3, frame: 21
|
|
let value = a2;
|
|
let r6 = value !== undefined ? value : {};
|
|
const startTime = r6.startTime;
|
|
value = Object.create(null);
|
|
value.startTime = 0;
|
|
const value2 = copyDataProperties({}, r6, value, undefined);
|
|
let object3 = {'offset': 0, 'limit': null};
|
|
object3.totalResults = a0.length;
|
|
const gifPickerUtilsModule = require(9819) /* metro dependency 9819: GIFPickerUtils */;
|
|
const calculateAnalyticsMetadata = gifPickerUtilsModule.calculateAnalyticsMetadata;
|
|
const analyticsID = GIFPickerViewStore.getAnalyticsID();
|
|
const object4 = {};
|
|
copyDataProperties(object4, object3, value);
|
|
copyDataProperties(object4, value2, value);
|
|
object4['results'] = a0.length;
|
|
const value5 = Reflect.apply(calculateAnalyticsMetadata, gifPickerUtilsModule, [analyticsID, a1, object4]);
|
|
r6 = startTime == null ? {} : {load_duration_ms: global.Date.now() - startTime};
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
const SEARCH_RESULT_VIEWED = AnalyticEvents.SEARCH_RESULT_VIEWED;
|
|
object3 = {};
|
|
copyDataProperties(object3, value5, value);
|
|
copyDataProperties(object3, r6, value);
|
|
value = require(9816) /* metro dependency 9816: GifProviderConfig */;
|
|
value = value.getProviderForAPIRequest();
|
|
object3['gif_provider'] = value;
|
|
Reflect.apply(trackWithMetadata, defaultImport, [SEARCH_RESULT_VIEWED, object3]);
|
|
}
|
|
|
|
function doSearchRequest(a0, a1, a2) { // fn#76854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:860, offset: 0x01de7b67, size: 224 bytes, params: 4, frame: 21
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
const Date = global.Date;
|
|
const env0_3 = Date.now();
|
|
trackSearchStart_76852(a1);
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const get = HTTP.get;
|
|
const object3 = {};
|
|
const GIFS_SEARCH = Endpoints.GIFS_SEARCH;
|
|
object3.url = GIFS_SEARCH;
|
|
const object4 = {q: a0};
|
|
object4.media_format = GIFPickerViewStore.getSelectedFormat();
|
|
object4.provider = (require(9816) /* metro dependency 9816: GifProviderConfig */).getProviderForAPIRequest();
|
|
object4.locale = LocaleStore.locale;
|
|
object4.limit = a2;
|
|
object3.query = object4;
|
|
object3.oldFormErrors = true;
|
|
object3.rejectWithError = true;
|
|
Reflect.apply(get, HTTP, [object3]).then(_fun76855, _fun76856);
|
|
}
|
|
|
|
function resetSearch() { // fn#76857, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:1373, offset: 0x01de7cf0, size: 51 bytes, params: 1, frame: 12
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({'type': 'GIF_PICKER_QUERY', 'query': ''});
|
|
}
|
|
|
|
function isProxiedAttachment({src}) { // fn#76859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:1595, offset: 0x01de7d9f, size: 121 bytes, params: 2, frame: 15
|
|
var r1;
|
|
var r0;
|
|
var isExternalProxiedAttachmentUrl2;
|
|
var value;
|
|
const value2 = (importDefault(1471) /* metro dependency 1471: URLUtils */).toURLSafe(src);
|
|
const value3 = value2 != null;
|
|
if (value3) {
|
|
isExternalProxiedAttachmentUrl2 = (require(9598) /* metro dependency 9598: SignedAttachmentLinkUtils */).isExternalProxiedAttachmentUrl(value2);
|
|
if (isExternalProxiedAttachmentUrl2) {
|
|
r1 = isExternalProxiedAttachmentUrl2;
|
|
} else {
|
|
value = require(9598) /* metro dependency 9598: SignedAttachmentLinkUtils */;
|
|
value = value.isAttachmentUrl(value2);
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value3;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isImageExtensionUrl(a0) { // fn#76860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:1782, offset: 0x01de7e18, size: 22 bytes, params: 2, frame: 11
|
|
return env0_13.test(a0);
|
|
}
|
|
|
|
function search_76861(a0, a1) { // fn#76861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:1996, offset: 0x01de7e2e, size: 120 bytes, params: 3, frame: 20
|
|
const value = a2;
|
|
if (a0 === '') {
|
|
resetSearch();
|
|
} else {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'GIF_PICKER_QUERY', query: a0});
|
|
if (value !== undefined ? value : false) {
|
|
doSearchRequest(a0, a1, a3);
|
|
} else {
|
|
env0_12(a0, a1, a3);
|
|
}
|
|
}
|
|
}
|
|
|
|
function fetchSuggestions(a0) { // fn#76862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:2153, offset: 0x01de7ea6, size: 178 bytes, params: 2, frame: 18
|
|
var HTTP;
|
|
var get;
|
|
var object3;
|
|
var object4;
|
|
const env0_0 = a0;
|
|
if (a0 !== '' && a0 != null) {
|
|
HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
get = HTTP.get;
|
|
object3 = {};
|
|
object3.url = Endpoints.GIFS_SUGGEST;
|
|
object4 = {q: a0};
|
|
object4.provider = (require(9816) /* metro dependency 9816: GifProviderConfig */).getProviderForAPIRequest();
|
|
object4.limit = 5;
|
|
object4.locale = LocaleStore.locale;
|
|
object3.query = object4;
|
|
object3.oldFormErrors = true;
|
|
object3.rejectWithError = true;
|
|
Reflect.apply(get, HTTP, [object3]).then(_fun76863);
|
|
}
|
|
}
|
|
|
|
function trackSelectGIF({type, index, offset, limit, results, totalResults, query, gifId}) { // fn#76864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:2498, offset: 0x01de7fa2, size: 316 bytes, params: 2, frame: 25
|
|
var object2;
|
|
const gifPickerUtilsModule = require(9819) /* metro dependency 9819: GIFPickerUtils */;
|
|
const value3 = gifPickerUtilsModule.calculateAnalyticsMetadata(GIFPickerViewStore.getAnalyticsID(), type,
|
|
{offset: offset, limit: limit, results: results, totalResults: totalResults});
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
const SEARCH_RESULT_SELECTED = AnalyticEvents.SEARCH_RESULT_SELECTED;
|
|
object2 = {};
|
|
copyDataProperties(object2, value3, undefined);
|
|
object2['index_num'] = index;
|
|
object2['source_object'] = 'GIF Picker';
|
|
object2['query'] = query;
|
|
Reflect.apply(trackWithMetadata, defaultImport, [SEARCH_RESULT_SELECTED, object2]);
|
|
if (gifId != null) {
|
|
(require(507) /* metro dependency 507: HTTPUtils */).HTTP.post({url: Endpoints.GIFS_SELECT, body: {id: gifId,
|
|
q: query,
|
|
provider: (require(9816) /* metro dependency 9816: GifProviderConfig */).getProviderForAPIRequest()},
|
|
oldFormErrors: true, rejectWithError: true});
|
|
}
|
|
}
|
|
|
|
function initializeSearch_76865() { // fn#76865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:2987, offset: 0x01de80de, size: 152 bytes, params: 1, frame: 19
|
|
const value3 = (require(491) /* metro dependency 491 */).v4().replace(env0_11, '');
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
const SEARCH_OPENED = AnalyticEvents.SEARCH_OPENED;
|
|
const GIF = SearchTypes.GIF;
|
|
Reflect.apply(trackWithMetadata, defaultImport, [SEARCH_OPENED, {search_type: GIF, load_id: value3}]);
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(_fun76866);
|
|
}
|
|
|
|
function fetchTrending() { // fn#76867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:3224, offset: 0x01de81b3, size: 156 bytes, params: 1, frame: 17
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const get = HTTP.get;
|
|
const object3 = {};
|
|
const GIFS_TRENDING = Endpoints.GIFS_TRENDING;
|
|
object3.url = GIFS_TRENDING;
|
|
const object4 = {};
|
|
object4.provider = (require(9816) /* metro dependency 9816: GifProviderConfig */).getProviderForAPIRequest();
|
|
object4.locale = LocaleStore.locale;
|
|
object4.media_format = GIFPickerViewStore.getSelectedFormat();
|
|
object3.query = object4;
|
|
object3.oldFormErrors = true;
|
|
object3.rejectWithError = true;
|
|
Reflect.apply(get, HTTP, [object3]).then(_fun76868);
|
|
}
|
|
|
|
function fetchTrendingGIFs(a0) { // fn#76869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:3605, offset: 0x01de82a4, size: 215 bytes, params: 2, frame: 21
|
|
const env0_0 = a0;
|
|
const Date = global.Date;
|
|
const env0_1 = Date.now();
|
|
const trackSearchStart_76852Binding = trackSearchStart_76852;
|
|
const TRENDING_GIFS = GIFPickerResultTypes.TRENDING_GIFS;
|
|
trackSearchStart_76852Binding(TRENDING_GIFS);
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const get = HTTP.get;
|
|
const object3 = {};
|
|
const GIFS_TRENDING_GIFS = Endpoints.GIFS_TRENDING_GIFS;
|
|
object3.url = GIFS_TRENDING_GIFS;
|
|
const object4 = {};
|
|
object4.media_format = GIFPickerViewStore.getSelectedFormat();
|
|
object4.provider = (require(9816) /* metro dependency 9816: GifProviderConfig */).getProviderForAPIRequest();
|
|
object4.locale = LocaleStore.locale;
|
|
object4.limit = a0;
|
|
object3.query = object4;
|
|
object3.oldFormErrors = true;
|
|
object3.rejectWithError = true;
|
|
Reflect.apply(get, HTTP, [object3]).then(_fun76870, _fun76871);
|
|
}
|
|
|
|
function addFavoriteGIF(a0) { // fn#76872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:4125, offset: 0x01de8415, size: 76 bytes, params: 2, frame: 16
|
|
const env0_0 = a0;
|
|
const FrecencyUserSettingsActionCreators = (require(1362) /* metro dependency 1362: UserSettingsProtoActionCreators */).FrecencyUserSettingsActionCreators;
|
|
const updateAsync = FrecencyUserSettingsActionCreators.updateAsync;
|
|
const INFREQUENT_USER_ACTION = UserSettingsDelay.INFREQUENT_USER_ACTION;
|
|
Reflect.apply(updateAsync, FrecencyUserSettingsActionCreators, ['favoriteGifs', _fun76873, INFREQUENT_USER_ACTION]);
|
|
}
|
|
|
|
function removeFavoriteGIF(a0) { // fn#76875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:5341, offset: 0x01de87f8, size: 76 bytes, params: 2, frame: 16
|
|
const env0_0 = a0;
|
|
const FrecencyUserSettingsActionCreators = (require(1362) /* metro dependency 1362: UserSettingsProtoActionCreators */).FrecencyUserSettingsActionCreators;
|
|
const updateAsync = FrecencyUserSettingsActionCreators.updateAsync;
|
|
const INFREQUENT_USER_ACTION = UserSettingsDelay.INFREQUENT_USER_ACTION;
|
|
Reflect.apply(updateAsync, FrecencyUserSettingsActionCreators, ['favoriteGifs', _fun76876, INFREQUENT_USER_ACTION]);
|
|
}
|
|
|
|
function fetchTrendingSearchTerms() { // fn#76877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:5637, offset: 0x01de88d4, size: 141 bytes, params: 1, frame: 17
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const get = HTTP.get;
|
|
const object3 = {};
|
|
const GIFS_TRENDING_SEARCH = Endpoints.GIFS_TRENDING_SEARCH;
|
|
object3.url = GIFS_TRENDING_SEARCH;
|
|
const object4 = {};
|
|
object4.provider = (require(9816) /* metro dependency 9816: GifProviderConfig */).getProviderForAPIRequest();
|
|
object4.limit = 5;
|
|
object4.locale = LocaleStore.locale;
|
|
object3.query = object4;
|
|
object3.oldFormErrors = true;
|
|
object3.rejectWithError = true;
|
|
Reflect.apply(get, HTTP, [object3]).then(_fun76878);
|
|
}
|
|
|
|
function _fun76855({body}) { // fn#76855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:1124, offset: 0x01de7c47, size: 108 bytes, params: 2, frame: 17
|
|
let value = environment.__proto__;
|
|
trackSearchResultViewed_76853(body, require, {startTime: env0_3, limit: importDefault});
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.dispatch({type: 'GIF_PICKER_QUERY_SUCCESS', query: env0_0, items: body});
|
|
}
|
|
|
|
function _fun76856() { // fn#76856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:1263, offset: 0x01de7cb3, size: 61 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
return (importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'GIF_PICKER_QUERY_FAILURE',
|
|
query: env0_0});
|
|
}
|
|
|
|
function _fun76863({body}) { // fn#76863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:2360, offset: 0x01de7f58, size: 74 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'GIF_PICKER_SUGGESTIONS_SUCCESS',
|
|
query: env0_0, items: body});
|
|
}
|
|
|
|
function _fun76866() { // fn#76866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:3136, offset: 0x01de8176, size: 61 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'GIF_PICKER_INITIALIZE',
|
|
analyticsID: env0_0});
|
|
}
|
|
|
|
function _fun76868({body}) { // fn#76868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:3434, offset: 0x01de824f, size: 85 bytes, params: 2, frame: 15
|
|
const categories = body.categories;
|
|
const gifs = body.gifs;
|
|
let value = environment.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.dispatch({type: 'GIF_PICKER_TRENDING_FETCH_SUCCESS', trendingCategories: categories,
|
|
trendingGIFPreview: gifs[0]});
|
|
}
|
|
|
|
function _fun76870({body}) { // fn#76870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:3884, offset: 0x01de837b, size: 105 bytes, params: 2, frame: 17
|
|
let value = environment.__proto__;
|
|
const trackSearchResultViewed_76853Binding = trackSearchResultViewed_76853;
|
|
const TRENDING_GIFS = GIFPickerResultTypes.TRENDING_GIFS;
|
|
trackSearchResultViewed_76853Binding(body, TRENDING_GIFS, {startTime: env0_1, limit: env0_0});
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.dispatch({type: 'GIF_PICKER_QUERY_SUCCESS', items: body});
|
|
}
|
|
|
|
function _fun76871() { // fn#76871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:4025, offset: 0x01de83e4, size: 49 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'GIF_PICKER_QUERY_FAILURE'});
|
|
}
|
|
|
|
function _fun76873(a0) { // fn#76873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:4224, offset: 0x01de8461, size: 908 bytes, params: 2, frame: 25
|
|
var r15;
|
|
var r6;
|
|
var r5;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
var value9;
|
|
var value10;
|
|
var defaultImport5;
|
|
var show;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const defaultImport = importDefault(22) /* metro dependency 22 */;
|
|
const max = defaultImport.max;
|
|
const Object = global.Object;
|
|
const values = Object.values;
|
|
let gifs = a0.gifs;
|
|
const value2 = Reflect.apply(values, Object, [gifs]);
|
|
const r8 = Reflect.apply(max, defaultImport, [value2.map(function(a0) {
|
|
return a0.order;
|
|
})]) ?? 0;
|
|
let binding = env0_0;
|
|
const regexp = RegExp('\\.(mp4|webm)(\\?|$)', 'i');
|
|
let r9 = regexp.test(binding.src) ? binding.gifSrc == null || binding.gifSrc === '' ? isProxiedAttachment(binding) && binding.gifSrc != null ? binding.gifSrc : binding.src : binding.gifSrc !== binding.src || isProxiedAttachment(binding) && binding.gifSrc != null ? binding.gifSrc : binding.src : isProxiedAttachment(binding) && binding.gifSrc != null ? binding.gifSrc : binding.src;
|
|
if (isProxiedAttachment(binding)) {
|
|
if (isImageExtensionUrl(r9)) {
|
|
value6 = (importDefault(1471) /* metro dependency 1471: URLUtils */).toURLSafe(r9);
|
|
if (value6 == null) {
|
|
r6 = r9;
|
|
} else {
|
|
value7 = value6.pathname.toLowerCase();
|
|
value8 = value7.endsWith('.webp');
|
|
value9 = value7.endsWith('.avif');
|
|
value10 = value7.endsWith('.gif');
|
|
if (value8) {
|
|
if (value9 || value10) {
|
|
value6.searchParams.set('format', 'webp');
|
|
}
|
|
value6.searchParams.set('animated', 'true');
|
|
r9 = value6.toString();
|
|
} else if (value9) {
|
|
if (value9 || value10) {
|
|
value6.searchParams.set('format', 'webp');
|
|
}
|
|
value6.searchParams.set('animated', 'true');
|
|
r9 = value6.toString();
|
|
} else if (value10) {
|
|
if (value9 || value10) {
|
|
value6.searchParams.set('format', 'webp');
|
|
}
|
|
value6.searchParams.set('animated', 'true');
|
|
r9 = value6.toString();
|
|
}
|
|
r6 = r9;
|
|
r15 = value7;
|
|
}
|
|
r5 = r6;
|
|
} else {
|
|
r5 = r9;
|
|
}
|
|
} else {
|
|
r5 = r9;
|
|
}
|
|
r5 = r5.startsWith('//') ? 'https:' + r5 : r5;
|
|
r9 = isImageExtensionUrl(r5) ? (require(1349) /* metro dependency 1349: frecency_user_settings */).GIFType.IMAGE : env0_0.format;
|
|
gifs = a0.gifs;
|
|
const gifUrlKeyBinding = gifUrlKey;
|
|
binding = env0_0;
|
|
const value13 = gifUrlKeyBinding(binding.url);
|
|
let object2 = {};
|
|
copyDataProperties(object2, binding, r15);
|
|
object2['src'] = r5;
|
|
object2['format'] = r9;
|
|
object2['order'] = r8 + 1;
|
|
gifs[value13] = object2;
|
|
const FavoriteGIFs = (require(1349) /* metro dependency 1349: frecency_user_settings */).FavoriteGIFs;
|
|
if (FavoriteGIFs.toBinary(a0).length > MAX_FAVORITE_GIFS_SIZE) {
|
|
defaultImport5 = importDefault(4647) /* metro dependency 4647: AlertActionCreators */;
|
|
show = defaultImport5.show;
|
|
object2 = {};
|
|
object2.title = intl.string(t['+XYXtZ']);
|
|
object2.body = intl.string(t.YSDH9n);
|
|
Reflect.apply(show, defaultImport5, [object2]);
|
|
return false;
|
|
}
|
|
const defaultImport3 = defaultImport;
|
|
const value14 = defaultImport3.size(a0.gifs);
|
|
if (value14 > 2) {
|
|
a0.hideTooltip = true;
|
|
}
|
|
const defaultImport4 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport4.track;
|
|
const GIF_FAVORITED = AnalyticEvents.GIF_FAVORITED;
|
|
Reflect.apply(track, defaultImport4, [GIF_FAVORITED, {total_num_favorited: value14}]);
|
|
}
|
|
|
|
function _fun76876(a0) { // fn#76876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:5443, offset: 0x01de8844, size: 144 bytes, params: 2, frame: 18
|
|
var value3;
|
|
const binding = env0_0;
|
|
let gifs = a0.gifs;
|
|
const value2 = binding in gifs;
|
|
gifs = a0.gifs;
|
|
if (value2) {
|
|
delete gifs[env0_0];
|
|
} else {
|
|
value3 = environment.__proto__;
|
|
delete gifs[gifUrlKey(env0_0)];
|
|
}
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const GIF_UNFAVORITED = AnalyticEvents.GIF_UNFAVORITED;
|
|
value = importDefault(22) /* metro dependency 22 */;
|
|
Reflect.apply(track, defaultImport, [GIF_UNFAVORITED, {total_num_favorited: value.size(a0.gifs)}]);
|
|
}
|
|
|
|
function _fun76878({body}) { // fn#76878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10000:5838, offset: 0x01de8961, size: 62 bytes, params: 2, frame: 14
|
|
let value = environment.__proto__;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.dispatch({type: 'GIF_PICKER_TRENDING_SEARCH_TERMS_SUCCESS', items: body});
|
|
}
|
|
|