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

119 lines
6.0 KiB
TypeScript

/* Metro module 7081; source: modules/chat/SlowmodeUtils.tsx; dependencies: [3784, 661, 566, 1244, 672, 3738, 2] */
import Durations from '../../utils/Durations.tsx'; /* Metro dependency 672 */
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
function _fun56511(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#56511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7259:6, offset: 0x013c9e9d, size: 180 bytes, params: 8, frame: 19
let env0_0 = require;
const canBypassSlowmodeHelper = function(a0, a1, a2) {
return a2.can(Permissions.BYPASS_SLOWMODE, a0);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/chat/SlowmodeUtils.tsx');
exports.canBypassSlowmode = function(a0, a1) {
return canBypassSlowmodeHelper(a0, undefined, PermissionStore);
};
exports.useCanBypassSlowmode = function(a0, a1) {
var env0_0 = a0;
return require(dependencyMap[2]).useStateFromStores([PermissionStore], _fun56515);
};
exports.getSlowmodeIndicatorText = getSlowmodeIndicatorText;
exports.getSlowmodeDescription = getSlowmodeDescription;
function useCanBypassSlowmode(a0, a1) { // fn#56514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7259:380, offset: 0x013c9f8b, size: 64 bytes, params: 3, frame: 14
const env0_0 = a0;
return (FluxModule).useStateFromStores([PermissionStore], _fun56515);
function _fun56515() { // fn#56515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7259:454, offset: 0x013c9fcb, size: 29 bytes, params: 1, frame: 14
return canBypassSlowmodeHelper(env0_0, undefined, PermissionStore);
}
}
function getSlowmodeIndicatorText(a0, a1) { // fn#56516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7259:519, offset: 0x013c9fe8, size: 460 bytes, params: 3, frame: 22
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var value4;
var value7;
var value10;
var value;
if (a1) {
return intl.string(t['8+NidX']);
}
const Millis = (Durations).Millis;
const HOUR = Millis.HOUR;
if (a0 >= HOUR) {
value = importDefault(3738) /* metro dependency 3738 */;
value = value.duration(a0);
value7 = ('' + value.minutes()).padStart(2, '0');
value10 = ('' + value.seconds()).padStart(2, '0');
value = value.hours();
return '' + value + ':' + value7 + ':' + value10;
}
if (a0 > 0) {
value = importDefault(3738) /* metro dependency 3738 */;
value = value.duration(a0);
value4 = ('' + value.seconds()).padStart(2, '0');
value = value.minutes();
return '' + value + ':' + value4;
}
const string = intl.string;
const Icu3bf = t.Icu3bf;
return Reflect.apply(string, intl, [Icu3bf]);
}
function getSlowmodeDescription(a0) { // fn#56517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7259:933, offset: 0x013ca1b4, size: 548 bytes, params: 2, frame: 21
const intl = (IndexNativeModule).intl;
var formatToPlainString;
const t = (IndexNativeModule).t;
var Math;
var floor;
var value2;
var value3;
var value4;
var MINUTE;
var value5;
var value6;
var value7;
const value = a1;
let r1 = value !== undefined ? value : false;
let Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
let HOUR = Seconds.HOUR;
if (a0 >= HOUR) {
Math = global.Math;
floor = Math.floor;
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
HOUR = Seconds.HOUR;
value3 = Reflect.apply(floor, Math, [a0 / HOUR]);
Math = global.Math;
floor = Math.floor;
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
HOUR = Seconds.HOUR;
value4 = a0 - value3 * HOUR;
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
MINUTE = Seconds.MINUTE;
value5 = Reflect.apply(floor, Math, [value4 / MINUTE]);
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
HOUR = Seconds.HOUR;
value6 = a0 - value3 * HOUR;
Seconds = (importDefault(672) /* metro dependency 672: Durations */).Seconds;
MINUTE = Seconds.MINUTE;
value7 = value6 - value5 * MINUTE;
formatToPlainString = intl.formatToPlainString;
r1 = r1 ? t.oEwLez : t['3hz51F'];
return Reflect.apply(formatToPlainString, intl, [r1, {hours: value3, minutes: value5, seconds: value7}]);
}
if (a0 >= 60) {
value2 = global.Math.floor(a0 / 60);
return intl.formatToPlainString(r1 ? t.DARKYm : t.sY3wlG, {minutes: value2, seconds: a0 - 60 * value2});
}
return intl.formatToPlainString(r1 ? t['9yE8Ga'] : t.IWntYg, {seconds: a0});
}
}
global.__d(_fun56511, 7081, [3784, 661, 566, 1244, 672, 3738,
2]) /* metro module 7081, dependencies: [3784, 661, 566, 1244, 672, 3738, 2] */;