Files
discord-decomp/sources/modules/quests/native/BountiesModal/BountiesModalTimer.tsx
T
2026-07-27 16:20:00 +03:00

211 lines
12 KiB
TypeScript

/* Metro module 13540; source: modules/quests/native/BountiesModal/BountiesModalTimer.tsx; dependencies: [31, 27, 33, 4582, 4017, 7744, 4501, 697, 477, 4504, 4573, 8707, 2] */
function _fun102897(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102897, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13730:6, offset: 0x0224d951, size: 817 bytes, params: 8, frame: 26
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = undefined;
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const value2 = require(33) /* metro dependency 33 */;
const env0_5 = value2.jsx;
const env0_6 = value2.jsxs;
const SMALL_BUTTON_HEIGHT = (require(4582) /* metro dependency 4582: ButtonConstantsNative */).SMALL_BUTTON_HEIGHT;
const value3 = (SMALL_BUTTON_HEIGHT - 4) / 2;
const Math = global.Math;
const PI = Math.PI;
const env0_8 = 2 * PI * value3;
const Easing = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Easing;
const env0_9 = Easing.bezier(0.15, 0.21, 0.58, 1);
const env0_10 = Easing.bezier(0.61, 0, 0.58, 1);
const env0_11 = Easing.bezier(0.42, 0, 0.58, 1);
const reanimatedRexport = importDefault(4017) /* metro dependency 4017: ReanimatedRexport */;
const createAnimatedComponent = reanimatedRexport.createAnimatedComponent;
const Circle = (require(7744) /* metro dependency 7744 */).Circle;
const env0_12 = Reflect.apply(createAnimatedComponent, reanimatedRexport, [Circle]);
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object3 = {};
const object4 = {'alignItems': 'center', 'justifyContent': 'center'};
const CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT;
object4.backgroundColor = CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object4.width = SMALL_BUTTON_HEIGHT;
object4.height = SMALL_BUTTON_HEIGHT;
object3.progress = object4;
object3.ring = {position: 'absolute', transform: [{rotate: '-90deg'}]};
const BACKGROUND_SURFACE_HIGHEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGHEST;
object3.trackPath = {color: BACKGROUND_SURFACE_HIGHEST};
const object5 = {};
const CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT;
object5.color = CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
object5.lineHeight = platformUtilsModule.isAndroid() ? 14 : value;
object3.countdownText = object5;
object3.checkmarkLayer = {'position': 'absolute', 'inset': 6, 'alignItems': 'center', 'justifyContent': 'center'};
const object8 = {'width': 20, 'height': 20, 'backgroundColor': '#2ECC71'};
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object3.checkmarkBackground = object8;
object3.checkmarkIcon = {'width': 20, 'height': 20};
const env0_13 = Reflect.apply(createStyles, createStylesModule, [object3]);
object3 = {code: 'function BountiesModalTimerTsx1(){const{PROGRESS_CIRCUMFERENCE,animatedProgress}=this.__closure;return{strokeDashoffset:PROGRESS_CIRCUMFERENCE-PROGRESS_CIRCUMFERENCE*animatedProgress.get()};}'};
object3 = {code: 'function BountiesModalTimerTsx2(){const{checkmarkBackgroundScale}=this.__closure;return{transform:[{scale:checkmarkBackgroundScale.get()}]};}'};
object3 = {code: 'function BountiesModalTimerTsx3(){const{checkmarkScale}=this.__closure;return{transform:[{scale:checkmarkScale.get()}]};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/native/BountiesModal/BountiesModalTimer.tsx');
exports.default = BountiesModalTimer;
return value;
}
function BountiesModalTimer({isCompleted, totalSeconds, remainingSeconds}) { // fn#102898, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13730:1577, offset: 0x0224dc82, size: 1169 bytes, params: 2, frame: 34
const styles = useStyles();
let r6 = isCompleted || remainingSeconds <= 0;
const Math = global.Math;
const max = Math.max;
const Math2 = global.Math;
const value5 = Reflect.apply(max, Math, [1, Math2.ceil(remainingSeconds)]);
const r1 = isCompleted ? 1 : totalSeconds > 0 ? 1 - remainingSeconds / totalSeconds : 0;
const value8 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(r1);
const value9 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const env0_3 = value9;
const value10 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
let binding = env0_3;
binding.useEffect(_fun102899, [value8, r1]);
const env0_5 = binding.useRef(false);
binding.useEffect(_fun102900, [r6, value9, value10]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedProps = reanimatedRexportModule.useAnimatedProps;
let closure = BountiesModalTimerU;
binding = env0_8;
closure.__closure = {PROGRESS_CIRCUMFERENCE: binding, animatedProgress: value8};
closure.__workletHash = 12964700773124;
closure.__initData = env0_14;
const value11 = Reflect.apply(useAnimatedProps, reanimatedRexportModule, [closure]);
const moduleValue5 = reanimatedRexportModule;
let useAnimatedStyle = moduleValue5.useAnimatedStyle;
closure = BountiesModalTimerX;
closure.__closure = {checkmarkBackgroundScale: value9};
closure.__workletHash = 10834015407160;
closure.__initData = env0_15;
const value12 = Reflect.apply(useAnimatedStyle, moduleValue5, [closure]);
const moduleValue6 = reanimatedRexportModule;
useAnimatedStyle = moduleValue6.useAnimatedStyle;
closure = BountiesModalTimerG;
closure.__closure = {checkmarkScale: value10};
closure.__workletHash = 7510845920441;
closure.__initData = env0_16;
const value13 = Reflect.apply(useAnimatedStyle, moduleValue6, [closure]);
const defaultImport = importDefault(7744) /* metro dependency 7744 */;
const object = {};
const SMALL_BUTTON_HEIGHT = (require(4582) /* metro dependency 4582: ButtonConstantsNative */).SMALL_BUTTON_HEIGHT;
object.height = SMALL_BUTTON_HEIGHT;
object.width = SMALL_BUTTON_HEIGHT;
object.style = styles.ring;
const Circle = (require(7744) /* metro dependency 7744 */).Circle;
const binding2 = env0_7;
const items2 = [((Component) => <Component {...object}><Circle cx={SMALL_BUTTON_HEIGHT / 2} cy={SMALL_BUTTON_HEIGHT / 2} r={binding2} fill="none" stroke={styles.trackPath.color} strokeWidth={4} />{((Component) => <Component cx={SMALL_BUTTON_HEIGHT / 2} cy={SMALL_BUTTON_HEIGHT / 2} r={binding2} fill="none" stroke="#2ECC71" strokeWidth={4} strokeDasharray={binding} strokeLinecap="round" animatedProps={value11} />)(env0_12)}</Component>)(defaultImport)];
r6 = !r6 && ((Text) => <Text variant="text-sm/semibold" style={styles.countdownText} maxFontSizeMultiplier={1}>{value5}</Text>)((require(4573) /* metro dependency 4573: Text */).Text);
items2[1] = r6;
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
items2[2] = <View2 style={[styles.checkmarkLayer, value12]}><View style={styles.checkmarkBackground} /></View2>;
const View3 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const items4 = [styles.checkmarkLayer, value13];
const CheckmarkSmallBoldIcon = (require(8707) /* metro dependency 8707: CheckmarkSmallBoldIcon */).CheckmarkSmallBoldIcon;
const CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT;
items2[3] = <View3 style={items4}><CheckmarkSmallBoldIcon size="custom" color={CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT} style={styles.checkmarkIcon} /></View3>;
return (
<View style={styles.progress}>
{items2}
</View>
);
}
function _fun102899() { // fn#102899, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13730:1829, offset: 0x0224e113, size: 78 bytes, params: 1, frame: 18
const binding = env0_2;
const set = binding.set;
const timingModule = require(4504) /* metro dependency 4504: timing */;
Reflect.apply(set, binding, [timingModule.withTiming(env0_1, {duration: 500}, 'animate-always')]);
}
function _fun102900() { // fn#102900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13730:1936, offset: 0x0224e161, size: 388 bytes, params: 1, frame: 30
var r1;
var r0;
var value2;
var value3;
var moduleValue;
var withSequence;
var withTiming;
var value4;
var moduleValue3;
var withDelay;
var moduleValue4;
var moduleValue5;
var binding3;
var value5;
var moduleValue6;
var value;
const current = env0_5.current;
env0_5.current = true;
let binding = env0_0;
const binding2 = env0_3;
let set = binding2.set;
if (binding) {
if (current) {
value2 = environment.__proto__;
value3 = undefined;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
withSequence = moduleValue.withSequence;
value4 = (require(4504) /* metro dependency 4504: timing */).withTiming(1.65, {duration: 267,
easing: env1_9});
moduleValue3 = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue3.withTiming;
Reflect.apply(set, binding2, [Reflect.apply(withSequence, moduleValue, [value4, Reflect.apply(withTiming,
moduleValue3, [1, {duration: 233, easing: env1_10}])])]);
binding = env0_4;
set = binding.set;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
withDelay = value.withDelay;
moduleValue4 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
withSequence = moduleValue4.withSequence;
moduleValue5 = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue5.withTiming;
binding3 = env1_11;
value5 = Reflect.apply(withTiming, moduleValue5, [1.25, {duration: 167, easing: binding3}]);
moduleValue6 = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue6.withTiming;
Reflect.apply(set, binding, [Reflect.apply(withDelay, value, [167, Reflect.apply(withSequence, moduleValue4,
[value5, Reflect.apply(withTiming, moduleValue6, [1, {duration: 333, easing: binding3}])])])]);
r1 = value3;
} else {
Reflect.apply(set, binding2, [1]);
env0_4.set(1);
r1 = undefined;
}
r0 = r1;
} else {
Reflect.apply(set, binding2, [0]);
env0_4.set(0);
r0 = undefined;
}
return r0;
}
function BountiesModalTimerU() { // fn#102901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13730:2362, owner: BountiesModalTimer.U, offset: 0x0224e2e5, size: 40 bytes, params: 1, frame: 11
const binding = env1_8;
const binding2 = env0_2;
const get = binding2.get;
return {strokeDashoffset: binding - binding * Reflect.apply(get, binding2, [])};
}
function BountiesModalTimerX() { // fn#102902, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13730:2536, owner: BountiesModalTimer.x, offset: 0x0224e30d, size: 39 bytes, params: 1, frame: 11
const object = {};
object.scale = env0_3.get();
return {transform: [object]};
}
function BountiesModalTimerG() { // fn#102903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13730:2692, owner: BountiesModalTimer.G, offset: 0x0224e334, size: 39 bytes, params: 1, frame: 11
const object = {};
object.scale = env0_4.get();
return {transform: [object]};
}